Recommender V1 Client - Class Operation (1.10.0)

Reference documentation and code samples for the Recommender V1 Client 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.

Generated from protobuf message google.cloud.recommender.v1.Operation

Namespace

Google \ Cloud \ Recommender \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ action string

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

↳ resource_type string

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

↳ resource string

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

↳ path string

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.

↳ source_resource string

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 = and resource_name =

↳ source_path string

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.

↳ value Google\Protobuf\Value

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.

↳ value_matcher Google\Cloud\Recommender\V1\ValueMatcher

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.

↳ path_filters array|Google\Protobuf\Internal\MapField

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.

↳ path_value_matchers array|Google\Protobuf\Internal\MapField

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.

getAction

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

Returns
TypeDescription
string

setAction

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getResourceType

Type of GCP resource being modified/tested. This field is always populated.

Example: cloudresourcemanager.googleapis.com/Project, compute.googleapis.com/Instance

Returns
TypeDescription
string

setResourceType

Type of GCP resource being modified/tested. This field is always populated.

Example: cloudresourcemanager.googleapis.com/Project, compute.googleapis.com/Instance

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getResource

Contains the fully qualified resource name. This field is always populated.

ex: //cloudresourcemanager.googleapis.com/projects/foo.

Returns
TypeDescription
string

setResource

Contains the fully qualified resource name. This field is always populated.

ex: //cloudresourcemanager.googleapis.com/projects/foo.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getPath

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.

Returns
TypeDescription
string

setPath

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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSourceResource

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 = and resource_name =

This field is empty for all other values of action.

Returns
TypeDescription
string

setSourceResource

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 = and resource_name =

This field is empty for all other values of action.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSourcePath

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.

Returns
TypeDescription
string

setSourcePath

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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getValue

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.

Returns
TypeDescription
Google\Protobuf\Value|null

hasValue

setValue

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.

Parameter
NameDescription
var Google\Protobuf\Value
Returns
TypeDescription
$this

getValueMatcher

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.

Returns
TypeDescription
Google\Cloud\Recommender\V1\ValueMatcher|null

hasValueMatcher

setValueMatcher

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.

Parameter
NameDescription
var Google\Cloud\Recommender\V1\ValueMatcher
Returns
TypeDescription
$this

getPathFilters

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: php { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 }
  • Example: php { "/bindings/*/role": "roles/owner" "/bindings/*/condition" : null }
  • Example: php { "/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.
Returns
TypeDescription
Google\Protobuf\Internal\MapField

setPathFilters

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: php { "/versions/*/name" : "it-123" "/versions/*/targetSize/percent": 20 }
  • Example: php { "/bindings/*/role": "roles/owner" "/bindings/*/condition" : null }
  • Example: php { "/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.
Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getPathValueMatchers

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.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setPathValueMatchers

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.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getPathValue

Returns
TypeDescription
string