# 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
from . import outputs
from ._inputs import *

__all__ = [
    'GetCertificatesResult',
    'AwaitableGetCertificatesResult',
    'get_certificates',
    'get_certificates_output',
]

@pulumi.output_type
class GetCertificatesResult:
    """
    A collection of values returned by getCertificates.
    """
    def __init__(__self__, certificate_collections=None, certificate_id=None, compartment_id=None, filters=None, id=None, issuer_certificate_authority_id=None, name=None, state=None):
        if certificate_collections and not isinstance(certificate_collections, list):
            raise TypeError("Expected argument 'certificate_collections' to be a list")
        pulumi.set(__self__, "certificate_collections", certificate_collections)
        if certificate_id and not isinstance(certificate_id, str):
            raise TypeError("Expected argument 'certificate_id' to be a str")
        pulumi.set(__self__, "certificate_id", certificate_id)
        if compartment_id and not isinstance(compartment_id, str):
            raise TypeError("Expected argument 'compartment_id' to be a str")
        pulumi.set(__self__, "compartment_id", compartment_id)
        if filters and not isinstance(filters, list):
            raise TypeError("Expected argument 'filters' to be a list")
        pulumi.set(__self__, "filters", filters)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if issuer_certificate_authority_id and not isinstance(issuer_certificate_authority_id, str):
            raise TypeError("Expected argument 'issuer_certificate_authority_id' to be a str")
        pulumi.set(__self__, "issuer_certificate_authority_id", issuer_certificate_authority_id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)

    @property
    @pulumi.getter(name="certificateCollections")
    def certificate_collections(self) -> Sequence['outputs.GetCertificatesCertificateCollectionResult']:
        """
        The list of certificate_collection.
        """
        return pulumi.get(self, "certificate_collections")

    @property
    @pulumi.getter(name="certificateId")
    def certificate_id(self) -> Optional[str]:
        """
        The OCID of the certificate.
        """
        return pulumi.get(self, "certificate_id")

    @property
    @pulumi.getter(name="compartmentId")
    def compartment_id(self) -> Optional[str]:
        """
        The OCID of the compartment where you want to create the certificate.
        """
        return pulumi.get(self, "compartment_id")

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

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

    @property
    @pulumi.getter(name="issuerCertificateAuthorityId")
    def issuer_certificate_authority_id(self) -> Optional[str]:
        """
        The OCID of the certificate authority (CA) that issued the certificate.
        """
        return pulumi.get(self, "issuer_certificate_authority_id")

    @property
    @pulumi.getter
    def name(self) -> Optional[str]:
        """
        A user-friendly name for the certificate. Names are unique within a compartment. Avoid entering confidential information. Valid characters are uppercase or lowercase letters, numbers, hyphens, underscores, and periods.
        """
        return pulumi.get(self, "name")

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


class AwaitableGetCertificatesResult(GetCertificatesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetCertificatesResult(
            certificate_collections=self.certificate_collections,
            certificate_id=self.certificate_id,
            compartment_id=self.compartment_id,
            filters=self.filters,
            id=self.id,
            issuer_certificate_authority_id=self.issuer_certificate_authority_id,
            name=self.name,
            state=self.state)


def get_certificates(certificate_id: Optional[str] = None,
                     compartment_id: Optional[str] = None,
                     filters: Optional[Sequence[pulumi.InputType['GetCertificatesFilterArgs']]] = None,
                     issuer_certificate_authority_id: Optional[str] = None,
                     name: Optional[str] = None,
                     state: Optional[str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCertificatesResult:
    """
    This data source provides the list of Certificates in Oracle Cloud Infrastructure Certificates Management service.

    Lists all certificates that match the query parameters.
    Optionally, you can use the parameter `FilterByCertificateIdQueryParam` to limit the result set to a single item that matches the specified certificate.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_certificates = oci.CertificatesManagement.get_certificates(certificate_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        compartment_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        issuer_certificate_authority_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        name=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        state=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str certificate_id: The OCID of the certificate. If the parameter is set to null, the service lists all certificates.
    :param str compartment_id: A filter that returns only resources that match the given compartment OCID.
    :param str issuer_certificate_authority_id: The OCID of the certificate authority (CA). If the parameter is set to null, the service lists all CAs.
    :param str name: A filter that returns only resources that match the specified name.
    :param str state: A filter that returns only resources that match the given lifecycle state. The state value is case-insensitive.
    """
    __args__ = dict()
    __args__['certificateId'] = certificate_id
    __args__['compartmentId'] = compartment_id
    __args__['filters'] = filters
    __args__['issuerCertificateAuthorityId'] = issuer_certificate_authority_id
    __args__['name'] = name
    __args__['state'] = state
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:CertificatesManagement/getCertificates:getCertificates', __args__, opts=opts, typ=GetCertificatesResult).value

    return AwaitableGetCertificatesResult(
        certificate_collections=__ret__.certificate_collections,
        certificate_id=__ret__.certificate_id,
        compartment_id=__ret__.compartment_id,
        filters=__ret__.filters,
        id=__ret__.id,
        issuer_certificate_authority_id=__ret__.issuer_certificate_authority_id,
        name=__ret__.name,
        state=__ret__.state)


@_utilities.lift_output_func(get_certificates)
def get_certificates_output(certificate_id: Optional[pulumi.Input[Optional[str]]] = None,
                            compartment_id: Optional[pulumi.Input[Optional[str]]] = None,
                            filters: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetCertificatesFilterArgs']]]]] = None,
                            issuer_certificate_authority_id: Optional[pulumi.Input[Optional[str]]] = None,
                            name: Optional[pulumi.Input[Optional[str]]] = None,
                            state: Optional[pulumi.Input[Optional[str]]] = None,
                            opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCertificatesResult]:
    """
    This data source provides the list of Certificates in Oracle Cloud Infrastructure Certificates Management service.

    Lists all certificates that match the query parameters.
    Optionally, you can use the parameter `FilterByCertificateIdQueryParam` to limit the result set to a single item that matches the specified certificate.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_certificates = oci.CertificatesManagement.get_certificates(certificate_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        compartment_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        issuer_certificate_authority_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        name=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        state=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str certificate_id: The OCID of the certificate. If the parameter is set to null, the service lists all certificates.
    :param str compartment_id: A filter that returns only resources that match the given compartment OCID.
    :param str issuer_certificate_authority_id: The OCID of the certificate authority (CA). If the parameter is set to null, the service lists all CAs.
    :param str name: A filter that returns only resources that match the specified name.
    :param str state: A filter that returns only resources that match the given lifecycle state. The state value is case-insensitive.
    """
    ...
