API Gateway v1 API - Class GatewayName (2.1.0)

public sealed class GatewayName : IResourceName, IEquatable<GatewayName>

Reference documentation and code samples for the API Gateway v1 API class GatewayName.

Resource name for the Gateway resource.

Inheritance

Object > GatewayName

Namespace

Google.Cloud.ApiGateway.V1

Assembly

Google.Cloud.ApiGateway.V1.dll

Constructors

GatewayName(String, String, String)

public GatewayName(string projectId, string locationId, string gatewayId)

Constructs a new instance of a GatewayName class from the component parts of pattern projects/{project}/locations/{location}/gateways/{gateway}

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

gatewayIdString

The Gateway ID. Must not be null or empty.

Properties

GatewayId

public string GatewayId { get; }

The Gateway 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

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

The GatewayName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
GatewayName.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)

public static string Format(string projectId, string locationId, string gatewayId)

Formats the IDs into the string representation of this GatewayName with pattern projects/{project}/locations/{location}/gateways/{gateway}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

gatewayIdString

The Gateway ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this GatewayName with pattern projects/{project}/locations/{location}/gateways/{gateway}.

FormatProjectLocationGateway(String, String, String)

public static string FormatProjectLocationGateway(string projectId, string locationId, string gatewayId)

Formats the IDs into the string representation of this GatewayName with pattern projects/{project}/locations/{location}/gateways/{gateway}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

gatewayIdString

The Gateway ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this GatewayName with pattern projects/{project}/locations/{location}/gateways/{gateway}.

FromProjectLocationGateway(String, String, String)

public static GatewayName FromProjectLocationGateway(string projectId, string locationId, string gatewayId)

Creates a GatewayName with the pattern projects/{project}/locations/{location}/gateways/{gateway}.

Parameters
NameDescription
projectIdString

The Project ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

gatewayIdString

The Gateway ID. Must not be null or empty.

Returns
TypeDescription
GatewayName

A new instance of GatewayName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static GatewayName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a GatewayName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
GatewayName

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

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

Parameter
NameDescription
gatewayNameString

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

Returns
TypeDescription
GatewayName

The parsed GatewayName if successful.

Remarks

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

  • projects/{project}/locations/{location}/gateways/{gateway}

Parse(String, Boolean)

public static GatewayName Parse(string gatewayName, bool allowUnparsed)

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

Parameters
NameDescription
gatewayNameString

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
GatewayName

The parsed GatewayName if successful.

Remarks

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

  • projects/{project}/locations/{location}/gateways/{gateway}
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 GatewayName)

public static bool TryParse(string gatewayName, out GatewayName result)

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

Parameters
NameDescription
gatewayNameString

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

resultGatewayName

When this method returns, the parsed GatewayName, 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}/locations/{location}/gateways/{gateway}

TryParse(String, Boolean, out GatewayName)

public static bool TryParse(string gatewayName, bool allowUnparsed, out GatewayName result)

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

Parameters
NameDescription
gatewayNameString

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.

resultGatewayName

When this method returns, the parsed GatewayName, 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}/locations/{location}/gateways/{gateway}
Or may be in any format if allowUnparsed is true.

Operators

Equality(GatewayName, GatewayName)

public static bool operator ==(GatewayName a, GatewayName b)
Parameters
NameDescription
aGatewayName
bGatewayName
Returns
TypeDescription
Boolean

Inequality(GatewayName, GatewayName)

public static bool operator !=(GatewayName a, GatewayName b)
Parameters
NameDescription
aGatewayName
bGatewayName
Returns
TypeDescription
Boolean