/*
Edge Application API

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

API version: 2.0.0
*/

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

package edgeapplications

import (
	"encoding/json"
	"bytes"
	"fmt"
)

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

// OriginsResultResponse struct for OriginsResultResponse
type OriginsResultResponse struct {
	OriginId *int64 `json:"origin_id,omitempty"`
	OriginKey *string `json:"origin_key,omitempty"`
	Name string `json:"name"`
	OriginType *string `json:"origin_type,omitempty"`
	Addresses []OriginsResultResponseAddresses `json:"addresses,omitempty"`
	OriginProtocolPolicy *string `json:"origin_protocol_policy,omitempty"`
	IsOriginRedirectionEnabled *bool `json:"is_origin_redirection_enabled,omitempty"`
	HostHeader *string `json:"host_header,omitempty"`
	Method *string `json:"method,omitempty"`
	OriginPath *string `json:"origin_path,omitempty"`
	ConnectionTimeout *int64 `json:"connection_timeout,omitempty"`
	TimeoutBetweenBytes *int64 `json:"timeout_between_bytes,omitempty"`
	HmacAuthentication *bool `json:"hmac_authentication,omitempty"`
	HmacRegionName *string `json:"hmac_region_name,omitempty"`
	HmacAccessKey *string `json:"hmac_access_key,omitempty"`
	HmacSecretKey *string `json:"hmac_secret_key,omitempty"`
	Bucket *string `json:"bucket,omitempty"`
	Prefix *string `json:"prefix,omitempty"`
}

type _OriginsResultResponse OriginsResultResponse

// NewOriginsResultResponse instantiates a new OriginsResultResponse 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 NewOriginsResultResponse(name string) *OriginsResultResponse {
	this := OriginsResultResponse{}
	this.Name = name
	return &this
}

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

// GetOriginId returns the OriginId field value if set, zero value otherwise.
func (o *OriginsResultResponse) GetOriginId() int64 {
	if o == nil || IsNil(o.OriginId) {
		var ret int64
		return ret
	}
	return *o.OriginId
}

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

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

	return false
}

// SetOriginId gets a reference to the given int64 and assigns it to the OriginId field.
func (o *OriginsResultResponse) SetOriginId(v int64) {
	o.OriginId = &v
}

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

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

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

	return false
}

// SetOriginKey gets a reference to the given string and assigns it to the OriginKey field.
func (o *OriginsResultResponse) SetOriginKey(v string) {
	o.OriginKey = &v
}

// GetName returns the Name field value
func (o *OriginsResultResponse) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

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

// SetName sets field value
func (o *OriginsResultResponse) SetName(v string) {
	o.Name = v
}

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

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

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

	return false
}

// SetOriginType gets a reference to the given string and assigns it to the OriginType field.
func (o *OriginsResultResponse) SetOriginType(v string) {
	o.OriginType = &v
}

// GetAddresses returns the Addresses field value if set, zero value otherwise.
func (o *OriginsResultResponse) GetAddresses() []OriginsResultResponseAddresses {
	if o == nil || IsNil(o.Addresses) {
		var ret []OriginsResultResponseAddresses
		return ret
	}
	return o.Addresses
}

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

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

	return false
}

// SetAddresses gets a reference to the given []OriginsResultResponseAddresses and assigns it to the Addresses field.
func (o *OriginsResultResponse) SetAddresses(v []OriginsResultResponseAddresses) {
	o.Addresses = v
}

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

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

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

	return false
}

// SetOriginProtocolPolicy gets a reference to the given string and assigns it to the OriginProtocolPolicy field.
func (o *OriginsResultResponse) SetOriginProtocolPolicy(v string) {
	o.OriginProtocolPolicy = &v
}

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

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

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

	return false
}

// SetIsOriginRedirectionEnabled gets a reference to the given bool and assigns it to the IsOriginRedirectionEnabled field.
func (o *OriginsResultResponse) SetIsOriginRedirectionEnabled(v bool) {
	o.IsOriginRedirectionEnabled = &v
}

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

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

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

	return false
}

// SetHostHeader gets a reference to the given string and assigns it to the HostHeader field.
func (o *OriginsResultResponse) SetHostHeader(v string) {
	o.HostHeader = &v
}

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

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

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

	return false
}

// SetMethod gets a reference to the given string and assigns it to the Method field.
func (o *OriginsResultResponse) SetMethod(v string) {
	o.Method = &v
}

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

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

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

	return false
}

// SetOriginPath gets a reference to the given string and assigns it to the OriginPath field.
func (o *OriginsResultResponse) SetOriginPath(v string) {
	o.OriginPath = &v
}

// GetConnectionTimeout returns the ConnectionTimeout field value if set, zero value otherwise.
func (o *OriginsResultResponse) GetConnectionTimeout() int64 {
	if o == nil || IsNil(o.ConnectionTimeout) {
		var ret int64
		return ret
	}
	return *o.ConnectionTimeout
}

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

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

	return false
}

