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 ApiMetadata

Provides metadata about an API. This is expected to be constructed with a single instance
per API; equality is by simple identity.

## Inheritance

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

## Inherited Members

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

## Namespace

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

## Assembly

Google.Api.Gax.Grpc.dll

## Constructors

### ApiMetadata(string, IEnumerable\<FileDescriptor\>)

    public ApiMetadata(string name, IEnumerable<FileDescriptor> descriptors)

Creates an API descriptor from a sequence of file descriptors.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `string` The name of the API. Must not be null or empty. |
| `descriptors` | `IEnumerableFileDescriptor` The protobuf descriptors of the API. Must not be null. |

**Remarks** The sequence is evaluated once, on construction.

### ApiMetadata(string, Func\<IEnumerable\<FileDescriptor\>\>)

    public ApiMetadata(string name, Func<IEnumerable<FileDescriptor>> descriptorsProvider)

Creates an API descriptor which lazily requests the protobuf descriptors when [ProtobufDescriptors](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiMetadata.md.txt#Google_Api_Gax_Grpc_ApiMetadata_ProtobufDescriptors) is first called.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `string` The name of the API. Must not be null or empty. |
| `descriptorsProvider` | `FuncIEnumerableFileDescriptor` A provider function for the protobuf descriptors of the API. Must not be null, and must not return a null value. This will only be called once by this API descriptor, when first requested. |

## Properties

### HttpRuleOverrides

    public IReadOnlyDictionary<string, ByteString> HttpRuleOverrides { get; }

A dictionary (based on ordinal string comparisons) from fully-qualified RPC names
to byte strings representing overrides for the HTTP rule. This is designed to support
mixins which are hosted at individual APIs, but which are exposed via different URLs
to the original mixin definition. This is never null, but may be empty.

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

### Name

    public string Name { get; }

The name of the API (typically the fully-qualified name of the client library package).
This is never null or empty.

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

### ProtobufDescriptors

    public IReadOnlyList<FileDescriptor> ProtobufDescriptors { get; }

The protobuf descriptors used by this API.

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

### RequestNumericEnumJsonEncoding

    public bool RequestNumericEnumJsonEncoding { get; }

When true, [RestGrpcAdapter](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter.md.txt) will request that enums are encoded as numbers in JSON
rather than as strings, preserving unknown values.

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

### TypeRegistry

    public TypeRegistry TypeRegistry { get; }

A type registry containing all the types in [ProtobufDescriptors](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiMetadata.md.txt#Google_Api_Gax_Grpc_ApiMetadata_ProtobufDescriptors).

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

## Methods

### WithHttpRuleOverrides(IEnumerable\<KeyValuePair\<string, ByteString\>\>)

    public ApiMetadata WithHttpRuleOverrides(IEnumerable<KeyValuePair<string, ByteString>> overrides)

Creates a new instance with the same values as this one, other than the given set of HttpRule overrides.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `overrides` | ``IEnumerableSystem.Collections.Generic.KeyValuePair`2stringByteString`` The HttpRule overrides for services in this package; typically used to override URLs for the REST transport. Must not be null. Will be cloned in the form of an immutable dictionary, after which the original sequence is discarded. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ApiMetadata` | The new instance. |

### WithRequestNumericEnumJsonEncoding(bool)

    public ApiMetadata WithRequestNumericEnumJsonEncoding(bool value)

Returns a new instance based on this one, but with the specified value for [RequestNumericEnumJsonEncoding](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiMetadata.md.txt#Google_Api_Gax_Grpc_ApiMetadata_RequestNumericEnumJsonEncoding).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `bool` The desired value of [RequestNumericEnumJsonEncoding](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ApiMetadata.md.txt#Google_Api_Gax_Grpc_ApiMetadata_RequestNumericEnumJsonEncoding) in the new instance. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ApiMetadata` | The new instance. |