Show / Hide Table of Contents

Class FolderName

Resource name for the 'folder' resource which is widespread across Google Cloud Platform. While most resource names are generated on a per-API basis, many APIs use a folder resource, and it's useful to be able to pass values from one API to another.

Inheritance
System.Object
FolderName
Implements
IResourceName
System.IEquatable<FolderName>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api.Gax.ResourceNames
Assembly: Google.Api.Gax.dll
Syntax
public sealed class FolderName : IResourceName, IEquatable<FolderName>

Constructors

FolderName(String)

Constructs a new instance of the FolderName resource name class from its component parts.

Declaration
public FolderName(string folderId)
Parameters
Type Name Description
System.String folderId

The folder ID. Must not be null.

Properties

FolderId

The folder ID. Never null.

Declaration
public string FolderId { get; }
Property Value
Type Description
System.String

Kind

The kind of resource name.

Declaration
public ResourceNameKind Kind { get; }
Property Value
Type Description
ResourceNameKind
Implements
IResourceName.Kind

Methods

Equals(FolderName)

Declaration
public bool Equals(FolderName other)
Parameters
Type Name Description
FolderName other
Returns
Type Description
System.Boolean
Implements
System.IEquatable<T>.Equals(T)

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)

Format(String)

Formats the IDs into the string representation of the FolderName.

Declaration
public static string Format(string folderId)
Parameters
Type Name Description
System.String folderId

The folder ID. Must not be null.

Returns
Type Description
System.String

The string representation of the FolderName.

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

Parse(String)

Parses the given folder resource name in string form into a new FolderName instance.

Declaration
public static FolderName Parse(string folderName)
Parameters
Type Name Description
System.String folderName

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

Returns
Type Description
FolderName

The parsed FolderName if successful.

ToString()

The string representation of the resource name.

Declaration
public override string ToString()
Returns
Type Description
System.String

The string representation of the resource name.

Overrides
System.Object.ToString()
Implements
IResourceName.ToString()

TryParse(String, out FolderName)

Tries to parse the given folder resource name in string form into a new FolderName instance.

Declaration
public static bool TryParse(string folderName, out FolderName result)
Parameters
Type Name Description
System.String folderName

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

FolderName result

When this method returns, the parsed FolderName, or null if parsing fails.

Returns
Type Description
System.Boolean

true if the name was parsed successfully; false otherwise.

Remarks

This method still throws System.ArgumentNullException if folderName is null, as this would usually indicate a programming error rather than a data error.

Operators

Equality(FolderName, FolderName)

Declaration
public static bool operator ==(FolderName a, FolderName b)
Parameters
Type Name Description
FolderName a
FolderName b
Returns
Type Description
System.Boolean

Inequality(FolderName, FolderName)

Declaration
public static bool operator !=(FolderName a, FolderName b)
Parameters
Type Name Description
FolderName a
FolderName b
Returns
Type Description
System.Boolean
Back to top