Class FolderLocationName (3.4.0)

public sealed class FolderLocationName : IResourceName, IEquatable<FolderLocationName>

Resource name for the FolderLocation resource.

Inheritance

System.Object > FolderLocationName

Namespace

Google.Cloud.Logging.V2

Assembly

Google.Cloud.Logging.V2.dll

Constructors

FolderLocationName(String, String)

public FolderLocationName(string folderId, string locationId)

Constructs a new instance of a FolderLocationName class from the component parts of pattern folders/{folder}/locations/{location}

Parameters
NameDescription
folderIdString

The Folder ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

Properties

FolderId

public string FolderId { get; }

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

Type

public FolderLocationName.ResourceNameType Type { get; }

The FolderLocationName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
FolderLocationName.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 folderId, string locationId)

Formats the IDs into the string representation of this FolderLocationName with pattern folders/{folder}/locations/{location}.

Parameters
NameDescription
folderIdString

The Folder ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this FolderLocationName with pattern folders/{folder}/locations/{location}.

FormatFolderLocation(String, String)

public static string FormatFolderLocation(string folderId, string locationId)

Formats the IDs into the string representation of this FolderLocationName with pattern folders/{folder}/locations/{location}.

Parameters
NameDescription
folderIdString

The Folder ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this FolderLocationName with pattern folders/{folder}/locations/{location}.

FromFolderLocation(String, String)

public static FolderLocationName FromFolderLocation(string folderId, string locationId)

Creates a FolderLocationName with the pattern folders/{folder}/locations/{location}.

Parameters
NameDescription
folderIdString

The Folder ID. Must not be null or empty.

locationIdString

The Location ID. Must not be null or empty.

Returns
TypeDescription
FolderLocationName

A new instance of FolderLocationName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static FolderLocationName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a FolderLocationName containing an unparsed resource name.

Parameter
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
FolderLocationName

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

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

Parameter
NameDescription
folderLocationNameString

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

Returns
TypeDescription
FolderLocationName

The parsed FolderLocationName if successful.

Remarks

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

  • folders/{folder}/locations/{location}

Parse(String, Boolean)

public static FolderLocationName Parse(string folderLocationName, bool allowUnparsed)

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

Parameters
NameDescription
folderLocationNameString

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
FolderLocationName

The parsed FolderLocationName if successful.

Remarks

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

  • folders/{folder}/locations/{location}
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 FolderLocationName)

public static bool TryParse(string folderLocationName, out FolderLocationName result)

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

Parameters
NameDescription
folderLocationNameString

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

resultFolderLocationName

When this method returns, the parsed FolderLocationName, 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:

  • folders/{folder}/locations/{location}

TryParse(String, Boolean, out FolderLocationName)

public static bool TryParse(string folderLocationName, bool allowUnparsed, out FolderLocationName result)

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

Parameters
NameDescription
folderLocationNameString

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.

resultFolderLocationName

When this method returns, the parsed FolderLocationName, 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:

  • folders/{folder}/locations/{location}
Or may be in any format if allowUnparsed is true.

Operators

Equality(FolderLocationName, FolderLocationName)

public static bool operator ==(FolderLocationName a, FolderLocationName b)
Parameters
NameDescription
aFolderLocationName
bFolderLocationName
Returns
TypeDescription
Boolean

Inequality(FolderLocationName, FolderLocationName)

public static bool operator !=(FolderLocationName a, FolderLocationName b)
Parameters
NameDescription
aFolderLocationName
bFolderLocationName
Returns
TypeDescription
Boolean