# Data QnA v1alpha API - Class QuestionName (2.0.0-alpha02)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-alpha02 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName)
- [2.0.0-alpha01](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/2.0.0-alpha01/Google.Cloud.DataQnA.V1Alpha.QuestionName)
- [1.0.0-alpha03](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/1.0.0-alpha03/Google.Cloud.DataQnA.V1Alpha.QuestionName)

    public sealed class QuestionName : IResourceName, IEquatable<QuestionName>

Reference documentation and code samples for the Data QnA v1alpha API class QuestionName.

Resource name for the `Question` resource.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> QuestionName

## Implements

[IResourceName](https://github.com/googleapis/gax-dotnet/blob/510f63bbae727cfa4cee5180d0a9916bc2dee248/Google.Api.Gax/IResourceName.cs), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName)

## Inherited Members

[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)

## Namespace

[Google.Cloud.DataQnA.V1Alpha](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha)

## Assembly

Google.Cloud.DataQnA.V1Alpha.dll

## Constructors

### QuestionName(string, string, string)

    public QuestionName(string projectId, string locationId, string questionId)

Constructs a new instance of a [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) class from the component parts of pattern
`projects/{project}/locations/{location}/questions/{question}`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Project` ID. Must not be `null` or empty. |
| `locationId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Location` ID. Must not be `null` or empty. |
| `questionId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Question` ID. Must not be `null` or empty. |

## Properties

### IsKnownPattern

    public bool IsKnownPattern { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### LocationId

    public string LocationId { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ProjectId

    public string ProjectId { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### QuestionId

    public string QuestionId { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Type

    public QuestionName.ResourceNameType Type { get; }

The [QuestionName.ResourceNameType](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName.ResourceNameType) of the contained resource name.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionNamehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName.ResourceNameType` |   |

### UnparsedResource

    public UnparsedResourceName UnparsedResource { get; }

The contained [UnparsedResourceName](https://github.com/googleapis/gax-dotnet/blob/510f63bbae727cfa4cee5180d0a9916bc2dee248/Google.Api.Gax/UnparsedResourceName.cs). Only non-`null` if this instance contains an
unparsed resource name.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://github.com/googleapis/gax-dotnet/blob/510f63bbae727cfa4cee5180d0a9916bc2dee248/Google.Api.Gax/UnparsedResourceName.cs` |   |

## Methods

### Format(string, string, string)

    public static string Format(string projectId, string locationId, string questionId)

Formats the IDs into the string representation of this [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) with pattern
`projects/{project}/locations/{location}/questions/{question}`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Project` ID. Must not be `null` or empty. |
| `locationId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Location` ID. Must not be `null` or empty. |
| `questionId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Question` ID. Must not be `null` or empty. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` | The string representation of this [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) with pattern `projects/{project}/locations/{location}/questions/{question}`. |

### FormatProjectLocationQuestion(string, string, string)

    public static string FormatProjectLocationQuestion(string projectId, string locationId, string questionId)

Formats the IDs into the string representation of this [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) with pattern
`projects/{project}/locations/{location}/questions/{question}`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Project` ID. Must not be `null` or empty. |
| `locationId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Location` ID. Must not be `null` or empty. |
| `questionId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Question` ID. Must not be `null` or empty. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` | The string representation of this [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) with pattern `projects/{project}/locations/{location}/questions/{question}`. |

### FromProjectLocationQuestion(string, string, string)

    public static QuestionName FromProjectLocationQuestion(string projectId, string locationId, string questionId)

Creates a [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) with the pattern
`projects/{project}/locations/{location}/questions/{question}`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Project` ID. Must not be `null` or empty. |
| `locationId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Location` ID. Must not be `null` or empty. |
| `questionId` | `https://learn.microsoft.com/dotnet/api/system.string` The `Question` ID. Must not be `null` or empty. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` | A new instance of [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) constructed from the provided ids. |

### FromUnparsed(UnparsedResourceName)

    public static QuestionName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) containing an unparsed resource name.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `unparsedResourceName` | `https://github.com/googleapis/gax-dotnet/blob/510f63bbae727cfa4cee5180d0a9916bc2dee248/Google.Api.Gax/UnparsedResourceName.cs` The unparsed resource name. Must not be `null`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` | A new instance of [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) containing the provided `unparsedResourceName` . |

### GetHashCode()

    public override int GetHashCode()

Returns a hash code for this resource name.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

**Overrides** [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)

### Parse(string)

    public static QuestionName Parse(string questionName)

Parses the given resource name string into a new [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `questionName` | `https://learn.microsoft.com/dotnet/api/system.string` The resource name in string form. Must not be `null`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` | The parsed [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) if successful. |

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

- `projects/{project}/locations/{location}/questions/{question}`

<br />

### Parse(string, bool)

    public static QuestionName Parse(string questionName, bool allowUnparsed)

Parses the given resource name string into a new [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) instance; optionally allowing an
unparseable resource name.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `questionName` | `https://learn.microsoft.com/dotnet/api/system.string` The resource name in string form. Must not be `null`. |
| `allowUnparsed` | `https://learn.microsoft.com/dotnet/api/system.boolean` If `true` will successfully store an unparseable resource name into the [UnparsedResource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName#Google_Cloud_DataQnA_V1Alpha_QuestionName_UnparsedResource) property; otherwise will throw an [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) if an unparseable resource name is specified. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` | The parsed [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) if successful. |

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

- `projects/{project}/locations/{location}/questions/{question}`

Or may be in any format if `allowUnparsed` is `true`.

<br />

### ToString()

    public override string ToString()

The string representation of the resource name.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` | The string representation of the resource name. |

**Overrides** [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

### TryParse(string, out QuestionName)

    public static bool TryParse(string questionName, out QuestionName result)

Tries to parse the given resource name string into a new [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) instance.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `questionName` | `https://learn.microsoft.com/dotnet/api/system.string` The resource name in string form. Must not be `null`. |
| `result` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` When this method returns, the parsed [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName), or `null` if parsing failed. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.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}/locations/{location}/questions/{question}`

<br />

### TryParse(string, bool, out QuestionName)

    public static bool TryParse(string questionName, bool allowUnparsed, out QuestionName result)

Tries to parse the given resource name string into a new [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName) instance; optionally
allowing an unparseable resource name.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `questionName` | `https://learn.microsoft.com/dotnet/api/system.string` The resource name in string form. Must not be `null`. |
| `allowUnparsed` | `https://learn.microsoft.com/dotnet/api/system.boolean` If `true` will successfully store an unparseable resource name into the [UnparsedResource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName#Google_Cloud_DataQnA_V1Alpha_QuestionName_UnparsedResource) property; otherwise will throw an [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) if an unparseable resource name is specified. |
| `result` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` When this method returns, the parsed [QuestionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName), or `null` if parsing failed. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.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}/locations/{location}/questions/{question}`

Or may be in any format if `allowUnparsed` is `true`.

<br />

## Operators

### operator ==(QuestionName, QuestionName)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `a` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` |
| `b` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### operator !=(QuestionName, QuestionName)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `a` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` |
| `b` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.QuestionName` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |