# 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 pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = ['BrowserCertificateArgs', 'BrowserCertificate']

@pulumi.input_type
class BrowserCertificateArgs:
    def __init__(__self__, *,
                 cert_blob: pulumi.Input[str],
                 description: Optional[pulumi.Input[str]] = None,
                 microtenant_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a BrowserCertificate resource.
        :param pulumi.Input[str] cert_blob: The content of the certificate in PEM format.
        :param pulumi.Input[str] description: (string) - The description of the certificate.
        :param pulumi.Input[str] microtenant_id: The unique identifier of the Microtenant
        :param pulumi.Input[str] name: The name of the browser access certificate to be created.
        """
        pulumi.set(__self__, "cert_blob", cert_blob)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if microtenant_id is not None:
            pulumi.set(__self__, "microtenant_id", microtenant_id)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter(name="certBlob")
    def cert_blob(self) -> pulumi.Input[str]:
        """
        The content of the certificate in PEM format.
        """
        return pulumi.get(self, "cert_blob")

    @cert_blob.setter
    def cert_blob(self, value: pulumi.Input[str]):
        pulumi.set(self, "cert_blob", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        (string) - The description of the certificate.
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter(name="microtenantId")
    def microtenant_id(self) -> Optional[pulumi.Input[str]]:
        """
        The unique identifier of the Microtenant
        """
        return pulumi.get(self, "microtenant_id")

    @microtenant_id.setter
    def microtenant_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "microtenant_id", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the browser access certificate to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)


@pulumi.input_type
class _BrowserCertificateState:
    def __init__(__self__, *,
                 certificate_data: Optional[pulumi.Input[str]] = None,
                 cert_blob: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 microtenant_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering BrowserCertificate resources.
        :param pulumi.Input[str] certificate_data: The certificate text in PEM format
        :param pulumi.Input[str] cert_blob: The content of the certificate in PEM format.
        :param pulumi.Input[str] description: (string) - The description of the certificate.
        :param pulumi.Input[str] microtenant_id: The unique identifier of the Microtenant
        :param pulumi.Input[str] name: The name of the browser access certificate to be created.
        """
        if certificate_data is not None:
            pulumi.set(__self__, "certificate_data", certificate_data)
        if cert_blob is not None:
            pulumi.set(__self__, "cert_blob", cert_blob)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if microtenant_id is not None:
            pulumi.set(__self__, "microtenant_id", microtenant_id)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter(name="CertificateData")
    def certificate_data(self) -> Optional[pulumi.Input[str]]:
        """
        The certificate text in PEM format
        """
        return pulumi.get(self, "certificate_data")

    @certificate_data.setter
    def certificate_data(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "certificate_data", value)

    @property
    @pulumi.getter(name="certBlob")
    def cert_blob(self) -> Optional[pulumi.Input[str]]:
        """
        The content of the certificate in PEM format.
        """
        return pulumi.get(self, "cert_blob")

    @cert_blob.setter
    def cert_blob(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "cert_blob", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        (string) - The description of the certificate.
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter(name="microtenantId")
    def microtenant_id(self) -> Optional[pulumi.Input[str]]:
        """
        The unique identifier of the Microtenant
        """
        return pulumi.get(self, "microtenant_id")

    @microtenant_id.setter
    def microtenant_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "microtenant_id", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the browser access certificate to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)


class BrowserCertificate(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cert_blob: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 microtenant_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Use the **zpa_ba_certificate** creates a browser access certificate with a private key in the Zscaler Private Access cloud. This resource is required when creating a browser access application segment resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_zpa as zpa

        foo = zpa.get_ba_certificate(name="example.acme.com")
        ```

        ```python
        import pulumi
        import pulumi_zpa as zpa

        # ZPA Browser Access resource
        this = zpa.BrowserCertificate("this",
            cert_blob=\"\"\"-----BEGIN CERTIFICATE-----
        MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
        BQAwgY0xCzAJBgNVBAYTAkNBMRkwFwYDVQQIDBBCcml0aXNoIENvbHVtYmlhMRIw
        EAYDVQQHDAlWYW5jb3V2ZXIxFTATBgNVBAoMDEJELUhhc2hpQ29ycDEVMBMGA1UE
        -----END CERTIFICATE-----

        \"\"\",
            description="server.example.com")
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] cert_blob: The content of the certificate in PEM format.
        :param pulumi.Input[str] description: (string) - The description of the certificate.
        :param pulumi.Input[str] microtenant_id: The unique identifier of the Microtenant
        :param pulumi.Input[str] name: The name of the browser access certificate to be created.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: BrowserCertificateArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Use the **zpa_ba_certificate** creates a browser access certificate with a private key in the Zscaler Private Access cloud. This resource is required when creating a browser access application segment resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_zpa as zpa

        foo = zpa.get_ba_certificate(name="example.acme.com")
        ```

        ```python
        import pulumi
        import pulumi_zpa as zpa

        # ZPA Browser Access resource
        this = zpa.BrowserCertificate("this",
            cert_blob=\"\"\"-----BEGIN CERTIFICATE-----
        MIIDyzCCArOgAwIBAgIUekBD+iu64583B3u5ew7Bqj2O5cQwDQYJKoZIhvcNAQEL
        BQAwgY0xCzAJBgNVBAYTAkNBMRkwFwYDVQQIDBBCcml0aXNoIENvbHVtYmlhMRIw
        EAYDVQQHDAlWYW5jb3V2ZXIxFTATBgNVBAoMDEJELUhhc2hpQ29ycDEVMBMGA1UE
        -----END CERTIFICATE-----

        \"\"\",
            description="server.example.com")
        ```

        :param str resource_name: The name of the resource.
        :param BrowserCertificateArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(BrowserCertificateArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cert_blob: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 microtenant_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = BrowserCertificateArgs.__new__(BrowserCertificateArgs)

            if cert_blob is None and not opts.urn:
                raise TypeError("Missing required property 'cert_blob'")
            __props__.__dict__["cert_blob"] = cert_blob
            __props__.__dict__["description"] = description
            __props__.__dict__["microtenant_id"] = microtenant_id
            __props__.__dict__["name"] = name
            __props__.__dict__["certificate_data"] = None
        super(BrowserCertificate, __self__).__init__(
            'zpa:index/browserCertificate:BrowserCertificate',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            certificate_data: Optional[pulumi.Input[str]] = None,
            cert_blob: Optional[pulumi.Input[str]] = None,
            description: Optional[pulumi.Input[str]] = None,
            microtenant_id: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None) -> 'BrowserCertificate':
        """
        Get an existing BrowserCertificate resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] certificate_data: The certificate text in PEM format
        :param pulumi.Input[str] cert_blob: The content of the certificate in PEM format.
        :param pulumi.Input[str] description: (string) - The description of the certificate.
        :param pulumi.Input[str] microtenant_id: The unique identifier of the Microtenant
        :param pulumi.Input[str] name: The name of the browser access certificate to be created.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _BrowserCertificateState.__new__(_BrowserCertificateState)

        __props__.__dict__["certificate_data"] = certificate_data
        __props__.__dict__["cert_blob"] = cert_blob
        __props__.__dict__["description"] = description
        __props__.__dict__["microtenant_id"] = microtenant_id
        __props__.__dict__["name"] = name
        return BrowserCertificate(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="CertificateData")
    def certificate_data(self) -> pulumi.Output[str]:
        """
        The certificate text in PEM format
        """
        return pulumi.get(self, "certificate_data")

    @property
    @pulumi.getter(name="certBlob")
    def cert_blob(self) -> pulumi.Output[str]:
        """
        The content of the certificate in PEM format.
        """
        return pulumi.get(self, "cert_blob")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        (string) - The description of the certificate.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="microtenantId")
    def microtenant_id(self) -> pulumi.Output[str]:
        """
        The unique identifier of the Microtenant
        """
        return pulumi.get(self, "microtenant_id")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name of the browser access certificate to be created.
        """
        return pulumi.get(self, "name")

