# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
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

__all__ = [
    'GetBackendStageResult',
    'AwaitableGetBackendStageResult',
    'get_backend_stage',
    'get_backend_stage_output',
]

@pulumi.output_type
class GetBackendStageResult:
    """
    A collection of values returned by getBackendStage.
    """
    def __init__(__self__, backend_stage_id=None, bucket_name=None, bucket_region=None, created_at=None, id=None, lb_backend_configs=None, lb_id=None, pipeline_id=None, project_id=None, s3_backend_configs=None, updated_at=None):
        if backend_stage_id and not isinstance(backend_stage_id, str):
            raise TypeError("Expected argument 'backend_stage_id' to be a str")
        pulumi.set(__self__, "backend_stage_id", backend_stage_id)
        if bucket_name and not isinstance(bucket_name, str):
            raise TypeError("Expected argument 'bucket_name' to be a str")
        pulumi.set(__self__, "bucket_name", bucket_name)
        if bucket_region and not isinstance(bucket_region, str):
            raise TypeError("Expected argument 'bucket_region' to be a str")
        pulumi.set(__self__, "bucket_region", bucket_region)
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if lb_backend_configs and not isinstance(lb_backend_configs, list):
            raise TypeError("Expected argument 'lb_backend_configs' to be a list")
        pulumi.set(__self__, "lb_backend_configs", lb_backend_configs)
        if lb_id and not isinstance(lb_id, str):
            raise TypeError("Expected argument 'lb_id' to be a str")
        pulumi.set(__self__, "lb_id", lb_id)
        if pipeline_id and not isinstance(pipeline_id, str):
            raise TypeError("Expected argument 'pipeline_id' to be a str")
        pulumi.set(__self__, "pipeline_id", pipeline_id)
        if project_id and not isinstance(project_id, str):
            raise TypeError("Expected argument 'project_id' to be a str")
        pulumi.set(__self__, "project_id", project_id)
        if s3_backend_configs and not isinstance(s3_backend_configs, list):
            raise TypeError("Expected argument 's3_backend_configs' to be a list")
        pulumi.set(__self__, "s3_backend_configs", s3_backend_configs)
        if updated_at and not isinstance(updated_at, str):
            raise TypeError("Expected argument 'updated_at' to be a str")
        pulumi.set(__self__, "updated_at", updated_at)

    @_builtins.property
    @pulumi.getter(name="backendStageId")
    def backend_stage_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "backend_stage_id")

    @_builtins.property
    @pulumi.getter(name="bucketName")
    def bucket_name(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "bucket_name")

    @_builtins.property
    @pulumi.getter(name="bucketRegion")
    def bucket_region(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "bucket_region")

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> _builtins.str:
        return pulumi.get(self, "created_at")

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

    @_builtins.property
    @pulumi.getter(name="lbBackendConfigs")
    def lb_backend_configs(self) -> Sequence['outputs.GetBackendStageLbBackendConfigResult']:
        return pulumi.get(self, "lb_backend_configs")

    @_builtins.property
    @pulumi.getter(name="lbId")
    def lb_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "lb_id")

    @_builtins.property
    @pulumi.getter(name="pipelineId")
    def pipeline_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "pipeline_id")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> _builtins.str:
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter(name="s3BackendConfigs")
    def s3_backend_configs(self) -> Sequence['outputs.GetBackendStageS3BackendConfigResult']:
        return pulumi.get(self, "s3_backend_configs")

    @_builtins.property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> _builtins.str:
        return pulumi.get(self, "updated_at")


