/*
 * IONOS Object Storage API for contract-owned buckets
 *
 * ## Overview The IONOS Object Storage API for contract-owned buckets is a REST-based API that allows developers and applications to interact directly with IONOS' scalable storage solution, leveraging the S3 protocol for object storage operations. Its design ensures seamless compatibility with existing tools and libraries tailored for S3 systems.  ### API References - [S3 API Reference for contract-owned buckets](https://api.ionos.com/docs/s3-contract-owned-buckets/v2/) ### User documentation [IONOS Object Storage User Guide](https://docs.ionos.com/cloud/managed-services/s3-object-storage) * [Documentation on user-owned and contract-owned buckets](https://docs.ionos.com/cloud/managed-services/s3-object-storage/concepts/buckets) * [Documentation on S3 API Compatibility](https://docs.ionos.com/cloud/managed-services/s3-object-storage/concepts/s3-api-compatibility) * [S3 Tools](https://docs.ionos.com/cloud/managed-services/s3-object-storage/s3-tools)  ## Endpoints for contract-owned buckets | Location | Region Name | Bucket Type | Endpoint | | --- | --- | --- | --- | | **Berlin, Germany** | **eu-central-3** | Contract-owned | `https://s3.eu-central-3.ionoscloud.com` |  ## Changelog - 30.05.2024 Initial version
 *
 * API version: 2.0.2
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
)

import "encoding/xml"

// BlockPublicAccessPayload struct for BlockPublicAccessPayload
type BlockPublicAccessPayload struct {
	XMLName xml.Name `xml:"PublicAccessBlockConfiguration"`
	// Indicates that access to the bucket via Access Control Lists (ACLs) that grant public access is blocked. In other words, ACLs that allow public access are not permitted.
	BlockPublicAcls *bool `json:"BlockPublicAcls,omitempty" xml:"BlockPublicAcls"`
	// Instructs the system to ignore any ACLs that grant public access. Even if ACLs are set to allow public access, they will be disregarded.
	IgnorePublicAcls *bool `json:"IgnorePublicAcls,omitempty" xml:"IgnorePublicAcls"`
	// Blocks public access to the bucket via bucket policies. Bucket policies that grant public access will not be allowed.
	BlockPublicPolicy *bool `json:"BlockPublicPolicy,omitempty" xml:"BlockPublicPolicy"`
	// Restricts access to buckets that have public policies. Buckets with policies that grant public access will have their access restricted.
	RestrictPublicBuckets *bool `json:"RestrictPublicBuckets,omitempty" xml:"RestrictPublicBuckets"`
}

// NewBlockPublicAccessPayload instantiates a new BlockPublicAccessPayload 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 NewBlockPublicAccessPayload() *BlockPublicAccessPayload {
	this := BlockPublicAccessPayload{}

	var blockPublicAcls bool = false
	this.BlockPublicAcls = &blockPublicAcls
	var ignorePublicAcls bool = false
	this.IgnorePublicAcls = &ignorePublicAcls
	var blockPublicPolicy bool = false
	this.BlockPublicPolicy = &blockPublicPolicy
	var restrictPublicBuckets bool = false
	this.RestrictPublicBuckets = &restrictPublicBuckets

	return &this
}

// NewBlockPublicAccessPayloadWithDefaults instantiates a new BlockPublicAccessPayload 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 NewBlockPublicAccessPayloadWithDefaults() *BlockPublicAccessPayload {
	this := BlockPublicAccessPayload{}
	var blockPublicAcls bool = false
	this.BlockPublicAcls = &blockPublicAcls
	var ignorePublicAcls bool = false
	this.IgnorePublicAcls = &ignorePublicAcls
	var blockPublicPolicy bool = false
	this.BlockPublicPolicy = &blockPublicPolicy
	var restrictPublicBuckets bool = false
	this.RestrictPublicBuckets = &restrictPublicBuckets
	return &this
}

// GetBlockPublicAcls returns the BlockPublicAcls field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *BlockPublicAccessPayload) GetBlockPublicAcls() *bool {
	if o == nil {
		return nil
	}

	return o.BlockPublicAcls

}

// GetBlockPublicAclsOk returns a tuple with the BlockPublicAcls field value
// 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 *BlockPublicAccessPayload) GetBlockPublicAclsOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.BlockPublicAcls, true
}

// SetBlockPublicAcls sets field value
func (o *BlockPublicAccessPayload) SetBlockPublicAcls(v bool) {

	o.BlockPublicAcls = &v

}

// HasBlockPublicAcls returns a boolean if a field has been set.
func (o *BlockPublicAccessPayload) HasBlockPublicAcls() bool {
	if o != nil && o.BlockPublicAcls != nil {
		return true
	}

	return false
}

// GetIgnorePublicAcls returns the IgnorePublicAcls field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *BlockPublicAccessPayload) GetIgnorePublicAcls() *bool {
	if o == nil {
		return nil
	}

	return o.IgnorePublicAcls

}

// GetIgnorePublicAclsOk returns a tuple with the IgnorePublicAcls field value
// 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 *BlockPublicAccessPayload) GetIgnorePublicAclsOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.IgnorePublicAcls, true
}

// SetIgnorePublicAcls sets field value
func (o *BlockPublicAccessPayload) SetIgnorePublicAcls(v bool) {

	o.IgnorePublicAcls = &v

}

// HasIgnorePublicAcls returns a boolean if a field has been set.
func (o *BlockPublicAccessPayload) HasIgnorePublicAcls() bool {
	if o != nil && o.IgnorePublicAcls != nil {
		return true
	}

	return false
}

// GetBlockPublicPolicy returns the BlockPublicPolicy field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *BlockPublicAccessPayload) GetBlockPublicPolicy() *bool {
	if o == nil {
		return nil
	}

	return o.BlockPublicPolicy

}

// GetBlockPublicPolicyOk returns a tuple with the BlockPublicPolicy field value
// 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 *BlockPublicAccessPayload) GetBlockPublicPolicyOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.BlockPublicPolicy, true
}

// SetBlockPublicPolicy sets field value
func (o *BlockPublicAccessPayload) SetBlockPublicPolicy(v bool) {

	o.BlockPublicPolicy = &v

}

// HasBlockPublicPolicy returns a boolean if a field has been set.
func (o *BlockPublicAccessPayload) HasBlockPublicPolicy() bool {
	if o != nil && o.BlockPublicPolicy != nil {
		return true
	}

	return false
}

// GetRestrictPublicBuckets returns the RestrictPublicBuckets field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *BlockPublicAccessPayload) GetRestrictPublicBuckets() *bool {
	if o == nil {
		return nil
	}

	return o.RestrictPublicBuckets

}

// GetRestrictPublicBucketsOk returns a tuple with the RestrictPublicBuckets field value
// 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 *BlockPublicAccessPayload) GetRestrictPublicBucketsOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.RestrictPublicBuckets, true
}

// SetRestrictPublicBuckets sets field value
func (o *BlockPublicAccessPayload) SetRestrictPublicBuckets(v bool) {

	o.RestrictPublicBuckets = &v

}

// HasRestrictPublicBuckets returns a boolean if a field has been set.
func (o *BlockPublicAccessPayload) HasRestrictPublicBuckets() bool {
	if o != nil && o.RestrictPublicBuckets != nil {
		return true
	}

	return false
}

func (o BlockPublicAccessPayload) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.BlockPublicAcls != nil {
		toSerialize["BlockPublicAcls"] = o.BlockPublicAcls
	}

	if o.IgnorePublicAcls != nil {
		toSerialize["IgnorePublicAcls"] = o.IgnorePublicAcls
	}

	if o.BlockPublicPolicy != nil {
		toSerialize["BlockPublicPolicy"] = o.BlockPublicPolicy
	}

	if o.RestrictPublicBuckets != nil {
		toSerialize["RestrictPublicBuckets"] = o.RestrictPublicBuckets
	}

	return json.Marshal(toSerialize)
}

type NullableBlockPublicAccessPayload struct {
	value *BlockPublicAccessPayload
	isSet bool
}

func (v NullableBlockPublicAccessPayload) Get() *BlockPublicAccessPayload {
	return v.value
}

func (v *NullableBlockPublicAccessPayload) Set(val *BlockPublicAccessPayload) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBlockPublicAccessPayload(val *BlockPublicAccessPayload) *NullableBlockPublicAccessPayload {
	return &NullableBlockPublicAccessPayload{value: val, isSet: true}
}

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

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