IRPCObjectOperations.CountObjectVersionsMatchingConditions
Vault API / core write session or assertion returns metadata structure version
Counts the versions of an object that DestroyObjectVersionsByConditions would destroy with the same inputs, without destroying anything.
| Service | Objects, versions, properties and files MFiles.IRPCObjectOperations |
|---|---|
| gRPC method | /MFiles.IRPCObjectOperations/CountObjectVersionsMatchingConditions |
| HTTP (mf-http-grpc) | POST /grpc/v1/count-object-versions-matching-conditions |
| Request | CountObjectVersionsMatchingConditionsRequest |
| Response | CountObjectVersionsMatchingConditionsResponse |
| Book and level | Vault API, core |
| Kind | write |
| Session | Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata). |
| Idempotent | no |
| Returns metadata structure version | yes (in the mfiles-metadata-version-bin trailer) |
| Streaming | none (unary) |
Remarks
Uses the same selection and the same rules for kept versions as DestroyObjectVersionsByConditions. Requires the vault-level right to destroy objects.
Request: CountObjectVersionsMatchingConditionsRequest
The request of CountObjectVersionsMatchingConditions. It has the same fields as DestroyObjectVersionsByConditionsRequest.
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
obj_id | ObjID | The object whose versions are counted. |
obj_id.type | int32 | The object type ID, for example 0 for documents. In a lookup value, the value list ID (for a lookup to objects, the object type ID). |
obj_id.item_id | ItemID | The ID of the object within its type, in item_id.internal_id. |
obj_id.item_id.internal_id | int32 | The ID of the object or value list item. |
obj_id.item_id.external_repository_id | ExternalRepositoryID | Used only for objects in external repositories (external connectors). Leave it unset for objects stored in the vault. |
conditions[] | repeated SearchCondition | The conditions a version must match to be destroyed. Must not be empty. |
conditions[].expression | Expression | The left side of the condition: what is evaluated for each object, such as a property value, a status value or any field (full-text search). |
conditions[].expression.type | ExpressionType | The kind of expression. Must match the member set in data.Values: EXPRESSION_TYPE_UNINITIALIZED (0), EXPRESSION_TYPE_PROPERTY_VALUE (1), EXPRESSION_TYPE_ID_SEGMENT (2), EXPRESSION_TYPE_STATUS_VALUE (3), EXPRESSION_TYPE_FILE_VALUE (4), EXPRESSION_TYPE_TYPED_VALUE (5), EXPRESSION_TYPE_ANY_FIELD (6), EXPRESSION_TYPE_PERMISSIONS (7). |
conditions[].expression.data | ExpressionUnion | The expression data. Set the member that matches type. |
conditions[].expression.indirection_levels[] | repeated IndirectionLevel | The lookups to follow before evaluating the expression, from the searched object outwards. Empty evaluates the expression on the object itself. |
conditions[].type | ConditionType | The comparison operator. |
conditions[].value | TypedValue | The right side of the condition: the value to compare with. Its data type must suit the expression, for example a lookup for a lookup property, Boolean for STATUS_TYPE_IS_DELETED. |
conditions[].value.is_null_value | bool | True if the value is empty. data is then unset. |
conditions[].value.type | Datatype | The data type of the value. |
conditions[].value.data | TypedValueUnion | The value, in the member that matches type. Unset for an empty value. |
Response: CountObjectVersionsMatchingConditionsResponse
The response of CountObjectVersionsMatchingConditions: the number of versions that DestroyObjectVersionsByConditions would destroy with the same inputs. Nothing is destroyed.
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.
| Field | Type | Description |
|---|---|---|
matching_version_count | int32 | The number of versions that would be destroyed. |
Related methods
- DestroyObjectVersionsByConditions -- Destroys the old versions of an object that match search conditions, and returns how many were destroyed.