# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetSosBucketPolicyResult',
    'AwaitableGetSosBucketPolicyResult',
    'get_sos_bucket_policy',
    'get_sos_bucket_policy_output',
]

@pulumi.output_type
class GetSosBucketPolicyResult:
    """
    A collection of values returned by getSosBucketPolicy.
    """
    def __init__(__self__, bucket=None, id=None, policy=None, timeouts=None, zone=None):
        if bucket and not isinstance(bucket, str):
            raise TypeError("Expected argument 'bucket' to be a str")
        pulumi.set(__self__, "bucket", bucket)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if policy and not isinstance(policy, str):
            raise TypeError("Expected argument 'policy' to be a str")
        pulumi.set(__self__, "policy", policy)
        if timeouts and not isinstance(timeouts, dict):
            raise TypeError("Expected argument 'timeouts' to be a dict")
        pulumi.set(__self__, "timeouts", timeouts)
        if zone and not isinstance(zone, str):
            raise TypeError("Expected argument 'zone' to be a str")
        pulumi.set(__self__, "zone", zone)

    @property
    @pulumi.getter
    def bucket(self) -> str:
        """
        The name of the bucket to which the policy is to be applied.
        """
        return pulumi.get(self, "bucket")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def policy(self) -> str:
        """
        The content of the policy
        """
        return pulumi.get(self, "policy")

    @property
    @pulumi.getter
    def timeouts(self) -> Optional['outputs.GetSosBucketPolicyTimeoutsResult']:
        return pulumi.get(self, "timeouts")

    @property
    @pulumi.getter
    def zone(self) -> str:
        """
        The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        return pulumi.get(self, "zone")


class AwaitableGetSosBucketPolicyResult(GetSosBucketPolicyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSosBucketPolicyResult(
            bucket=self.bucket,
            id=self.id,
            policy=self.policy,
            timeouts=self.timeouts,
            zone=self.zone)


def get_sos_bucket_policy(bucket: Optional[str] = None,
                          timeouts: Optional[Union['GetSosBucketPolicyTimeoutsArgs', 'GetSosBucketPolicyTimeoutsArgsDict']] = None,
                          zone: Optional[str] = None,
                          opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSosBucketPolicyResult:
    """
    Fetch Exoscale [SOS Bucket Policies](https://community.exoscale.com/documentation/storage/bucketpolicy/).


    :param str bucket: The name of the bucket to which the policy is to be applied.
    :param str zone: The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
    """
    __args__ = dict()
    __args__['bucket'] = bucket
    __args__['timeouts'] = timeouts
    __args__['zone'] = zone
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('exoscale:index/getSosBucketPolicy:getSosBucketPolicy', __args__, opts=opts, typ=GetSosBucketPolicyResult).value

    return AwaitableGetSosBucketPolicyResult(
        bucket=pulumi.get(__ret__, 'bucket'),
        id=pulumi.get(__ret__, 'id'),
        policy=pulumi.get(__ret__, 'policy'),
        timeouts=pulumi.get(__ret__, 'timeouts'),
        zone=pulumi.get(__ret__, 'zone'))
def get_sos_bucket_policy_output(bucket: Optional[pulumi.Input[str]] = None,
                                 timeouts: Optional[pulumi.Input[Optional[Union['GetSosBucketPolicyTimeoutsArgs', 'GetSosBucketPolicyTimeoutsArgsDict']]]] = None,
                                 zone: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetSosBucketPolicyResult]:
    """
    Fetch Exoscale [SOS Bucket Policies](https://community.exoscale.com/documentation/storage/bucketpolicy/).


    :param str bucket: The name of the bucket to which the policy is to be applied.
    :param str zone: The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
    """
    __args__ = dict()
    __args__['bucket'] = bucket
    __args__['timeouts'] = timeouts
    __args__['zone'] = zone
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('exoscale:index/getSosBucketPolicy:getSosBucketPolicy', __args__, opts=opts, typ=GetSosBucketPolicyResult)
    return __ret__.apply(lambda __response__: GetSosBucketPolicyResult(
        bucket=pulumi.get(__response__, 'bucket'),
        id=pulumi.get(__response__, 'id'),
        policy=pulumi.get(__response__, 'policy'),
        timeouts=pulumi.get(__response__, 'timeouts'),
        zone=pulumi.get(__response__, 'zone')))
