# Service Control v1 API - Class QuotaOperation (2.5.0)

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

- [2.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.4.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.3.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.2.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.1.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.0.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.4.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.3.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.2.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.1.0/Google.Cloud.ServiceControl.V1.QuotaOperation)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.0.0/Google.Cloud.ServiceControl.V1.QuotaOperation)

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

Reference documentation and code samples for the Service Control v1 API class QuotaOperation.

Represents information regarding a quota operation.

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[QuotaOperation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[QuotaOperation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperation), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[QuotaOperation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperation), [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.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

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

## Assembly

Google.Cloud.ServiceControl.V1.dll

## Constructors

### QuotaOperation()

    public QuotaOperation()

### QuotaOperation(QuotaOperation)

    public QuotaOperation(QuotaOperation other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperation` |

## Properties

### ConsumerId

    public string ConsumerId { get; set; }

Identity of the consumer for whom this quota operation is being performed.

This can be in one of the following formats:
project:\<project_id\>,
project_number:\<project_number\>,
api_key:\<api_key\>.

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

### Labels

    public MapField<string, string> Labels { get; }

Labels describing the operation.

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

### MethodName

    public string MethodName { get; set; }

Fully qualified name of the API method for which this quota operation is
requested. This name is used for matching quota rules or metric rules and
billing status rules defined in service configuration.

This field should not be set if any of the following is true:
(1) the quota operation is performed on non-API resources.
(2) quota_metrics is set because the caller is doing quota override.

Example of an RPC method name:
google.example.library.v1.LibraryService.CreateShelf

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

### OperationId

    public string OperationId { get; set; }

Identity of the operation. This is expected to be unique within the scope
of the service that generated the operation, and guarantees idempotency in
case of retries.

In order to ensure best performance and latency in the Quota backends,
operation_ids are optimally associated with time, so that related
operations can be accessed fast in storage. For this reason, the
recommended token for services that intend to operate at a high QPS is
Unix time in nanos + UUID

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

### QuotaMetrics

    public RepeatedField<MetricValueSet> QuotaMetrics { get; }

Represents information about this operation. Each MetricValueSet
corresponds to a metric defined in the service configuration.
The data type used in the MetricValueSet must agree with
the data type specified in the metric definition.

Within a single operation, it is not allowed to have more than one
MetricValue instances that have the same metric names and identical
label value combinations. If a request has such duplicated MetricValue
instances, the entire request is rejected with
an invalid argument error.

This field is mutually exclusive with method_name.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValueSet` |   |

### QuotaMode

    public QuotaOperation.Types.QuotaMode QuotaMode { get; set; }

Quota mode for this operation.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperationhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperation.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.QuotaOperation.Types.QuotaMode` |   |