Show / Hide Table of Contents

Class SectionItemName

Resource name for the SectionItem resource.

Inheritance
object
SectionItemName
Implements
IResourceName
IEquatable<SectionItemName>
Inherited Members
object.GetType()
Namespace: Google.Apps.Chat.V1
Assembly: Google.Apps.Chat.V1.dll
Syntax
public sealed class SectionItemName : IResourceName, IEquatable<SectionItemName>

Constructors

SectionItemName(string, string, string)

Constructs a new instance of a SectionItemName class from the component parts of pattern users/{user}/sections/{section}/items/{item}

Declaration
public SectionItemName(string userId, string sectionId, string itemId)
Parameters
Type Name Description
string userId

The User ID. Must not be null or empty.

string sectionId

The Section ID. Must not be null or empty.

string itemId

The Item ID. Must not be null or empty.

Properties

IsKnownPattern

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

Declaration
public bool IsKnownPattern { get; }
Property Value
Type Description
bool
Implements
IResourceName.IsKnownPattern

ItemId

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

Declaration
public string ItemId { get; }
Property Value
Type Description
string

SectionId

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

Declaration
public string SectionId { get; }
Property Value
Type Description
string

Type

The SectionItemName.ResourceNameType of the contained resource name.

Declaration
public SectionItemName.ResourceNameType Type { get; }
Property Value
Type Description
SectionItemName.ResourceNameType

UnparsedResource

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

Declaration
public UnparsedResourceName UnparsedResource { get; }
Property Value
Type Description
UnparsedResourceName

UserId

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

Declaration
public string UserId { get; }
Property Value
Type Description
string

Methods

Format(string, string, string)

Formats the IDs into the string representation of this SectionItemName with pattern users/{user}/sections/{section}/items/{item}.

Declaration
public static string Format(string userId, string sectionId, string itemId)
Parameters
Type Name Description
string userId

The User ID. Must not be null or empty.

string sectionId

The Section ID. Must not be null or empty.

string itemId

The Item ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this SectionItemName with pattern users/{user}/sections/{section}/items/{item}.

FormatUserSectionItem(string, string, string)

Formats the IDs into the string representation of this SectionItemName with pattern users/{user}/sections/{section}/items/{item}.

Declaration
public static string FormatUserSectionItem(string userId, string sectionId, string itemId)
Parameters
Type Name Description
string userId

The User ID. Must not be null or empty.

string sectionId

The Section ID. Must not be null or empty.

string itemId

The Item ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this SectionItemName with pattern users/{user}/sections/{section}/items/{item}.

FromUnparsed(UnparsedResourceName)

Creates a SectionItemName containing an unparsed resource name.

Declaration
public static SectionItemName FromUnparsed(UnparsedResourceName unparsedResourceName)
Parameters
Type Name Description
UnparsedResourceName unparsedResourceName

The unparsed resource name. Must not be null.

Returns
Type Description
SectionItemName

A new instance of SectionItemName containing the provided unparsedResourceName.

FromUserSectionItem(string, string, string)

Creates a SectionItemName with the pattern users/{user}/sections/{section}/items/{item} .

Declaration
public static SectionItemName FromUserSectionItem(string userId, string sectionId, string itemId)
Parameters
Type Name Description
string userId

The User ID. Must not be null or empty.

string sectionId

The Section ID. Must not be null or empty.

string itemId

The Item ID. Must not be null or empty.

Returns
Type Description
SectionItemName

A new instance of SectionItemName constructed from the provided ids.

GetHashCode()

Returns a hash code for this resource name.

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
object.GetHashCode()

Parse(string)

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

Declaration
public static SectionItemName Parse(string sectionItemName)
Parameters
Type Name Description
string sectionItemName

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

Returns
Type Description
SectionItemName

The parsed SectionItemName if successful.

Remarks

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

  • users/{user}/sections/{section}/items/{item}

Parse(string, bool)

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

Declaration
public static SectionItemName Parse(string sectionItemName, bool allowUnparsed)
Parameters
Type Name Description
string sectionItemName

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

bool allowUnparsed

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
SectionItemName

The parsed SectionItemName if successful.

Remarks

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

  • users/{user}/sections/{section}/items/{item}

Or may be in any format if allowUnparsed is true.

ToString()

The string representation of the resource name.

Declaration
public override string ToString()
Returns
Type Description
string

The string representation of the resource name.

Overrides
object.ToString()
Implements
IResourceName.ToString()

TryParse(string, out SectionItemName)

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

Declaration
public static bool TryParse(string sectionItemName, out SectionItemName result)
Parameters
Type Name Description
string sectionItemName

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

SectionItemName result

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

  • users/{user}/sections/{section}/items/{item}

TryParse(string, bool, out SectionItemName)

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

Declaration
public static bool TryParse(string sectionItemName, bool allowUnparsed, out SectionItemName result)
Parameters
Type Name Description
string sectionItemName

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

bool allowUnparsed

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.

SectionItemName result

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

  • users/{user}/sections/{section}/items/{item}

Or may be in any format if allowUnparsed is true.

Operators

operator ==(SectionItemName, SectionItemName)

Determines whether two specified resource names have the same value.

Declaration
public static bool operator ==(SectionItemName a, SectionItemName b)
Parameters
Type Name Description
SectionItemName a

The first resource name to compare, or null.

SectionItemName b

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

Determines whether two specified resource names have different values.

Declaration
public static bool operator !=(SectionItemName a, SectionItemName b)
Parameters
Type Name Description
SectionItemName a

The first resource name to compare, or null.

SectionItemName b

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.

In this article
Back to top Generated by DocFX