4.10.0 (latest) 4.8.0 4.4.0 4.3.1 4.2.0 4.0.0 3.2.0

    public sealed class TemplatedResourceName : IResourceName, IEquatable<TemplatedResourceName>

Class for representing and working with resource names.

## Inheritance

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

## Implements

[IResourceName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TemplatedResourceName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.TemplatedResourceName.md.txt)

## Inherited Members

[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)

## Namespace

[Google.Api.Gax](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.md.txt)

## Assembly

Google.Api.Gax.dll

## Remarks


A resource name is represented by a [PathTemplate](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PathTemplate.md.txt), an assignment of resource IDs to parameters in
the template, and an optional service name. This class allows the service name and resource IDs to be
modified, but only within the same template.

## Constructors

### TemplatedResourceName(PathTemplate, params string\[\])

    public TemplatedResourceName(PathTemplate template, params string[] resourceIds)

Creates a resource name with the given template and resource IDs.
The resource IDs are cloned, so later changes to `resourceIds`
are ignored. This constructor does not populate the [ServiceName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.TemplatedResourceName.md.txt#Google_Api_Gax_TemplatedResourceName_ServiceName) property,
but that can be set after construction.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `template` | `PathTemplate` The template for the new resource name. Must not be null. |
| `resourceIds` | `string` The resource IDs to populate template parameters with. Must not be null. |

## Properties

### IsKnownPattern

    public bool IsKnownPattern { get; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### this\[int\]

    public string this[int index] { get; set; }

Gets or sets the identifier for the specified parameter index.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `int` The index of the parameter value to retrieve. |

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` | The identifier within the resource name at the given parameter index. |

### this\[string\]

    public string this[string parameterName] { get; set; }

Gets or sets the identifier for the specified parameter name.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parameterName` | `string` The name of the parameter value to retrieve. |

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` | The identifier within the resource name with the given parameter name. |

### ServiceName

    public string ServiceName { get; set; }

The service name part of this resource name, or null if no service name is specified.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### Template

    public PathTemplate Template { get; }

The template this resource name is associated with. Never null.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `PathTemplate` |   |

## Methods

### Clone()

    public TemplatedResourceName Clone()

Creates a clone of this resource name, which is then independent of the original.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TemplatedResourceName` | A clone of this resource name. |

### Equals(TemplatedResourceName)

    public bool Equals(TemplatedResourceName other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `TemplatedResourceName` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### Equals(object)

    public override bool Equals(object obj)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `obj` | `object` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

**Overrides** [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))

### GetHashCode()

    public override int GetHashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

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

### ToString()

    public override string ToString()

Returns a string representation of this resource name, expanding the template
parameters with the resource IDs and prepending the service name (if present).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | A string representation of this resource name. |

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

## Operators

### operator ==(TemplatedResourceName, TemplatedResourceName)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `a` | `TemplatedResourceName` |
| `b` | `TemplatedResourceName` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### operator !=(TemplatedResourceName, TemplatedResourceName)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `a` | `TemplatedResourceName` |
| `b` | `TemplatedResourceName` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |