Class ResourceIdentifier | Azure SDK for .NET

Posted by Janel Helmers on Thursday, June 20, 2024

An Azure Resource Manager resource identifier.

Inheritance

System.Object

ResourceIdentifier

Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Core.dll
Syntax
public sealed class ResourceIdentifier : IComparable<Azure.Core.ResourceIdentifier>, IEquatable<Azure.Core.ResourceIdentifier>

Constructors

ResourceIdentifier(String)

Declaration
public ResourceIdentifier (string resourceId);
Parameters
System.String resourceId

The id string to create the ResourceIdentifier from.

Fields

Root

The root of the resource hierarchy.

Declaration
public static readonly Azure.Core.ResourceIdentifier Root;
Field Value

Properties

Location

Gets the location if it exists otherwise null.

Declaration
public Nullable<Azure.Core.AzureLocation> Location { get; }
Property Value

Name

The name of the resource.

Declaration
public string Name { get; }
Property Value
System.String

Parent

The immediate parent containing this resource.

Declaration
public Azure.Core.ResourceIdentifier Parent { get; }
Property Value

Provider

Gets the provider namespace if it exists otherwise null.

Declaration
public string Provider { get; }
Property Value
System.String

ResourceGroupName

The name of the resource group if it exists otherwise null.

Declaration
public string ResourceGroupName { get; }
Property Value
System.String

ResourceType

The resource type of the resource.

Declaration
public Azure.Core.ResourceType ResourceType { get; }
Property Value

SubscriptionId

Gets the subscription id if it exists otherwise null.

Declaration
public string SubscriptionId { get; }
Property Value
System.String

Methods

AppendChildResource(String, String)

Add a provider resource to an existing resource id.

Declaration
[System.ComponentModel.EditorBrowsable] public Azure.Core.ResourceIdentifier AppendChildResource (string childResourceType, string childResourceName);
Parameters
System.String childResourceType

The simple type of the child resource, without slashes (/), for example, 'subnets'.

System.String childResourceName

The name of the resource.

Returns

AppendProviderResource(String, String, String)

Add a provider resource to an existing resource id.

Declaration
[System.ComponentModel.EditorBrowsable] public Azure.Core.ResourceIdentifier AppendProviderResource (string providerNamespace, string resourceType, string resourceName);
Parameters
System.String providerNamespace

The provider namespace of the added resource.

System.String resourceType

The simple type of the added resource, without slashes (/), for example, 'virtualMachines'.

System.String resourceName

The name of the resource.

Returns

CompareTo(ResourceIdentifier)

Compre this resource identifier to the given resource identifier.

Declaration
public int CompareTo (Azure.Core.ResourceIdentifier other);
Parameters
Returns
System.Int32

0 if the resource identifiers are equivalent, less than 0 if this resource identifier should be ordered before the given resource identifier, greater than 0 if this resource identifier should be ordered after the given resource identifier.

Equals(ResourceIdentifier)

Determine if this resource identifier is equivalent to the given resource identifier.

Declaration
public bool Equals (Azure.Core.ResourceIdentifier other);
Parameters
Returns
System.Boolean

True if the resource identifiers are equivalent, otherwise false.

Equals(Object)

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

Declaration
[System.ComponentModel.EditorBrowsable] public override bool Equals (object obj);
Parameters
System.Object obj

The object to compare with the current object.

Returns
System.Boolean

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

GetHashCode()

Serves as the default hash function.

Declaration
[System.ComponentModel.EditorBrowsable] public override int GetHashCode ();
Returns
System.Int32

A hash code for the current object.

Parse(String)

Converts the string representation of a ResourceIdentifier to the equivalent ResourceIdentifier structure.

Declaration
public static Azure.Core.ResourceIdentifier Parse (string input);
Parameters
System.String input

The id string to convert.

Returns
Exceptions
System.FormatException

when resourceId is not a valid ResourceIdentifier format.

System.ArgumentNullException

when resourceId is null.

System.ArgumentException

when resourceId is empty.

ToString()

Return the string representation of the resource identifier.

Declaration
public override string ToString ();
Returns
System.String

The string representation of this resource identifier.

TryParse(String, ResourceIdentifier)

Converts the string representation of a ResourceIdentifier to the equivalent ResourceIdentifier structure.

Declaration
public static bool TryParse (string input, out Azure.Core.ResourceIdentifier result);
Parameters
System.String input

The id string to convert.

ResourceIdentifier result

The structure that will contain the parsed value. If the method returns true result contains a valid ResourceIdentifier. If the method returns false, result will be null.

Returns
System.Boolean

True if the parse operation was successful; otherwise, false.

Operators

Equality(ResourceIdentifier, ResourceIdentifier)

Operator overloading for '=='.

Declaration
public static bool operator == (Azure.Core.ResourceIdentifier left, Azure.Core.ResourceIdentifier right);
Parameters
Returns
System.Boolean

GreaterThan(ResourceIdentifier, ResourceIdentifier)

Declaration
public static bool operator > (Azure.Core.ResourceIdentifier left, Azure.Core.ResourceIdentifier right);
Parameters
Returns
System.Boolean

True if the left object is greater than the right.

GreaterThanOrEqual(ResourceIdentifier, ResourceIdentifier)

Declaration
public static bool operator >= (Azure.Core.ResourceIdentifier left, Azure.Core.ResourceIdentifier right);
Parameters
Returns
System.Boolean

True if the left object is greater than or equal to the right.

Implicit(ResourceIdentifier to String)

Convert a resource identifier to a string.

Declaration
public static implicit operator string (Azure.Core.ResourceIdentifier id);
Parameters
Returns
System.String

Inequality(ResourceIdentifier, ResourceIdentifier)

Operator overloading for '!='.

Declaration
public static bool operator != (Azure.Core.ResourceIdentifier left, Azure.Core.ResourceIdentifier right);
Parameters
Returns
System.Boolean

LessThan(ResourceIdentifier, ResourceIdentifier)

Declaration
public static bool operator < (Azure.Core.ResourceIdentifier left, Azure.Core.ResourceIdentifier right);
Parameters
Returns
System.Boolean

True if the left object is less than the right.

LessThanOrEqual(ResourceIdentifier, ResourceIdentifier)

Declaration
public static bool operator <= (Azure.Core.ResourceIdentifier left, Azure.Core.ResourceIdentifier right);
Parameters
Returns
System.Boolean

True if the left object is less than or equal to the right.

ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnplonJ%2Bpu6bAjnqxrqqVY5CwvsRoaGdrYWN9cK3PomZ6sqWnsm%2BPzqucaHmqqr%2BmeqKoqZ5mgprAsMHRnJyCnJWjwaqyyJ6pZ6Ckork%3D