Show / Hide Table of Contents

Class Scope

Defines a scope path in Roster.

Inheritance
object
Scope
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Microsoft.GNS.Roster
Assembly: Microsoft.XboxStudios.SQTech.Roster.Common.dll
Syntax
[JsonConverter(typeof(RosterScopeConverter))]
public class Scope

Fields

View Source

Empty

Represents and unset object.

Declaration
public static readonly Scope Empty
Field Value
Type Description
Scope
View Source

OrgIdentifier

Org scope identifier.

Declaration
public const string OrgIdentifier = "o"
Field Value
Type Description
string
View Source

ProjectIdentifier

Project scope identifier.

Declaration
public const string ProjectIdentifier = "p"
Field Value
Type Description
string
View Source

Root

The root Roster scope.

Declaration
public static readonly Scope Root
Field Value
Type Description
Scope
View Source

ToolIdentifier

Tool scope identifier.

Declaration
public const string ToolIdentifier = "t"
Field Value
Type Description
string
View Source

UserIdentifier

User scope identifier.

Declaration
public const string UserIdentifier = "u"
Field Value
Type Description
string

Methods

View Source

Equals(object?)

Determines whether the specified object is equal to the current object.

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

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
object.Equals(object)
View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
View Source

GetScopeEntries()

Gets each scope section as a separate ScopeEntry.

Declaration
public IEnumerable<ScopeEntry> GetScopeEntries()
Returns
Type Description
IEnumerable<ScopeEntry>

An enumeration of scope entries.

View Source

IsUserScope(Guid, out Scope)

Determines if the scope is a user scope.

Declaration
public bool IsUserScope(Guid userId, out Scope baseNonUserScope)
Parameters
Type Name Description
Guid userId

The user Id from AAD.

Scope baseNonUserScope

The scope sans the user portion. If non-user scope then that same scope is returned.

Returns
Type Description
bool

The non-user portion of the scope.

View Source

OrgProjectScope(Guid, Guid)

Gets the user scope for an org and project metadata is associated with.

Declaration
public static Scope OrgProjectScope(Guid orgId, Guid projectId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgProjectToolScope(Guid, Guid, Guid)

Gets the scope for an org, project, and tool metadata is associated with.

Declaration
public static Scope OrgProjectToolScope(Guid orgId, Guid projectId, Guid toolId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Guid toolId

The tool the metadata is associated with.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgProjectToolUserScope(Guid, Guid, Guid, Guid)

Gets the scope for an org, project, and tool metadata is associated with.

Declaration
public static Scope OrgProjectToolUserScope(Guid orgId, Guid projectId, Guid toolId, Guid userId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Guid toolId

The tool the metadata is associated with.

Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgProjectUserScope(Guid, Guid, Guid)

Gets the user scope for an org and project metadata is associated with.

Declaration
public static Scope OrgProjectUserScope(Guid orgId, Guid projectId, Guid userId)
Parameters
Type Name Description
Guid orgId

The org a tool belongs too.

Guid projectId

The project the metadata is associated with.

Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The org project tool metadata scope.

View Source

OrgScope(Guid)

Gets the scope an org.

Declaration
public static Scope OrgScope(Guid orgId)
Parameters
Type Name Description
Guid orgId

The Id of the org a tool belongs to.

Returns
Type Description
Scope

The org tool scope.

View Source

OrgUserScope(Guid, Guid)

Gets the user scope for an org.

Declaration
public static Scope OrgUserScope(Guid orgId, Guid userId)
Parameters
Type Name Description
Guid orgId

The Id of the org a tool belongs to.

Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The org tool scope.

View Source

Parse(string?)

Parses a string into a Scope.

Declaration
public static Scope Parse(string? scopeString)
Parameters
Type Name Description
string scopeString

The string to parse.

Returns
Type Description
Scope

A Scope determined to be of a valid format.

View Source

SafeEncode()

Converts the scope to a system supported encoding.

Declaration
public string SafeEncode()
Returns
Type Description
string

The encoded string.

View Source

SubScopes()

Gets each subscope of the current scope as a scope.

Declaration
public IEnumerable<Scope> SubScopes()
Returns
Type Description
IEnumerable<Scope>

An enumeration of scopes.

View Source

ToOrgProjectScope(Guid)

Converts an org scope to a org/project scope.

Declaration
public Scope ToOrgProjectScope(Guid projectId)
Parameters
Type Name Description
Guid projectId

The project to append to the org scope.

Returns
Type Description
Scope

The updated scope.

View Source

ToOrgToolScope(Guid)

Converts an org scope to a org/tool scope.

Declaration
public Scope ToOrgToolScope(Guid toolId)
Parameters
Type Name Description
Guid toolId

The tool to append to the org scope.

Returns
Type Description
Scope

The updated scope.

View Source

ToString()

Converts the current scope into its string representation.

Declaration
public override string ToString()
Returns
Type Description
string

This scope as a string.

Overrides
object.ToString()
View Source

TryDecodeString(string?, out Scope)

Tries to decode a string into a scope.

Declaration
public static bool TryDecodeString(string? encodedValue, out Scope scope)
Parameters
Type Name Description
string encodedValue

The encoded string value.

Scope scope

The output Scope.

Returns
Type Description
bool

True if successfully decoded. Otherwise, false.

View Source

TryParse(string?, out Scope)

Attempts to parse string into a Scope.

Declaration
public static bool TryParse(string? scopeString, out Scope scope)
Parameters
Type Name Description
string scopeString

The string to parse.

Scope scope

The output Scope object.

Returns
Type Description
bool

True if successfully parsed. Otherwise, false.

View Source

UserScope(Guid)

Gets the scope for a user in the root.

Declaration
public static Scope UserScope(Guid userId)
Parameters
Type Name Description
Guid userId

The user Id from AAD.

Returns
Type Description
Scope

The root user scope.

  • View Source
In this article
Back to top Generated by DocFX