Cloud Workstations v1 API - Class WorkstationName (1.0.0)

public sealed class WorkstationName : IResourceName, IEquatable<WorkstationName>

Reference documentation and code samples for the Cloud Workstations v1 API class WorkstationName.

Resource name for the Workstation resource.

Inheritance

object > WorkstationName

Namespace

Google.Cloud.Workstations.V1

Assembly

Google.Cloud.Workstations.V1.dll

Constructors

WorkstationName(string, string, string, string, string)

public WorkstationName(string projectId, string locationId, string workstationClusterId, string workstationConfigId, string workstationId)

Constructs a new instance of a WorkstationName class from the component parts of pattern projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

locationIdstring

The Location ID. Must not be null or empty.

workstationClusterIdstring

The WorkstationCluster ID. Must not be null or empty.

workstationConfigIdstring

The WorkstationConfig ID. Must not be null or empty.

workstationIdstring

The Workstation ID. Must not be null or empty.

Properties

IsKnownPattern

public bool IsKnownPattern { get; }

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

Property Value
TypeDescription
bool

LocationId

public string LocationId { get; }

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

Property Value
TypeDescription
string

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 WorkstationName.ResourceNameType Type { get; }

The WorkstationName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
WorkstationNameResourceNameType

UnparsedResource

public UnparsedResourceName UnparsedResource { get; }

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

Property Value
TypeDescription
UnparsedResourceName

WorkstationClusterId

public string WorkstationClusterId { get; }

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

Property Value
TypeDescription
string

WorkstationConfigId

public string WorkstationConfigId { get; }

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

Property Value
TypeDescription
string

WorkstationId

public string WorkstationId { get; }

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

Property Value
TypeDescription
string

Methods

Format(string, string, string, string, string)

public static string Format(string projectId, string locationId, string workstationClusterId, string workstationConfigId, string workstationId)

Formats the IDs into the string representation of this WorkstationName with pattern projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation} .

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

locationIdstring

The Location ID. Must not be null or empty.

workstationClusterIdstring

The WorkstationCluster ID. Must not be null or empty.

workstationConfigIdstring

The WorkstationConfig ID. Must not be null or empty.

workstationIdstring

The Workstation ID. Must not be null or empty.

Returns
TypeDescription
string

The string representation of this WorkstationName with pattern projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation} .

FormatProjectLocationWorkstationClusterWorkstationConfigWorkstation(string, string, string, string, string)

public static string FormatProjectLocationWorkstationClusterWorkstationConfigWorkstation(string projectId, string locationId, string workstationClusterId, string workstationConfigId, string workstationId)

Formats the IDs into the string representation of this WorkstationName with pattern projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation} .

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

locationIdstring

The Location ID. Must not be null or empty.

workstationClusterIdstring

The WorkstationCluster ID. Must not be null or empty.

workstationConfigIdstring

The WorkstationConfig ID. Must not be null or empty.

workstationIdstring

The Workstation ID. Must not be null or empty.

Returns
TypeDescription
string

The string representation of this WorkstationName with pattern projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation} .

FromProjectLocationWorkstationClusterWorkstationConfigWorkstation(string, string, string, string, string)

public static WorkstationName FromProjectLocationWorkstationClusterWorkstationConfigWorkstation(string projectId, string locationId, string workstationClusterId, string workstationConfigId, string workstationId)

Creates a WorkstationName with the pattern projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation} .

Parameters
NameDescription
projectIdstring

The Project ID. Must not be null or empty.

locationIdstring

The Location ID. Must not be null or empty.

workstationClusterIdstring

The WorkstationCluster ID. Must not be null or empty.

workstationConfigIdstring

The WorkstationConfig ID. Must not be null or empty.

workstationIdstring

The Workstation ID. Must not be null or empty.

Returns
TypeDescription
WorkstationName

A new instance of WorkstationName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static WorkstationName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a WorkstationName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
WorkstationName

A new instance of WorkstationName containing the provided unparsedResourceName.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this resource name.

Returns
TypeDescription
int
Overrides

Parse(string)

public static WorkstationName Parse(string workstationName)

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

Parameter
NameDescription
workstationNamestring

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

Returns
TypeDescription
WorkstationName

The parsed WorkstationName if successful.

Remarks

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

  • projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}

Parse(string, bool)

public static WorkstationName Parse(string workstationName, bool allowUnparsed)

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

Parameters
NameDescription
workstationNamestring

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

allowUnparsedbool

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
WorkstationName

The parsed WorkstationName if successful.

Remarks

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

  • projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}
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 WorkstationName)

public static bool TryParse(string workstationName, out WorkstationName result)

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

Parameters
NameDescription
workstationNamestring

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

resultWorkstationName

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

Returns
TypeDescription
bool

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}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}

TryParse(string, bool, out WorkstationName)

public static bool TryParse(string workstationName, bool allowUnparsed, out WorkstationName result)

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

Parameters
NameDescription
workstationNamestring

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

allowUnparsedbool

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.

resultWorkstationName

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

Returns
TypeDescription
bool

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}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}
Or may be in any format if allowUnparsed is true.

Operators

operator ==(WorkstationName, WorkstationName)

public static bool operator ==(WorkstationName a, WorkstationName b)
Parameters
NameDescription
aWorkstationName
bWorkstationName
Returns
TypeDescription
bool

operator !=(WorkstationName, WorkstationName)

public static bool operator !=(WorkstationName a, WorkstationName b)
Parameters
NameDescription
aWorkstationName
bWorkstationName
Returns
TypeDescription
bool