# 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

__all__ = ['SamlCertificateArgs', 'SamlCertificate']

@pulumi.input_type
class SamlCertificateArgs:
    def __init__(__self__, *,
                 content: pulumi.Input[_builtins.str],
                 type: pulumi.Input[_builtins.str],
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 saml_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a SamlCertificate resource.
        :param pulumi.Input[_builtins.str] content: The content of the SAML certificate
        :param pulumi.Input[_builtins.str] type: The type of the SAML certificate. Possible values are: `signing`, `encryption`.
        :param pulumi.Input[_builtins.str] organization_id: The organization ID. If not provided, the default organization configured in the provider is used.
        :param pulumi.Input[_builtins.str] saml_id: The ID of the SAML configuration. If not provided, the organization's SAML configuration is used.
        """
        pulumi.set(__self__, "content", content)
        pulumi.set(__self__, "type", type)
        if organization_id is not None:
            pulumi.set(__self__, "organization_id", organization_id)
        if saml_id is not None:
            pulumi.set(__self__, "saml_id", saml_id)

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

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

    @_builtins.property
    @pulumi.getter
    def type(self) -> pulumi.Input[_builtins.str]:
        """
        The type of the SAML certificate. Possible values are: `signing`, `encryption`.
        """
        return pulumi.get(self, "type")

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

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The organization ID. If not provided, the default organization configured in the provider is used.
        """
        return pulumi.get(self, "organization_id")

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

    @_builtins.property
    @pulumi.getter(name="samlId")
    def saml_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the SAML configuration. If not provided, the organization's SAML configuration is used.
        """
        return pulumi.get(self, "saml_id")

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


@pulumi.input_type
class _SamlCertificateState:
    def __init__(__self__, *,
                 content: Optional[pulumi.Input[_builtins.str]] = None,
                 expires_at: Optional[pulumi.Input[_builtins.str]] = None,
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 origin: Optional[pulumi.Input[_builtins.str]] = None,
                 saml_id: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering SamlCertificate resources.
        :param pulumi.Input[_builtins.str] content: The content of the SAML certificate
        :param pulumi.Input[_builtins.str] expires_at: (String) The expiration date and time of the SAML certificate
        :param pulumi.Input[_builtins.str] organization_id: The organization ID. If not provided, the default organization configured in the provider is used.
        :param pulumi.Input[_builtins.str] origin: (String) The origin of the SAML certificate. Possible values are: `scaleway`, `identity_provider`.
        :param pulumi.Input[_builtins.str] saml_id: The ID of the SAML configuration. If not provided, the organization's SAML configuration is used.
        :param pulumi.Input[_builtins.str] type: The type of the SAML certificate. Possible values are: `signing`, `encryption`.
        """
        if content is not None:
            pulumi.set(__self__, "content", content)
        if expires_at is not None:
            pulumi.set(__self__, "expires_at", expires_at)
        if organization_id is not None:
            pulumi.set(__self__, "organization_id", organization_id)
        if origin is not None:
            pulumi.set(__self__, "origin", origin)
        if saml_id is not None:
            pulumi.set(__self__, "saml_id", saml_id)
        if type is not None:
            pulumi.set(__self__, "type", type)

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

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

    @_builtins.property
    @pulumi.getter(name="expiresAt")
    def expires_at(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (String) The expiration date and time of the SAML certificate
        """
        return pulumi.get(self, "expires_at")

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

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The organization ID. If not provided, the default organization configured in the provider is used.
        """
        return pulumi.get(self, "organization_id")

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

    @_builtins.property
    @pulumi.getter
    def origin(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (String) The origin of the SAML certificate. Possible values are: `scaleway`, `identity_provider`.
        """
        return pulumi.get(self, "origin")

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

    @_builtins.property
    @pulumi.getter(name="samlId")
    def saml_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the SAML configuration. If not provided, the organization's SAML configuration is used.
        """
        return pulumi.get(self, "saml_id")

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

    @_builtins.property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The type of the SAML certificate. Possible values are: `signing`, `encryption`.
        """
        return pulumi.get(self, "type")

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


@pulumi.type_token("scaleway:iam/samlCertificate:SamlCertificate")
class SamlCertificate(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 content: Optional[pulumi.Input[_builtins.str]] = None,
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 saml_id: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Manages SAML certificates for an organization. SAML certificates are used to establish trust between your organization and identity providers. SAML (Security Assertion Markup Language) is an open standard for exchanging authentication and authorization data between parties, specifically between an identity provider and a service provider. This resource allows you to manage SAML certificates in your Scaleway organization.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_scaleway as scaleway

        ### Enable IAM SAML for the default organization and add a signing certificate
        test = scaleway.iam.Saml("test")
        main = scaleway.iam.SamlCertificate("main",
            saml_id=test.id,
            type="signing",
            content="<signing certificate generated by your Identity Provider>")
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] content: The content of the SAML certificate
        :param pulumi.Input[_builtins.str] organization_id: The organization ID. If not provided, the default organization configured in the provider is used.
        :param pulumi.Input[_builtins.str] saml_id: The ID of the SAML configuration. If not provided, the organization's SAML configuration is used.
        :param pulumi.Input[_builtins.str] type: The type of the SAML certificate. Possible values are: `signing`, `encryption`.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SamlCertificateArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages SAML certificates for an organization. SAML certificates are used to establish trust between your organization and identity providers. SAML (Security Assertion Markup Language) is an open standard for exchanging authentication and authorization data between parties, specifically between an identity provider and a service provider. This resource allows you to manage SAML certificates in your Scaleway organization.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_scaleway as scaleway

        ### Enable IAM SAML for the default organization and add a signing certificate
        test = scaleway.iam.Saml("test")
        main = scaleway.iam.SamlCertificate("main",
            saml_id=test.id,
            type="signing",
            content="<signing certificate generated by your Identity Provider>")
        ```

        :param str resource_name: The name of the resource.
        :param SamlCertificateArgs 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(SamlCertificateArgs, 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,
                 content: Optional[pulumi.Input[_builtins.str]] = None,
                 organization_id: Optional[pulumi.Input[_builtins.str]] = None,
                 saml_id: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.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__ = SamlCertificateArgs.__new__(SamlCertificateArgs)

            if content is None and not opts.urn:
                raise TypeError("Missing required property 'content'")
            __props__.__dict__["content"] = content
            __props__.__dict__["organization_id"] = organization_id
            __props__.__dict__["saml_id"] = saml_id
            if type is None and not opts.urn:
                raise TypeError("Missing required property 'type'")
            __props__.__dict__["type"] = type
            __props__.__dict__["expires_at"] = None
            __props__.__dict__["origin"] = None
        super(SamlCertificate, __self__).__init__(
            'scaleway:iam/samlCertificate:SamlCertificate',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            content: Optional[pulumi.Input[_builtins.str]] = None,
            expires_at: Optional[pulumi.Input[_builtins.str]] = None,
            organization_id: Optional[pulumi.Input[_builtins.str]] = None,
            origin: Optional[pulumi.Input[_builtins.str]] = None,
            saml_id: Optional[pulumi.Input[_builtins.str]] = None,
            type: Optional[pulumi.Input[_builtins.str]] = None) -> 'SamlCertificate':
        """
        Get an existing SamlCertificate 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[_builtins.str] content: The content of the SAML certificate
        :param pulumi.Input[_builtins.str] expires_at: (String) The expiration date and time of the SAML certificate
        :param pulumi.Input[_builtins.str] organization_id: The organization ID. If not provided, the default organization configured in the provider is used.
        :param pulumi.Input[_builtins.str] origin: (String) The origin of the SAML certificate. Possible values are: `scaleway`, `identity_provider`.
        :param pulumi.Input[_builtins.str] saml_id: The ID of the SAML configuration. If not provided, the organization's SAML configuration is used.
        :param pulumi.Input[_builtins.str] type: The type of the SAML certificate. Possible values are: `signing`, `encryption`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SamlCertificateState.__new__(_SamlCertificateState)

        __props__.__dict__["content"] = content
        __props__.__dict__["expires_at"] = expires_at
        __props__.__dict__["organization_id"] = organization_id
        __props__.__dict__["origin"] = origin
        __props__.__dict__["saml_id"] = saml_id
        __props__.__dict__["type"] = type
        return SamlCertificate(resource_name, opts=opts, __props__=__props__)

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

    @_builtins.property
    @pulumi.getter(name="expiresAt")
    def expires_at(self) -> pulumi.Output[_builtins.str]:
        """
        (String) The expiration date and time of the SAML certificate
        """
        return pulumi.get(self, "expires_at")

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> pulumi.Output[_builtins.str]:
        """
        The organization ID. If not provided, the default organization configured in the provider is used.
        """
        return pulumi.get(self, "organization_id")

    @_builtins.property
    @pulumi.getter
    def origin(self) -> pulumi.Output[_builtins.str]:
        """
        (String) The origin of the SAML certificate. Possible values are: `scaleway`, `identity_provider`.
        """
        return pulumi.get(self, "origin")

    @_builtins.property
    @pulumi.getter(name="samlId")
    def saml_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the SAML configuration. If not provided, the organization's SAML configuration is used.
        """
        return pulumi.get(self, "saml_id")

    @_builtins.property
    @pulumi.getter
    def type(self) -> pulumi.Output[_builtins.str]:
        """
        The type of the SAML certificate. Possible values are: `signing`, `encryption`.
        """
        return pulumi.get(self, "type")

