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

__all__ = ['PushGroupArgs', 'PushGroup']

@pulumi.input_type
class PushGroupArgs:
    def __init__(__self__, *,
                 app_id: pulumi.Input[_builtins.str],
                 source_group_id: pulumi.Input[_builtins.str],
                 app_config: Optional[pulumi.Input['PushGroupAppConfigArgs']] = None,
                 delete_target_group_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 status: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a PushGroup resource.

        :param pulumi.Input[_builtins.str] app_id: The ID of the Okta Application.
        :param pulumi.Input[_builtins.str] source_group_id: The ID of the source group in Okta.
        :param pulumi.Input['PushGroupAppConfigArgs'] app_config: Additional app configuration for group push mappings. Currently only required for Active Directory.
        :param pulumi.Input[_builtins.bool] delete_target_group_on_destroy: Whether to delete the target group when the push group mapping is destroyed. Default is true.
        :param pulumi.Input[_builtins.str] status: The status of the push group mapping. Valid values: `ACTIVE` and `INACTIVE`
        :param pulumi.Input[_builtins.str] target_group_id: The ID of the target group.
        :param pulumi.Input[_builtins.str] target_group_name: The name of the target group for the group push mapping. This is used when creating a new downstream group. If the group already exists, it links to the existing group. If not specified, the name of the source group will be used as the name of the target group. Setting a target group name only works if you have unchecked 'Rename app groups to match group name in Okta' in the push groups settings UI.
        """
        pulumi.set(__self__, "app_id", app_id)
        pulumi.set(__self__, "source_group_id", source_group_id)
        if app_config is not None:
            pulumi.set(__self__, "app_config", app_config)
        if delete_target_group_on_destroy is not None:
            pulumi.set(__self__, "delete_target_group_on_destroy", delete_target_group_on_destroy)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if target_group_id is not None:
            pulumi.set(__self__, "target_group_id", target_group_id)
        if target_group_name is not None:
            pulumi.set(__self__, "target_group_name", target_group_name)

    @_builtins.property
    @pulumi.getter(name="appId")
    def app_id(self) -> pulumi.Input[_builtins.str]:
        """
        The ID of the Okta Application.
        """
        return pulumi.get(self, "app_id")

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

    @_builtins.property
    @pulumi.getter(name="sourceGroupId")
    def source_group_id(self) -> pulumi.Input[_builtins.str]:
        """
        The ID of the source group in Okta.
        """
        return pulumi.get(self, "source_group_id")

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

    @_builtins.property
    @pulumi.getter(name="appConfig")
    def app_config(self) -> Optional[pulumi.Input['PushGroupAppConfigArgs']]:
        """
        Additional app configuration for group push mappings. Currently only required for Active Directory.
        """
        return pulumi.get(self, "app_config")

    @app_config.setter
    def app_config(self, value: Optional[pulumi.Input['PushGroupAppConfigArgs']]):
        pulumi.set(self, "app_config", value)

    @_builtins.property
    @pulumi.getter(name="deleteTargetGroupOnDestroy")
    def delete_target_group_on_destroy(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to delete the target group when the push group mapping is destroyed. Default is true.
        """
        return pulumi.get(self, "delete_target_group_on_destroy")

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

    @_builtins.property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The status of the push group mapping. Valid values: `ACTIVE` and `INACTIVE`
        """
        return pulumi.get(self, "status")

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

    @_builtins.property
    @pulumi.getter(name="targetGroupId")
    def target_group_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the target group.
        """
        return pulumi.get(self, "target_group_id")

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

    @_builtins.property
    @pulumi.getter(name="targetGroupName")
    def target_group_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the target group for the group push mapping. This is used when creating a new downstream group. If the group already exists, it links to the existing group. If not specified, the name of the source group will be used as the name of the target group. Setting a target group name only works if you have unchecked 'Rename app groups to match group name in Okta' in the push groups settings UI.
        """
        return pulumi.get(self, "target_group_name")

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


@pulumi.input_type
class _PushGroupState:
    def __init__(__self__, *,
                 app_config: Optional[pulumi.Input['PushGroupAppConfigArgs']] = None,
                 app_id: Optional[pulumi.Input[_builtins.str]] = None,
                 delete_target_group_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 source_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 status: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering PushGroup resources.

        :param pulumi.Input['PushGroupAppConfigArgs'] app_config: Additional app configuration for group push mappings. Currently only required for Active Directory.
        :param pulumi.Input[_builtins.str] app_id: The ID of the Okta Application.
        :param pulumi.Input[_builtins.bool] delete_target_group_on_destroy: Whether to delete the target group when the push group mapping is destroyed. Default is true.
        :param pulumi.Input[_builtins.str] source_group_id: The ID of the source group in Okta.
        :param pulumi.Input[_builtins.str] status: The status of the push group mapping. Valid values: `ACTIVE` and `INACTIVE`
        :param pulumi.Input[_builtins.str] target_group_id: The ID of the target group.
        :param pulumi.Input[_builtins.str] target_group_name: The name of the target group for the group push mapping. This is used when creating a new downstream group. If the group already exists, it links to the existing group. If not specified, the name of the source group will be used as the name of the target group. Setting a target group name only works if you have unchecked 'Rename app groups to match group name in Okta' in the push groups settings UI.
        """
        if app_config is not None:
            pulumi.set(__self__, "app_config", app_config)
        if app_id is not None:
            pulumi.set(__self__, "app_id", app_id)
        if delete_target_group_on_destroy is not None:
            pulumi.set(__self__, "delete_target_group_on_destroy", delete_target_group_on_destroy)
        if source_group_id is not None:
            pulumi.set(__self__, "source_group_id", source_group_id)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if target_group_id is not None:
            pulumi.set(__self__, "target_group_id", target_group_id)
        if target_group_name is not None:
            pulumi.set(__self__, "target_group_name", target_group_name)

    @_builtins.property
    @pulumi.getter(name="appConfig")
    def app_config(self) -> Optional[pulumi.Input['PushGroupAppConfigArgs']]:
        """
        Additional app configuration for group push mappings. Currently only required for Active Directory.
        """
        return pulumi.get(self, "app_config")

    @app_config.setter
    def app_config(self, value: Optional[pulumi.Input['PushGroupAppConfigArgs']]):
        pulumi.set(self, "app_config", value)

    @_builtins.property
    @pulumi.getter(name="appId")
    def app_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the Okta Application.
        """
        return pulumi.get(self, "app_id")

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

    @_builtins.property
    @pulumi.getter(name="deleteTargetGroupOnDestroy")
    def delete_target_group_on_destroy(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to delete the target group when the push group mapping is destroyed. Default is true.
        """
        return pulumi.get(self, "delete_target_group_on_destroy")

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

    @_builtins.property
    @pulumi.getter(name="sourceGroupId")
    def source_group_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the source group in Okta.
        """
        return pulumi.get(self, "source_group_id")

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

    @_builtins.property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The status of the push group mapping. Valid values: `ACTIVE` and `INACTIVE`
        """
        return pulumi.get(self, "status")

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

    @_builtins.property
    @pulumi.getter(name="targetGroupId")
    def target_group_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the target group.
        """
        return pulumi.get(self, "target_group_id")

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

    @_builtins.property
    @pulumi.getter(name="targetGroupName")
    def target_group_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the target group for the group push mapping. This is used when creating a new downstream group. If the group already exists, it links to the existing group. If not specified, the name of the source group will be used as the name of the target group. Setting a target group name only works if you have unchecked 'Rename app groups to match group name in Okta' in the push groups settings UI.
        """
        return pulumi.get(self, "target_group_name")

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


@pulumi.type_token("okta:index/pushGroup:PushGroup")
class PushGroup(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 app_config: Optional[pulumi.Input[Union['PushGroupAppConfigArgs', 'PushGroupAppConfigArgsDict']]] = None,
                 app_id: Optional[pulumi.Input[_builtins.str]] = None,
                 delete_target_group_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 source_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 status: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_name: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Creates a Push Group assignment for an Application in Okta.

        ## Example Usage

        ```python
        import pulumi
        import json
        import pulumi_okta as okta

        test = okta.app.Swa("test",
            app_links_json=json.dumps({
                "deelhr_link": True,
            }),
            label="Deel HR",
            preconfigured_app="deelhr",
            status="ACTIVE",
            user_name_template_type="BUILT_IN")
        test_group = okta.group.Group("test", name="Some Test Push Group")
        sample = okta.PushGroup("sample",
            app_id=test.id,
            source_group_id=test_group.id,
            status="ACTIVE",
            delete_target_group_on_destroy=True)
        ad_sample = okta.PushGroup("ad_sample",
            app_id=test.id,
            source_group_id=test_group.id,
            status="ACTIVE",
            app_config={
                "distinguished_name": "CN=Test,OU=Groups,DC=example,DC=com",
                "group_scope": "DOMAIN_LOCAL",
                "group_type": "SECURITY",
                "sam_account_name": "something",
            })
        ```

        ## Import

        ```sh
        $ pulumi import okta:index/pushGroup:PushGroup example <app_id>/<push_group_mapping_id>
        ```


        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Union['PushGroupAppConfigArgs', 'PushGroupAppConfigArgsDict']] app_config: Additional app configuration for group push mappings. Currently only required for Active Directory.
        :param pulumi.Input[_builtins.str] app_id: The ID of the Okta Application.
        :param pulumi.Input[_builtins.bool] delete_target_group_on_destroy: Whether to delete the target group when the push group mapping is destroyed. Default is true.
        :param pulumi.Input[_builtins.str] source_group_id: The ID of the source group in Okta.
        :param pulumi.Input[_builtins.str] status: The status of the push group mapping. Valid values: `ACTIVE` and `INACTIVE`
        :param pulumi.Input[_builtins.str] target_group_id: The ID of the target group.
        :param pulumi.Input[_builtins.str] target_group_name: The name of the target group for the group push mapping. This is used when creating a new downstream group. If the group already exists, it links to the existing group. If not specified, the name of the source group will be used as the name of the target group. Setting a target group name only works if you have unchecked 'Rename app groups to match group name in Okta' in the push groups settings UI.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: PushGroupArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Creates a Push Group assignment for an Application in Okta.

        ## Example Usage

        ```python
        import pulumi
        import json
        import pulumi_okta as okta

        test = okta.app.Swa("test",
            app_links_json=json.dumps({
                "deelhr_link": True,
            }),
            label="Deel HR",
            preconfigured_app="deelhr",
            status="ACTIVE",
            user_name_template_type="BUILT_IN")
        test_group = okta.group.Group("test", name="Some Test Push Group")
        sample = okta.PushGroup("sample",
            app_id=test.id,
            source_group_id=test_group.id,
            status="ACTIVE",
            delete_target_group_on_destroy=True)
        ad_sample = okta.PushGroup("ad_sample",
            app_id=test.id,
            source_group_id=test_group.id,
            status="ACTIVE",
            app_config={
                "distinguished_name": "CN=Test,OU=Groups,DC=example,DC=com",
                "group_scope": "DOMAIN_LOCAL",
                "group_type": "SECURITY",
                "sam_account_name": "something",
            })
        ```

        ## Import

        ```sh
        $ pulumi import okta:index/pushGroup:PushGroup example <app_id>/<push_group_mapping_id>
        ```


        :param str resource_name: The name of the resource.
        :param PushGroupArgs 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(PushGroupArgs, 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,
                 app_config: Optional[pulumi.Input[Union['PushGroupAppConfigArgs', 'PushGroupAppConfigArgsDict']]] = None,
                 app_id: Optional[pulumi.Input[_builtins.str]] = None,
                 delete_target_group_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 source_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 status: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 target_group_name: 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__ = PushGroupArgs.__new__(PushGroupArgs)

            __props__.__dict__["app_config"] = app_config
            if app_id is None and not opts.urn:
                raise TypeError("Missing required property 'app_id'")
            __props__.__dict__["app_id"] = app_id
            __props__.__dict__["delete_target_group_on_destroy"] = delete_target_group_on_destroy
            if source_group_id is None and not opts.urn:
                raise TypeError("Missing required property 'source_group_id'")
            __props__.__dict__["source_group_id"] = source_group_id
            __props__.__dict__["status"] = status
            __props__.__dict__["target_group_id"] = target_group_id
            __props__.__dict__["target_group_name"] = target_group_name
        super(PushGroup, __self__).__init__(
            'okta:index/pushGroup:PushGroup',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            app_config: Optional[pulumi.Input[Union['PushGroupAppConfigArgs', 'PushGroupAppConfigArgsDict']]] = None,
            app_id: Optional[pulumi.Input[_builtins.str]] = None,
            delete_target_group_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
            source_group_id: Optional[pulumi.Input[_builtins.str]] = None,
            status: Optional[pulumi.Input[_builtins.str]] = None,
            target_group_id: Optional[pulumi.Input[_builtins.str]] = None,
            target_group_name: Optional[pulumi.Input[_builtins.str]] = None) -> 'PushGroup':
        """
        Get an existing PushGroup 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[Union['PushGroupAppConfigArgs', 'PushGroupAppConfigArgsDict']] app_config: Additional app configuration for group push mappings. Currently only required for Active Directory.
        :param pulumi.Input[_builtins.str] app_id: The ID of the Okta Application.
        :param pulumi.Input[_builtins.bool] delete_target_group_on_destroy: Whether to delete the target group when the push group mapping is destroyed. Default is true.
        :param pulumi.Input[_builtins.str] source_group_id: The ID of the source group in Okta.
        :param pulumi.Input[_builtins.str] status: The status of the push group mapping. Valid values: `ACTIVE` and `INACTIVE`
        :param pulumi.Input[_builtins.str] target_group_id: The ID of the target group.
        :param pulumi.Input[_builtins.str] target_group_name: The name of the target group for the group push mapping. This is used when creating a new downstream group. If the group already exists, it links to the existing group. If not specified, the name of the source group will be used as the name of the target group. Setting a target group name only works if you have unchecked 'Rename app groups to match group name in Okta' in the push groups settings UI.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _PushGroupState.__new__(_PushGroupState)

        __props__.__dict__["app_config"] = app_config
        __props__.__dict__["app_id"] = app_id
        __props__.__dict__["delete_target_group_on_destroy"] = delete_target_group_on_destroy
        __props__.__dict__["source_group_id"] = source_group_id
        __props__.__dict__["status"] = status
        __props__.__dict__["target_group_id"] = target_group_id
        __props__.__dict__["target_group_name"] = target_group_name
        return PushGroup(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="appConfig")
    def app_config(self) -> pulumi.Output[Optional['outputs.PushGroupAppConfig']]:
        """
        Additional app configuration for group push mappings. Currently only required for Active Directory.
        """
        return pulumi.get(self, "app_config")

    @_builtins.property
    @pulumi.getter(name="appId")
    def app_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the Okta Application.
        """
        return pulumi.get(self, "app_id")

    @_builtins.property
    @pulumi.getter(name="deleteTargetGroupOnDestroy")
    def delete_target_group_on_destroy(self) -> pulumi.Output[_builtins.bool]:
        """
        Whether to delete the target group when the push group mapping is destroyed. Default is true.
        """
        return pulumi.get(self, "delete_target_group_on_destroy")

    @_builtins.property
    @pulumi.getter(name="sourceGroupId")
    def source_group_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the source group in Okta.
        """
        return pulumi.get(self, "source_group_id")

    @_builtins.property
    @pulumi.getter
    def status(self) -> pulumi.Output[_builtins.str]:
        """
        The status of the push group mapping. Valid values: `ACTIVE` and `INACTIVE`
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter(name="targetGroupId")
    def target_group_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the target group.
        """
        return pulumi.get(self, "target_group_id")

    @_builtins.property
    @pulumi.getter(name="targetGroupName")
    def target_group_name(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The name of the target group for the group push mapping. This is used when creating a new downstream group. If the group already exists, it links to the existing group. If not specified, the name of the source group will be used as the name of the target group. Setting a target group name only works if you have unchecked 'Rename app groups to match group name in Okta' in the push groups settings UI.
        """
        return pulumi.get(self, "target_group_name")

