# 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 pulumi
import pulumi.runtime

class RoleAssignment(pulumi.CustomResource):
    """
    Manages a V3 Role assignment within OpenStack Keystone.
    
    Note: You _must_ have admin privileges in your OpenStack cloud to use
    this resource.
    """
    def __init__(__self__, __name__, __opts__=None, domain_id=None, group_id=None, project_id=None, role_id=None, user_id=None):
        """Create a RoleAssignment resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if domain_id and not isinstance(domain_id, basestring):
            raise TypeError('Expected property domain_id to be a basestring')
        __self__.domain_id = domain_id
        """
        The domain to assign the role in.
        """
        __props__['domainId'] = domain_id

        if group_id and not isinstance(group_id, basestring):
            raise TypeError('Expected property group_id to be a basestring')
        __self__.group_id = group_id
        """
        The group to assign the role to.
        """
        __props__['groupId'] = group_id

        if project_id and not isinstance(project_id, basestring):
            raise TypeError('Expected property project_id to be a basestring')
        __self__.project_id = project_id
        """
        The project to assign the role in.
        """
        __props__['projectId'] = project_id

        if not role_id:
            raise TypeError('Missing required property role_id')
        elif not isinstance(role_id, basestring):
            raise TypeError('Expected property role_id to be a basestring')
        __self__.role_id = role_id
        """
        The role to assign.
        """
        __props__['roleId'] = role_id

        if user_id and not isinstance(user_id, basestring):
            raise TypeError('Expected property user_id to be a basestring')
        __self__.user_id = user_id
        """
        The user to assign the role to.
        """
        __props__['userId'] = user_id

        super(RoleAssignment, __self__).__init__(
            'openstack:identity/roleAssignment:RoleAssignment',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'domainId' in outs:
            self.domain_id = outs['domainId']
        if 'groupId' in outs:
            self.group_id = outs['groupId']
        if 'projectId' in outs:
            self.project_id = outs['projectId']
        if 'roleId' in outs:
            self.role_id = outs['roleId']
        if 'userId' in outs:
            self.user_id = outs['userId']
