Security Center Management v1 API - Class FolderLocationName (1.0.0-beta01)

public sealed class FolderLocationName : IResourceName, IEquatable<FolderLocationName>

Reference documentation and code samples for the Security Center Management v1 API class FolderLocationName.

Resource name for the FolderLocation resource.

Inheritance

object > FolderLocationName

Namespace

Google.Cloud.SecurityCenterManagement.V1

Assembly

Google.Cloud.SecurityCenterManagement.V1.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
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

Type

public FolderLocationName.ResourceNameType Type { get; }

The FolderLocationName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
FolderLocationNameResourceNameType

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
int
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, bool)

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.

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
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
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:

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

TryParse(string, bool, 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.

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.

resultFolderLocationName

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

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

Operators

operator ==(FolderLocationName, FolderLocationName)

public static bool operator ==(FolderLocationName a, FolderLocationName b)

Determines whether two specified resource names have the same value.

Parameters
NameDescription
aFolderLocationName

The first resource name to compare, or null.

bFolderLocationName

The second resource name to compare, or null.

Returns
TypeDescription
bool

true if the value of a is the same as the value of b; otherwise, false.

operator !=(FolderLocationName, FolderLocationName)

public static bool operator !=(FolderLocationName a, FolderLocationName b)

Determines whether two specified resource names have different values.

Parameters
NameDescription
aFolderLocationName

The first resource name to compare, or null.

bFolderLocationName

The second resource name to compare, or null.

Returns
TypeDescription
bool

true if the value of a is different from the value of b; otherwise, false.