Class SettingName (2.0.0)

public sealed class SettingName : IResourceName, IEquatable<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
NameDescription
projectNumberIdString

The ProjectNumber ID. Must not be null or empty.

settingNameIdString

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
TypeDescription
String

IsKnownPattern

public bool IsKnownPattern { get; }

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

Property Value
TypeDescription
Boolean

OrganizationId

public string OrganizationId { get; }

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

Property Value
TypeDescription
String

ProjectNumberId

public string ProjectNumberId { get; }

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

Property Value
TypeDescription
String

SettingNameId

public string SettingNameId { get; }

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

Property Value
TypeDescription
String

Type

public SettingName.ResourceNameType Type { get; }

The SettingName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
SettingName.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 projectNumberId, string settingNameId)

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

Parameters
NameDescription
projectNumberIdString

The ProjectNumber ID. Must not be null or empty.

settingNameIdString

The SettingName ID. Must not be null or empty.

Returns
TypeDescription
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
NameDescription
folderIdString

The Folder ID. Must not be null or empty.

settingNameIdString

The SettingName ID. Must not be null or empty.

Returns
TypeDescription
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
NameDescription
organizationIdString

The Organization ID. Must not be null or empty.

settingNameIdString

The SettingName ID. Must not be null or empty.

Returns
TypeDescription
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
NameDescription
projectNumberIdString

The ProjectNumber ID. Must not be null or empty.

settingNameIdString

The SettingName ID. Must not be null or empty.

Returns
TypeDescription
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
NameDescription
folderIdString

The Folder ID. Must not be null or empty.

settingNameIdString

The SettingName ID. Must not be null or empty.

Returns
TypeDescription
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
NameDescription
organizationIdString

The Organization ID. Must not be null or empty.

settingNameIdString

The SettingName ID. Must not be null or empty.

Returns
TypeDescription
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
NameDescription
projectNumberIdString

The ProjectNumber ID. Must not be null or empty.

settingNameIdString

The SettingName ID. Must not be null or empty.

Returns
TypeDescription
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
NameDescription
unparsedResourceNameUnparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
SettingName

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

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

Parameter
NameDescription
settingNameString

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

Returns
TypeDescription
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, Boolean)

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
NameDescription
settingNameString

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
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
TypeDescription
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
NameDescription
settingNameString

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

resultSettingName

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

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

TryParse(String, Boolean, 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
NameDescription
settingNameString

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.

resultSettingName

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

  • 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

Equality(SettingName, SettingName)

public static bool operator ==(SettingName a, SettingName b)
Parameters
NameDescription
aSettingName
bSettingName
Returns
TypeDescription
Boolean

Inequality(SettingName, SettingName)

public static bool operator !=(SettingName a, SettingName b)
Parameters
NameDescription
aSettingName
bSettingName
Returns
TypeDescription
Boolean