class AwaitableGetBackendStageResult(GetBackendStageResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetBackendStageResult(
            backend_stage_id=self.backend_stage_id,
            bucket_name=self.bucket_name,
            bucket_region=self.bucket_region,
            created_at=self.created_at,
            id=self.id,
            lb_backend_configs=self.lb_backend_configs,
            lb_id=self.lb_id,
            pipeline_id=self.pipeline_id,
            project_id=self.project_id,
            s3_backend_configs=self.s3_backend_configs,
            updated_at=self.updated_at)


def get_backend_stage(backend_stage_id: Optional[_builtins.str] = None,
                      bucket_name: Optional[_builtins.str] = None,
                      bucket_region: Optional[_builtins.str] = None,
                      lb_id: Optional[_builtins.str] = None,
                      pipeline_id: Optional[_builtins.str] = None,
                      opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetBackendStageResult:
    """
    Gets information about an Edge Services backend stage.

    A backend stage defines the origin (Scaleway Object Storage bucket or Load Balancer) that Edge Services forwards requests to.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services backend stage by its ID
    by_id = scaleway.edgeservices.get_backend_stage(backend_stage_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services backend stage by pipeline ID
    by_pipeline = scaleway.edgeservices.get_backend_stage(pipeline_id=main["id"])
    ```


    :param _builtins.str backend_stage_id: The ID of the backend stage.
           
           The following filter arguments are supported (cannot be used with `backend_stage_id`):
    :param _builtins.str bucket_name: Filter by S3 bucket name.
    :param _builtins.str bucket_region: Filter by S3 bucket region.
    :param _builtins.str lb_id: Filter by Load Balancer ID.
    :param _builtins.str pipeline_id: The ID of the pipeline.
    """
    __args__ = dict()
    __args__['backendStageId'] = backend_stage_id
    __args__['bucketName'] = bucket_name
    __args__['bucketRegion'] = bucket_region
    __args__['lbId'] = lb_id
    __args__['pipelineId'] = pipeline_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('scaleway:edgeservices/getBackendStage:getBackendStage', __args__, opts=opts, typ=GetBackendStageResult).value

    return AwaitableGetBackendStageResult(
        backend_stage_id=pulumi.get(__ret__, 'backend_stage_id'),
        bucket_name=pulumi.get(__ret__, 'bucket_name'),
        bucket_region=pulumi.get(__ret__, 'bucket_region'),
        created_at=pulumi.get(__ret__, 'created_at'),
        id=pulumi.get(__ret__, 'id'),
        lb_backend_configs=pulumi.get(__ret__, 'lb_backend_configs'),
        lb_id=pulumi.get(__ret__, 'lb_id'),
        pipeline_id=pulumi.get(__ret__, 'pipeline_id'),
        project_id=pulumi.get(__ret__, 'project_id'),
        s3_backend_configs=pulumi.get(__ret__, 's3_backend_configs'),
        updated_at=pulumi.get(__ret__, 'updated_at'))
def get_backend_stage_output(backend_stage_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                             bucket_name: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                             bucket_region: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                             lb_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                             pipeline_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                             opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetBackendStageResult]:
    """
    Gets information about an Edge Services backend stage.

    A backend stage defines the origin (Scaleway Object Storage bucket or Load Balancer) that Edge Services forwards requests to.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services backend stage by its ID
    by_id = scaleway.edgeservices.get_backend_stage(backend_stage_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services backend stage by pipeline ID
    by_pipeline = scaleway.edgeservices.get_backend_stage(pipeline_id=main["id"])
    ```


    :param _builtins.str backend_stage_id: The ID of the backend stage.
           
           The following filter arguments are supported (cannot be used with `backend_stage_id`):
    :param _builtins.str bucket_name: Filter by S3 bucket name.
    :param _builtins.str bucket_region: Filter by S3 bucket region.
    :param _builtins.str lb_id: Filter by Load Balancer ID.
    :param _builtins.str pipeline_id: The ID of the pipeline.
    """
    __args__ = dict()
    __args__['backendStageId'] = backend_stage_id
    __args__['bucketName'] = bucket_name
    __args__['bucketRegion'] = bucket_region
    __args__['lbId'] = lb_id
    __args__['pipelineId'] = pipeline_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('scaleway:edgeservices/getBackendStage:getBackendStage', __args__, opts=opts, typ=GetBackendStageResult)
    return __ret__.apply(lambda __response__: GetBackendStageResult(
        backend_stage_id=pulumi.get(__response__, 'backend_stage_id'),
        bucket_name=pulumi.get(__response__, 'bucket_name'),
        bucket_region=pulumi.get(__response__, 'bucket_region'),
        created_at=pulumi.get(__response__, 'created_at'),
        id=pulumi.get(__response__, 'id'),
        lb_backend_configs=pulumi.get(__response__, 'lb_backend_configs'),
        lb_id=pulumi.get(__response__, 'lb_id'),
        pipeline_id=pulumi.get(__response__, 'pipeline_id'),
        project_id=pulumi.get(__response__, 'project_id'),
        s3_backend_configs=pulumi.get(__response__, 's3_backend_configs'),
        updated_at=pulumi.get(__response__, 'updated_at')))
