Resource Settings v1 API - Class SettingName (2.3.0)

public sealed class SettingName : IResourceName, IEquatable<SettingName>

Reference documentation and code samples for the Resource Settings v1 API class SettingName.

Resource name for the Setting resource.

Inheritance

object > SettingName

Namespace

Google.Cloud.ResourceSettings.V1

Assembly

Google.Cloud.ResourceSettings.V1.dll

Constructors

SettingName(string, string)

public SettingName(string projectNumberId, string settingNameId)

Constructs a new instance of a SettingName class from the component parts of pattern projects/{project_number}/settings/{setting_name}

Parameters
Name Description
projectNumberId string

The ProjectNumber ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Properties

FolderId

public string FolderId { get; }

The Folder ID. May be null, depending on which resource name is contained by this instance.

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

OrganizationId

public string OrganizationId { get; }

The Organization ID. May be null, depending on which resource name is contained by this instance.

Property Value
Type Description
string

ProjectNumberId

public string ProjectNumberId { get; }

The ProjectNumber ID. May be null, depending on which resource name is contained by this instance.

Property Value
Type Description
string

SettingNameId

public string SettingNameId { get; }

The SettingName ID. May be null, depending on which resource name is contained by this instance.

Property Value
Type Description
string

Type

public SettingName.ResourceNameType Type { get; }

The SettingName.ResourceNameType of the contained resource name.

Property Value
Type Description
SettingNameResourceNameType

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 projectNumberId, string settingNameId)

Formats the IDs into the string representation of this SettingName with pattern projects/{project_number}/settings/{setting_name}.

Parameters
Name Description
projectNumberId string

The ProjectNumber ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this SettingName with pattern projects/{project_number}/settings/{setting_name}.

FormatFolderSettingName(string, string)

public static string FormatFolderSettingName(string folderId, string settingNameId)

Formats the IDs into the string representation of this SettingName with pattern folders/{folder}/settings/{setting_name}.

Parameters
Name Description
folderId string

The Folder ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this SettingName with pattern folders/{folder}/settings/{setting_name}.

FormatOrganizationSettingName(string, string)

public static string FormatOrganizationSettingName(string organizationId, string settingNameId)

Formats the IDs into the string representation of this SettingName with pattern organizations/{organization}/settings/{setting_name}.

Parameters
Name Description
organizationId string

The Organization ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this SettingName with pattern organizations/{organization}/settings/{setting_name}.

FormatProjectNumberSettingName(string, string)

public static string FormatProjectNumberSettingName(string projectNumberId, string settingNameId)

Formats the IDs into the string representation of this SettingName with pattern projects/{project_number}/settings/{setting_name}.

Parameters
Name Description
projectNumberId string

The ProjectNumber ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this SettingName with pattern projects/{project_number}/settings/{setting_name}.

FromFolderSettingName(string, string)

public static SettingName FromFolderSettingName(string folderId, string settingNameId)

Creates a SettingName with the pattern folders/{folder}/settings/{setting_name}.

Parameters
Name Description
folderId string

The Folder ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Returns
Type Description
SettingName

A new instance of SettingName constructed from the provided ids.

FromOrganizationSettingName(string, string)

public static SettingName FromOrganizationSettingName(string organizationId, string settingNameId)

Creates a SettingName with the pattern organizations/{organization}/settings/{setting_name} .

Parameters
Name Description
organizationId string

The Organization ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Returns
Type Description
SettingName

A new instance of SettingName constructed from the provided ids.

FromProjectNumberSettingName(string, string)

public static SettingName FromProjectNumberSettingName(string projectNumberId, string settingNameId)

Creates a SettingName with the pattern projects/{project_number}/settings/{setting_name} .

Parameters
Name Description
projectNumberId string

The ProjectNumber ID. Must not be null or empty.

settingNameId string

The SettingName ID. Must not be null or empty.

Returns
Type Description
SettingName

A new instance of SettingName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static SettingName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a SettingName containing an unparsed resource name.

Parameter
Name Description
unparsedResourceName UnparsedResourceName

The unparsed resource name. Must not be null.

Returns
Type Description
SettingName

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

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

Parameter
Name Description
settingName string

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

Returns
Type Description
SettingName

The parsed SettingName if successful.

Remarks

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

  • projects/{project_number}/settings/{setting_name}
  • folders/{folder}/settings/{setting_name}
  • organizations/{organization}/settings/{setting_name}

Parse(string, bool)

public static SettingName Parse(string settingName, bool allowUnparsed)

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

Parameters
Name Description
settingName 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
SettingName

The parsed SettingName if successful.

Remarks

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

  • projects/{project_number}/settings/{setting_name}
  • folders/{folder}/settings/{setting_name}
  • organizations/{organization}/settings/{setting_name}
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 SettingName)

public static bool TryParse(string settingName, out SettingName result)

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

Parameters
Name Description
settingName string

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

result SettingName

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

  • projects/{project_number}/settings/{setting_name}
  • folders/{folder}/settings/{setting_name}
  • organizations/{organization}/settings/{setting_name}

TryParse(string, bool, out SettingName)

public static bool TryParse(string settingName, bool allowUnparsed, out SettingName result)

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

Parameters
Name Description
settingName 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 SettingName

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

  • projects/{project_number}/settings/{setting_name}
  • folders/{folder}/settings/{setting_name}
  • organizations/{organization}/settings/{setting_name}
Or may be in any format if allowUnparsed is true.

Operators

operator ==(SettingName, SettingName)

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

Determines whether two specified resource names have the same value.

Parameters
Name Description
a SettingName

The first resource name to compare, or null.

b SettingName

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 !=(SettingName, SettingName)

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

Determines whether two specified resource names have different values.

Parameters
Name Description
a SettingName

The first resource name to compare, or null.

b SettingName

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.