// SetConnectionTimeout gets a reference to the given int64 and assigns it to the ConnectionTimeout field.
func (o *OriginsResultResponse) SetConnectionTimeout(v int64) {
	o.ConnectionTimeout = &v
}

// GetTimeoutBetweenBytes returns the TimeoutBetweenBytes field value if set, zero value otherwise.
func (o *OriginsResultResponse) GetTimeoutBetweenBytes() int64 {
	if o == nil || IsNil(o.TimeoutBetweenBytes) {
		var ret int64
		return ret
	}
	return *o.TimeoutBetweenBytes
}

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

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

	return false
}

// SetTimeoutBetweenBytes gets a reference to the given int64 and assigns it to the TimeoutBetweenBytes field.
func (o *OriginsResultResponse) SetTimeoutBetweenBytes(v int64) {
	o.TimeoutBetweenBytes = &v
}

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

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

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

	return false
}

// SetHmacAuthentication gets a reference to the given bool and assigns it to the HmacAuthentication field.
func (o *OriginsResultResponse) SetHmacAuthentication(v bool) {
	o.HmacAuthentication = &v
}

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

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

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

	return false
}

// SetHmacRegionName gets a reference to the given string and assigns it to the HmacRegionName field.
func (o *OriginsResultResponse) SetHmacRegionName(v string) {
	o.HmacRegionName = &v
}

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

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

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

	return false
}

// SetHmacAccessKey gets a reference to the given string and assigns it to the HmacAccessKey field.
func (o *OriginsResultResponse) SetHmacAccessKey(v string) {
	o.HmacAccessKey = &v
}

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

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

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

	return false
}

// SetHmacSecretKey gets a reference to the given string and assigns it to the HmacSecretKey field.
func (o *OriginsResultResponse) SetHmacSecretKey(v string) {
	o.HmacSecretKey = &v
}

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

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

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

	return false
}

// SetBucket gets a reference to the given string and assigns it to the Bucket field.
func (o *OriginsResultResponse) SetBucket(v string) {
	o.Bucket = &v
}

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

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

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

	return false
}

// SetPrefix gets a reference to the given string and assigns it to the Prefix field.
func (o *OriginsResultResponse) SetPrefix(v string) {
	o.Prefix = &v
}

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

func (o OriginsResultResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.OriginId) {
		toSerialize["origin_id"] = o.OriginId
	}
	if !IsNil(o.OriginKey) {
		toSerialize["origin_key"] = o.OriginKey
	}
	toSerialize["name"] = o.Name
	if !IsNil(o.OriginType) {
		toSerialize["origin_type"] = o.OriginType
	}
	if !IsNil(o.Addresses) {
		toSerialize["addresses"] = o.Addresses
	}
	if !IsNil(o.OriginProtocolPolicy) {
		toSerialize["origin_protocol_policy"] = o.OriginProtocolPolicy
	}
	if !IsNil(o.IsOriginRedirectionEnabled) {
		toSerialize["is_origin_redirection_enabled"] = o.IsOriginRedirectionEnabled
	}
	if !IsNil(o.HostHeader) {
		toSerialize["host_header"] = o.HostHeader
	}
	if !IsNil(o.Method) {
		toSerialize["method"] = o.Method
	}
	if !IsNil(o.OriginPath) {
		toSerialize["origin_path"] = o.OriginPath
	}
	if !IsNil(o.ConnectionTimeout) {
		toSerialize["connection_timeout"] = o.ConnectionTimeout
	}
	if !IsNil(o.TimeoutBetweenBytes) {
		toSerialize["timeout_between_bytes"] = o.TimeoutBetweenBytes
	}
	if !IsNil(o.HmacAuthentication) {
		toSerialize["hmac_authentication"] = o.HmacAuthentication
	}
	if !IsNil(o.HmacRegionName) {
		toSerialize["hmac_region_name"] = o.HmacRegionName
	}
	if !IsNil(o.HmacAccessKey) {
		toSerialize["hmac_access_key"] = o.HmacAccessKey
	}
	if !IsNil(o.HmacSecretKey) {
		toSerialize["hmac_secret_key"] = o.HmacSecretKey
	}
	if !IsNil(o.Bucket) {
		toSerialize["bucket"] = o.Bucket
	}
	if !IsNil(o.Prefix) {
		toSerialize["prefix"] = o.Prefix
	}
	return toSerialize, nil
}

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

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

	varOriginsResultResponse := _OriginsResultResponse{}

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

	if err != nil {
		return err
	}

	*o = OriginsResultResponse(varOriginsResultResponse)

	return err
}

type NullableOriginsResultResponse struct {
	value *OriginsResultResponse
	isSet bool
}

func (v NullableOriginsResultResponse) Get() *OriginsResultResponse {
	return v.value
}

func (v *NullableOriginsResultResponse) Set(val *OriginsResultResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableOriginsResultResponse(val *OriginsResultResponse) *NullableOriginsResultResponse {
	return &NullableOriginsResultResponse{value: val, isSet: true}
}

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

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


