Class ExampleName (1.0.0-beta03)

public sealed class ExampleName : IResourceName, IEquatable<ExampleName>

Resource name for the Example resource.

Inheritance

Object > ExampleName

Namespace

Google.Cloud.DataLabeling.V1Beta1

Assembly

Google.Cloud.DataLabeling.V1Beta1.dll

Constructors

ExampleName(String, String, String, String)

public ExampleName(string projectId, string datasetId, string annotatedDatasetId, string exampleId)

Constructs a new instance of a ExampleName class from the component parts of pattern projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

datasetIdString

The Dataset ID. Must not be null or empty.

annotatedDatasetIdString

The AnnotatedDataset ID. Must not be null or empty.

exampleIdString

The Example ID. Must not be null or empty.

Properties

AnnotatedDatasetId

public string AnnotatedDatasetId { get; }

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

Property Value
TypeDescription
String

DatasetId

public string DatasetId { get; }

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

Property Value
TypeDescription
String

ExampleId

public string ExampleId { get; }

The Example 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 ExampleName.ResourceNameType Type { get; }

The ExampleName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
ExampleName.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, String, String)

public static string Format(string projectId, string datasetId, string annotatedDatasetId, string exampleId)

Formats the IDs into the string representation of this ExampleName with pattern projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

datasetIdString

The Dataset ID. Must not be null or empty.

annotatedDatasetIdString

The AnnotatedDataset ID. Must not be null or empty.

exampleIdString

The Example ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this ExampleName with pattern projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}.

FormatProjectDatasetAnnotatedDatasetExample(String, String, String, String)

public static string FormatProjectDatasetAnnotatedDatasetExample(string projectId, string datasetId, string annotatedDatasetId, string exampleId)

Formats the IDs into the string representation of this ExampleName with pattern projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

datasetIdString

The Dataset ID. Must not be null or empty.

annotatedDatasetIdString

The AnnotatedDataset ID. Must not be null or empty.

exampleIdString

The Example ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this ExampleName with pattern projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}.

FromProjectDatasetAnnotatedDatasetExample(String, String, String, String)

public static ExampleName FromProjectDatasetAnnotatedDatasetExample(string projectId, string datasetId, string annotatedDatasetId, string exampleId)

Creates a ExampleName with the pattern projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

datasetIdString

The Dataset ID. Must not be null or empty.

annotatedDatasetIdString

The AnnotatedDataset ID. Must not be null or empty.

exampleIdString

The Example ID. Must not be null or empty.

Returns
TypeDescription
ExampleName

A new instance of ExampleName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static ExampleName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a ExampleName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
ExampleName

A new instance of ExampleName 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 ExampleName Parse(string exampleName)

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

Parameter
NameDescription
exampleNameString

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

Returns
TypeDescription
ExampleName

The parsed ExampleName if successful.

Remarks

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

  • projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}

Parse(String, Boolean)

public static ExampleName Parse(string exampleName, bool allowUnparsed)

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

Parameters
NameDescription
exampleNameString

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
ExampleName

The parsed ExampleName if successful.

Remarks

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

  • projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}
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 ExampleName)

public static bool TryParse(string exampleName, out ExampleName result)

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

Parameters
NameDescription
exampleNameString

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

resultExampleName

When this method returns, the parsed ExampleName, 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}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}

TryParse(String, Boolean, out ExampleName)

public static bool TryParse(string exampleName, bool allowUnparsed, out ExampleName result)

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

Parameters
NameDescription
exampleNameString

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.

resultExampleName

When this method returns, the parsed ExampleName, 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}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}
Or may be in any format if allowUnparsed is true.

Operators

Equality(ExampleName, ExampleName)

public static bool operator ==(ExampleName a, ExampleName b)
Parameters
NameDescription
aExampleName
bExampleName
Returns
TypeDescription
Boolean

Inequality(ExampleName, ExampleName)

public static bool operator !=(ExampleName a, ExampleName b)
Parameters
NameDescription
aExampleName
bExampleName
Returns
TypeDescription
Boolean