Class InstructionName (2.0.0-beta01)

public sealed class InstructionName : IResourceName, IEquatable<InstructionName>

Resource name for the Instruction resource.

Inheritance

Object > InstructionName

Namespace

Google.Cloud.DataLabeling.V1Beta1

Assembly

Google.Cloud.DataLabeling.V1Beta1.dll

Constructors

InstructionName(String, String)

public InstructionName(string projectId, string instructionId)

Constructs a new instance of a InstructionName class from the component parts of pattern projects/{project}/instructions/{instruction}

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instructionIdString

The Instruction ID. Must not be null or empty.

Properties

InstructionId

public string InstructionId { get; }

The Instruction ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

IsKnownPattern

public bool IsKnownPattern { get; }

Whether this instance contains a resource name with a known pattern.

Property Value
TypeDescription
Boolean

ProjectId

public string ProjectId { get; }

The Project ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

Type

public InstructionName.ResourceNameType Type { get; }

The InstructionName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
InstructionName.ResourceNameType

UnparsedResource

public UnparsedResourceName UnparsedResource { get; }

The contained UnparsedResourceName. Only non-null if this instance contains an unparsed resource name.

Property Value
TypeDescription
UnparsedResourceName

Methods

Format(String, String)

public static string Format(string projectId, string instructionId)

Formats the IDs into the string representation of this InstructionName with pattern projects/{project}/instructions/{instruction}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instructionIdString

The Instruction ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this InstructionName with pattern projects/{project}/instructions/{instruction}.

FormatProjectInstruction(String, String)

public static string FormatProjectInstruction(string projectId, string instructionId)

Formats the IDs into the string representation of this InstructionName with pattern projects/{project}/instructions/{instruction}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instructionIdString

The Instruction ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this InstructionName with pattern projects/{project}/instructions/{instruction}.

FromProjectInstruction(String, String)

public static InstructionName FromProjectInstruction(string projectId, string instructionId)

Creates a InstructionName with the pattern projects/{project}/instructions/{instruction} .

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

instructionIdString

The Instruction ID. Must not be null or empty.

Returns
TypeDescription
InstructionName

A new instance of InstructionName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static InstructionName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a InstructionName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
InstructionName

A new instance of InstructionName containing the provided unparsedResourceName.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this resource name.

Returns
TypeDescription
Int32
Overrides

Parse(String)

public static InstructionName Parse(string instructionName)

Parses the given resource name string into a new InstructionName instance.

Parameter
NameDescription
instructionNameString

The resource name in string form. Must not be null.

Returns
TypeDescription
InstructionName

The parsed InstructionName if successful.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instructions/{instruction}

Parse(String, Boolean)

public static InstructionName Parse(string instructionName, bool allowUnparsed)

Parses the given resource name string into a new InstructionName instance; optionally allowing an unparseable resource name.

Parameters
NameDescription
instructionNameString

The resource name in string form. Must not be null.

allowUnparsedBoolean

If true will successfully store an unparseable resource name into the UnparsedResource property; otherwise will throw an ArgumentException if an unparseable resource name is specified.

Returns
TypeDescription
InstructionName

The parsed InstructionName if successful.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instructions/{instruction}
Or may be in any format if allowUnparsed is true.

ToString()

public override string ToString()

The string representation of the resource name.

Returns
TypeDescription
String

The string representation of the resource name.

Overrides

TryParse(String, out InstructionName)

public static bool TryParse(string instructionName, out InstructionName result)

Tries to parse the given resource name string into a new InstructionName instance.

Parameters
NameDescription
instructionNameString

The resource name in string form. Must not be null.

resultInstructionName

When this method returns, the parsed InstructionName, or null if parsing failed.

Returns
TypeDescription
Boolean

true if the name was parsed successfully; false otherwise.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instructions/{instruction}

TryParse(String, Boolean, out InstructionName)

public static bool TryParse(string instructionName, bool allowUnparsed, out InstructionName result)

Tries to parse the given resource name string into a new InstructionName instance; optionally allowing an unparseable resource name.

Parameters
NameDescription
instructionNameString

The resource name in string form. Must not be null.

allowUnparsedBoolean

If true will successfully store an unparseable resource name into the UnparsedResource property; otherwise will throw an ArgumentException if an unparseable resource name is specified.

resultInstructionName

When this method returns, the parsed InstructionName, or null if parsing failed.

Returns
TypeDescription
Boolean

true if the name was parsed successfully; false otherwise.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/instructions/{instruction}
Or may be in any format if allowUnparsed is true.

Operators

Equality(InstructionName, InstructionName)

public static bool operator ==(InstructionName a, InstructionName b)
Parameters
NameDescription
aInstructionName
bInstructionName
Returns
TypeDescription
Boolean

Inequality(InstructionName, InstructionName)

public static bool operator !=(InstructionName a, InstructionName b)
Parameters
NameDescription
aInstructionName
bInstructionName
Returns
TypeDescription
Boolean