# Google Cloud Recommender v1 API - Class Operation (3.9.0)

3.9.0 (latest) 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.8.0 2.7.0 2.6.0 2.5.0

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

Reference documentation and code samples for the Google Cloud Recommender v1 API class Operation.

Contains an operation for a resource loosely based on the JSON-PATCH format
with support for:

- Custom filters for describing partial array patch.
- Extended path values for describing nested arrays.
- Custom fields for describing the resource for which the operation is being described.
- Allows extension to custom operations not natively supported by RFC6902. See <https://tools.ietf.org/html/rfc6902> for details on the original RFC.

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Operation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1.Operation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Operation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1.Operation), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Operation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1.Operation), [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.Recommender.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1)

## Assembly

Google.Cloud.Recommender.V1.dll

## Constructors

### Operation()

    public Operation()

### Operation(Operation)

    public Operation(Operation other)

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

## Properties

### Action

    public string Action { get; set; }

Type of this operation. Contains one of 'add', 'remove', 'replace', 'move',
'copy', 'test' and custom operations. This field is case-insensitive and
always populated.

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

### Path

    public string Path { get; set; }

Path to the target field being operated on. If the operation is at the
resource level, then path should be "/". This field is always populated.

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

### PathFilters

    public MapField<string, Value> PathFilters { get; }

Set of filters to apply if `path` refers to array elements or nested array
elements in order to narrow down to a single unique element that is being
tested/modified.
This is intended to be an exact match per filter. To perform advanced
matching, use path_value_matchers.

- Example: `{
  "/versions/*/name" : "it-123"
  "/versions/*/targetSize/percent": 20
  }`
- Example: `{
  "/bindings/*/role": "roles/owner"
  "/bindings/*/condition" : null
  }`
- Example: `{
  "/bindings/*/role": "roles/owner"
  "/bindings/*/members/*" : ["x@example.com", "y@example.com"]
  }` When both path_filters and path_value_matchers are set, an implicit AND must be performed.

| **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://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Value.html` |   |

### PathValueCase

    public Operation.PathValueOneofCase PathValueCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1.Operationhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1.Operation.PathValueOneofCase` |   |

### PathValueMatchers

    public MapField<string, ValueMatcher> PathValueMatchers { get; }

Similar to path_filters, this contains set of filters to apply if `path`
field refers to array elements. This is meant to support value matching
beyond exact match. To perform exact match, use path_filters.
When both path_filters and path_value_matchers are set, an implicit AND
must be performed.

| **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://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1.ValueMatcher` |   |

### Resource

    public string Resource { get; set; }

Contains the fully qualified resource name. This field is always populated.
ex: //cloudresourcemanager.googleapis.com/projects/foo.

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

### ResourceType

    public string ResourceType { get; set; }

Type of GCP resource being modified/tested. This field is always populated.
Example: cloudresourcemanager.googleapis.com/Project,
compute.googleapis.com/Instance

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

### SourcePath

    public string SourcePath { get; set; }

Can be set with action 'copy' or 'move' to indicate the source field within
resource or source_resource, ignored if provided for other operation types.

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

### SourceResource

    public string SourceResource { get; set; }

Can be set with action 'copy' to copy resource configuration across
different resources of the same type. Example: A resource clone can be
done via action = 'copy', path = "/", from = "/",
source_resource = \<source\> and resource_name = \<target\>.
This field is empty for all other values of `action`.

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

### Value

    public Value Value { get; set; }

Value for the `path` field. Will be set for actions:'add'/'replace'.
Maybe set for action: 'test'. Either this or `value_matcher` will be set
for 'test' operation. An exact match must be performed.

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

### ValueMatcher

    public ValueMatcher ValueMatcher { get; set; }

Can be set for action 'test' for advanced matching for the value of
'path' field. Either this or `value` will be set for 'test' operation.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Recommender.V1/latest/Google.Cloud.Recommender.V1.ValueMatcher` |   |