/*
gravity

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 0.28.1
*/

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

package api

import (
	"encoding/json"
)

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

// AuthPermission struct for AuthPermission
type AuthPermission struct {
	Methods []string `json:"methods,omitempty"`
	Path    *string  `json:"path,omitempty"`
}

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

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

// GetMethods returns the Methods field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AuthPermission) GetMethods() []string {
	if o == nil {
		var ret []string
		return ret
	}
	return o.Methods
}

// GetMethodsOk returns a tuple with the Methods field value if set, nil otherwise
// 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 *AuthPermission) GetMethodsOk() ([]string, bool) {
	if o == nil || IsNil(o.Methods) {
		return nil, false
	}
	return o.Methods, true
}

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

	return false
}

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

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

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

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

	return false
}

// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *AuthPermission) SetPath(v string) {
	o.Path = &v
}

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

func (o AuthPermission) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.Methods != nil {
		toSerialize["methods"] = o.Methods
	}
	if !IsNil(o.Path) {
		toSerialize["path"] = o.Path
	}
	return toSerialize, nil
}

type NullableAuthPermission struct {
	value *AuthPermission
	isSet bool
}

func (v NullableAuthPermission) Get() *AuthPermission {
	return v.value
}

func (v *NullableAuthPermission) Set(val *AuthPermission) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAuthPermission(val *AuthPermission) *NullableAuthPermission {
	return &NullableAuthPermission{value: val, isSet: true}
}

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

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