docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct Role

    This struct holds information about a role.

    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Cloud.Common
    Assembly: Unity.Cloud.Common.dll
    Syntax
    public readonly struct Role

    Constructors

    Role(string)

    Creates a Role using a string.

    Declaration
    public Role(string value)
    Parameters
    Type Name Description
    string value

    The string representing the role

    Fields

    Guest

    Returns the value of a role representing a guest

    Declaration
    public static readonly Role Guest
    Field Value
    Type Description
    Role

    Manager

    Returns the value of a role representing a manager

    Declaration
    public static readonly Role Manager
    Field Value
    Type Description
    Role

    Owner

    Returns the value of a role representing an owner

    Declaration
    public static readonly Role Owner
    Field Value
    Type Description
    Role

    ProjectGuest

    Returns the value of a role representing a project guest

    Declaration
    public static readonly Role ProjectGuest
    Field Value
    Type Description
    Role

    User

    Returns the value of a role representing a user

    Declaration
    public static readonly Role User
    Field Value
    Type Description
    Role

    Methods

    Equals(object)

    Validates that obj is a Role instance and that it has the same value as this instance.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    Compare the values with this instance.

    Returns
    Type Description
    bool

    true if both instances have the same values; false otherwise.

    Overrides
    ValueType.Equals(object)

    Equals(Role)

    Returns whether two Role objects are equals.

    Declaration
    public bool Equals(Role other)
    Parameters
    Type Name Description
    Role other
    Returns
    Type Description
    bool

    true if both instances have the same values; false otherwise.

    GetHashCode()

    Computes a hash code for the object.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    ValueType.GetHashCode()
    Remarks
    • You should not assume that equal hash codes imply object equality.
    • You should never persist or use a hash code outside the application domain in which it was created, because the same object may hash differently across application domains, processes, and platforms.

    ToString()

    Get the string representation of this Role.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The string result.

    Overrides
    ValueType.ToString()

    Operators

    operator ==(Role, Role)

    Returns whether two Role instances are equal.

    Declaration
    public static bool operator ==(Role left, Role right)
    Parameters
    Type Name Description
    Role left

    First instance.

    Role right

    Second instance.

    Returns
    Type Description
    bool

    true if the instances are equal; false otherwise.

    explicit operator string(Role)

    Explicitly cast a Role to a string

    Declaration
    public static explicit operator string(Role role)
    Parameters
    Type Name Description
    Role role

    Object to cast

    Returns
    Type Description
    string

    The resulting string

    operator !=(Role, Role)

    Returns whether two Role instances are different.

    Declaration
    public static bool operator !=(Role left, Role right)
    Parameters
    Type Name Description
    Role left

    First instance.

    Role right

    Second instance.

    Returns
    Type Description
    bool

    true if the instances are different; false otherwise.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)