public sealed class DeviceSessionName : IResourceName, IEquatable<DeviceSessionName>Reference documentation and code samples for the Device Streaming v1 API class DeviceSessionName.
Resource name for the DeviceSession resource.
Namespace
Google.Cloud.DeviceStreaming.V1Assembly
Google.Cloud.DeviceStreaming.V1.dll
Constructors
DeviceSessionName(string, string)
public DeviceSessionName(string projectId, string deviceSessionId)Constructs a new instance of a DeviceSessionName class from the component parts of pattern
projects/{project}/deviceSessions/{device_session}
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
deviceSessionId |
stringThe |
Properties
DeviceSessionId
public string DeviceSessionId { get; }The DeviceSession 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 |
|
ProjectId
public string ProjectId { get; }The Project ID. Will not be null, unless this instance contains an unparsed resource name.
| Property Value | |
|---|---|
| Type | Description |
string |
|
Type
public DeviceSessionName.ResourceNameType Type { get; }The DeviceSessionName.ResourceNameType of the contained resource name.
| Property Value | |
|---|---|
| Type | Description |
DeviceSessionNameResourceNameType |
|
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 projectId, string deviceSessionId)Formats the IDs into the string representation of this DeviceSessionName with pattern
projects/{project}/deviceSessions/{device_session}.
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
deviceSessionId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
string |
The string representation of this DeviceSessionName with pattern
|
FormatProjectDeviceSession(string, string)
public static string FormatProjectDeviceSession(string projectId, string deviceSessionId)Formats the IDs into the string representation of this DeviceSessionName with pattern
projects/{project}/deviceSessions/{device_session}.
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
deviceSessionId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
string |
The string representation of this DeviceSessionName with pattern
|
FromProjectDeviceSession(string, string)
public static DeviceSessionName FromProjectDeviceSession(string projectId, string deviceSessionId)Creates a DeviceSessionName with the pattern
projects/{project}/deviceSessions/{device_session}.
| Parameters | |
|---|---|
| Name | Description |
projectId |
stringThe |
deviceSessionId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
DeviceSessionName |
A new instance of DeviceSessionName constructed from the provided ids. |
FromUnparsed(UnparsedResourceName)
public static DeviceSessionName FromUnparsed(UnparsedResourceName unparsedResourceName)Creates a DeviceSessionName containing an unparsed resource name.
| Parameter | |
|---|---|
| Name | Description |
unparsedResourceName |
UnparsedResourceNameThe unparsed resource name. Must not be |
| Returns | |
|---|---|
| Type | Description |
DeviceSessionName |
A new instance of DeviceSessionName containing the provided
|
GetHashCode()
public override int GetHashCode()Returns a hash code for this resource name.
| Returns | |
|---|---|
| Type | Description |
int |
|
Parse(string)
public static DeviceSessionName Parse(string deviceSessionName)Parses the given resource name string into a new DeviceSessionName instance.
| Parameter | |
|---|---|
| Name | Description |
deviceSessionName |
stringThe resource name in string form. Must not be |
| Returns | |
|---|---|
| Type | Description |
DeviceSessionName |
The parsed DeviceSessionName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/deviceSessions/{device_session}
Parse(string, bool)
public static DeviceSessionName Parse(string deviceSessionName, bool allowUnparsed)Parses the given resource name string into a new DeviceSessionName instance; optionally allowing an unparseable resource name.
| Parameters | |
|---|---|
| Name | Description |
deviceSessionName |
stringThe resource name in string form. Must not be |
allowUnparsed |
boolIf |
| Returns | |
|---|---|
| Type | Description |
DeviceSessionName |
The parsed DeviceSessionName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/deviceSessions/{device_session}
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. |
TryParse(string, out DeviceSessionName)
public static bool TryParse(string deviceSessionName, out DeviceSessionName result)Tries to parse the given resource name string into a new DeviceSessionName instance.
| Parameters | |
|---|---|
| Name | Description |
deviceSessionName |
stringThe resource name in string form. Must not be |
result |
DeviceSessionNameWhen this method returns, the parsed DeviceSessionName, or |
| Returns | |
|---|---|
| Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/deviceSessions/{device_session}
TryParse(string, bool, out DeviceSessionName)
public static bool TryParse(string deviceSessionName, bool allowUnparsed, out DeviceSessionName result)Tries to parse the given resource name string into a new DeviceSessionName instance; optionally allowing an unparseable resource name.
| Parameters | |
|---|---|
| Name | Description |
deviceSessionName |
stringThe resource name in string form. Must not be |
allowUnparsed |
boolIf |
result |
DeviceSessionNameWhen this method returns, the parsed DeviceSessionName, or |
| Returns | |
|---|---|
| Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/deviceSessions/{device_session}
allowUnparsed is true.
Operators
operator ==(DeviceSessionName, DeviceSessionName)
public static bool operator ==(DeviceSessionName a, DeviceSessionName b)Determines whether two specified resource names have the same value.
| Parameters | |
|---|---|
| Name | Description |
a |
DeviceSessionNameThe first resource name to compare, or null. |
b |
DeviceSessionNameThe second resource name to compare, or null. |
| Returns | |
|---|---|
| Type | Description |
bool |
true if the value of |
operator !=(DeviceSessionName, DeviceSessionName)
public static bool operator !=(DeviceSessionName a, DeviceSessionName b)Determines whether two specified resource names have different values.
| Parameters | |
|---|---|
| Name | Description |
a |
DeviceSessionNameThe first resource name to compare, or null. |
b |
DeviceSessionNameThe second resource name to compare, or null. |
| Returns | |
|---|---|
| Type | Description |
bool |
true if the value of |