# Class MethodSettings (2.17.0)

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

- [2.17.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings)
- [2.15.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.MethodSettings)
- [2.10.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.MethodSettings)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.MethodSettings)

    public sealed class MethodSettings : IMessage<MethodSettings>, IEquatable<MethodSettings>, IDeepCloneable<MethodSettings>, IBufferMessage, IMessage

Describes the generator configuration for a method.

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[MethodSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[MethodSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[MethodSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)

## Assembly

Google.Api.CommonProtos.dll

## Constructors

### MethodSettings()

    public MethodSettings()

### MethodSettings(MethodSettings)

    public MethodSettings(MethodSettings other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings` |

## Fields

### AutoPopulatedFieldsFieldNumber

    public const int AutoPopulatedFieldsFieldNumber = 3

Field number for the "auto_populated_fields" field.

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

### LongRunningFieldNumber

    public const int LongRunningFieldNumber = 2

Field number for the "long_running" field.

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

### SelectorFieldNumber

    public const int SelectorFieldNumber = 1

Field number for the "selector" field.

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

## Properties

### AutoPopulatedFields

    public RepeatedField<string> AutoPopulatedFields { get; }

List of top-level fields of the request message, that should be
automatically populated by the client libraries based on their
(google.api.field_info).format. Currently supported format: UUID4.

Example of a YAML configuration:

publishing:
method_settings:

- selector: google.example.v1.ExampleService.CreateExample auto_populated_fields:
  - request_id

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### Descriptor

    public static MessageDescriptor Descriptor { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.MessageDescriptor.html` |   |

### LongRunning

    public MethodSettings.Types.LongRunning LongRunning { get; set; }

Describes settings to use for long-running operations when generating
API methods for RPCs. Complements RPCs that use the annotations in
google/longrunning/operations.proto.

Example of a YAML configuration::

publishing:
method_settings:

- selector: google.cloud.speech.v2.Speech.BatchRecognize long_running: initial_poll_delay: 60s # 1 minute poll_delay_multiplier: 1.5 max_poll_delay: 360s # 6 minutes total_poll_timeout: 54000s # 90 minutes

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettingshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings.Types.LongRunning` |   |

### Parser

    public static MessageParser<MethodSettings> Parser { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.MessageParser-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings` |   |

### Selector

    public string Selector { get; set; }

The fully qualified name of the method, for which the options below apply.
This is used to find the method to apply the options.

Example:

publishing:
method_settings:

- selector: google.storage.control.v2.StorageControl.CreateFolder # method settings for CreateFolder...

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

## Methods

### CalculateSize()

    public int CalculateSize()

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

### Clone()

    public MethodSettings Clone()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings` |   |

### Equals(MethodSettings)

    public bool Equals(MethodSettings other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings` |

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

### Equals(object)

    public override bool Equals(object other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://learn.microsoft.com/dotnet/api/system.object` |

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

**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** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

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

### MergeFrom(MethodSettings)

    public void MergeFrom(MethodSettings other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.MethodSettings` |

### MergeFrom(CodedInputStream)

    public void MergeFrom(CodedInputStream input)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.CodedInputStream.html` |

### ToString()

    public override string ToString()

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

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

### WriteTo(CodedOutputStream)

    public void WriteTo(CodedOutputStream output)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `output` | `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.CodedOutputStream.html` |