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

__all__ = ['GroupShareGroup']


class GroupShareGroup(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 expires_at: Optional[pulumi.Input[str]] = None,
                 group_access: Optional[pulumi.Input[str]] = None,
                 group_id: Optional[pulumi.Input[str]] = None,
                 share_group_id: Optional[pulumi.Input[int]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        ## # gitlab\_group\_share\_group

        This resource allows you to share a group with another group

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        test = gitlab.GroupShareGroup("test",
            group_id=gitlab_group["foo"]["id"],
            share_group_id=gitlab_group["bar"]["id"],
            group_access="guest",
            expires_at="2099-01-01")
        ```

        ## Import

        GitLab group shares can be imported using an id made up of `mainGroupId:shareGroupId`, e.g.

        ```sh
         $ pulumi import gitlab:index/groupShareGroup:GroupShareGroup test 12345:1337
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] expires_at: Share expiration date. Format: `YYYY-MM-DD`
        :param pulumi.Input[str] group_access: One of five levels of access to the group.
        :param pulumi.Input[str] group_id: The id of the main group.
        :param pulumi.Input[int] share_group_id: The id of an additional group which will be shared with the main group.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        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__ = dict()

            __props__['expires_at'] = expires_at
            if group_access is None and not opts.urn:
                raise TypeError("Missing required property 'group_access'")
            __props__['group_access'] = group_access
            if group_id is None and not opts.urn:
                raise TypeError("Missing required property 'group_id'")
            __props__['group_id'] = group_id
            if share_group_id is None and not opts.urn:
                raise TypeError("Missing required property 'share_group_id'")
            __props__['share_group_id'] = share_group_id
        super(GroupShareGroup, __self__).__init__(
            'gitlab:index/groupShareGroup:GroupShareGroup',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            expires_at: Optional[pulumi.Input[str]] = None,
            group_access: Optional[pulumi.Input[str]] = None,
            group_id: Optional[pulumi.Input[str]] = None,
            share_group_id: Optional[pulumi.Input[int]] = None) -> 'GroupShareGroup':
        """
        Get an existing GroupShareGroup 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] expires_at: Share expiration date. Format: `YYYY-MM-DD`
        :param pulumi.Input[str] group_access: One of five levels of access to the group.
        :param pulumi.Input[str] group_id: The id of the main group.
        :param pulumi.Input[int] share_group_id: The id of an additional group which will be shared with the main group.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["expires_at"] = expires_at
        __props__["group_access"] = group_access
        __props__["group_id"] = group_id
        __props__["share_group_id"] = share_group_id
        return GroupShareGroup(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="expiresAt")
    def expires_at(self) -> pulumi.Output[Optional[str]]:
        """
        Share expiration date. Format: `YYYY-MM-DD`
        """
        return pulumi.get(self, "expires_at")

    @property
    @pulumi.getter(name="groupAccess")
    def group_access(self) -> pulumi.Output[str]:
        """
        One of five levels of access to the group.
        """
        return pulumi.get(self, "group_access")

    @property
    @pulumi.getter(name="groupId")
    def group_id(self) -> pulumi.Output[str]:
        """
        The id of the main group.
        """
        return pulumi.get(self, "group_id")

    @property
    @pulumi.getter(name="shareGroupId")
    def share_group_id(self) -> pulumi.Output[int]:
        """
        The id of an additional group which will be shared with the main group.
        """
        return pulumi.get(self, "share_group_id")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

