Security Command Center v2 API - Class FolderLocationName (1.0.0-beta03)

public sealed class FolderLocationName : IResourceName, IEquatable<FolderLocationName>

Reference documentation and code samples for the Security Command Center v2 API class FolderLocationName.

Resource name for the FolderLocation resource.

Inheritance

object > FolderLocationName

Namespace

Google.Cloud.SecurityCenter.V2

Assembly

Google.Cloud.SecurityCenter.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
Name Description
folderId string

The Folder ID. Must not be null or empty.

locationId string

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
Type Description
string

IsKnownPattern

public bool IsKnownPattern { get; }

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

Property Value
Type Description
bool

LocationId

public string LocationId { get; }

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

Property Value
Type Description
string

Type

public FolderLocationName.ResourceNameType Type { get; }

The FolderLocationName.ResourceNameType of the contained resource name.

Property Value
Type Description
FolderLocationNameResourceNameType

UnparsedResource

public UnparsedResourceName UnparsedResource { get; }

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

Property Value
Type Description
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
Name Description
folderId string

The Folder ID. Must not be null or empty.

locationId string

The Location ID. Must not be null or empty.

Returns
Type Description
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
Name Description
folderId string

The Folder ID. Must not be null or empty.

locationId string

The Location ID. Must not be null or empty.

Returns
Type Description
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
Name Description
folderId string

The Folder ID. Must not be null or empty.

locationId string

The Location ID. Must not be null or empty.

Returns
Type Description
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
Name Description
unparsedResourceName UnparsedResourceName

The unparsed resource name. Must not be null.

Returns
Type Description
FolderLocationName

A new instance of FolderLocationName containing the provided unparsedResourceName.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this resource name.

Returns
Type Description
int
Overrides

Parse(string)

public static FolderLocationName Parse(string folderLocationName)

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

Parameter
Name Description
folderLocationName string

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

Returns
Type Description
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
Name Description
folderLocationName string

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

allowUnparsed bool

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
Type Description
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
Type Description
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
Name Description
folderLocationName string

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

result FolderLocationName

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

Returns
Type Description
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
Name Description
folderLocationName string

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

allowUnparsed bool

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.

result FolderLocationName

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

Returns
Type Description
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
Name Description
a FolderLocationName

The first resource name to compare, or null.

b FolderLocationName

The second resource name to compare, or null.

Returns
Type Description
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
Name Description
a FolderLocationName

The first resource name to compare, or null.

b FolderLocationName

The second resource name to compare, or null.

Returns
Type Description
bool

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