IRPCObjectOperations.SetProperties
Vault API / core write session or assertion returns metadata structure version
Adds, replaces or removes property values of an object.
| Service | Objects, versions, properties and files MFiles.IRPCObjectOperations |
|---|---|
| gRPC method | /MFiles.IRPCObjectOperations/SetProperties |
| HTTP (mf-http-grpc) | POST /grpc/v1/set-properties |
| Request | SetPropertiesRequest |
| Response | SetPropertiesResponse |
| 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
Checked-in objects. With allow_modifying_checked_in_object: true, the server checks the
object out, applies the change and checks it in, creating exactly one new version. Without it, a
checked-in object fails with "The object is not checked out." Every such call creates a new
version, even when the values do not change.
Checked-out objects. If the caller has the object checked out, obj_ver must name the
checked-out version; the change goes to that version and no new version is created. Naming the
checked-in version of an object checked out to the caller fails ("... not the current
checked-out version."), and an object checked out to someone else fails with "The object is
checked out to another user."
Targeting a version. obj_ver must name a version by number: the
OBJ_VER_VERSION_TYPE_LATEST marker fails with "The parameter is incorrect." For a
checked-in object, the server always changes the latest version, whatever number you send (even a
number that does not exist yet), unless fail_if_newer_version_exists is true: then a number other
than the latest checked-in version fails with "There is a newer version of this object on the
server." Use it for optimistic concurrency: read the version, then write with
fail_if_newer_version_exists.
Adding, replacing and removing.
- Values in
propertiesare added or replace the existing value of the same property definition. All other properties stay as they are. - To empty a property, send it with
is_null_value: true(and itstype). removeremoves property values from the object. Properties that the object's class lists cannot be removed, not even optional ones: the call fails with "The property "<name>" cannot be removed from the object." Set them empty instead.remove_unspecified_properties: truemakespropertiesthe full set: every property not in it and not listed by the class is removed. Class-listed properties stay (with their values or empty), as do the properties the server maintains. The full set must still include the Class (100) property, otherwise the call fails with "Class was not specified."; an empty full set fails with invalid argument. Rarely what you want.
Single-file documents. Changing the title of a single-file document with
allow_modifying_checked_in_object also renames its file.
Workflow. Change the workflow state by setting Workflow State (39), a lookup into value list 8,
or by setting State transition (99), a lookup into value list 17 with a transition ID from
GetWorkflowStatesAndTransitions.
A state change that the workflow does not allow fails with "Access denied. The state transition
"<from> -> <to>" is not allowed." If you change Workflow (38), set the state as well:
the server does not clear or replace a state of the previous workflow. A transition that
requires an electronic signature needs signature: the session ID of a second
LogIn of the same user, made less than 15 seconds earlier; the
server logs that session out. See
GetStateTransitionSignatureSettings.
Permissions. The caller needs edit access to the object; the server makes an exception that
lets an assignee mark an assignment complete. allow_missing_required_properties
requires the vault-level right to change the metadata structure and takes effect only if the vault
allows objects with empty required fields.
Use SetPropertiesMultiple to change several objects in one transaction.
Request: SetPropertiesRequest
Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page. Fields marked (recursive) refer to a type already on their path.
| Field | Type | Description |
|---|---|---|
signature | SESSIONID | The session ID of a second LogIn of the same user, made less than 15 seconds before this call, when a workflow state transition requires an electronic signature. Unset otherwise. |
signature.value | bytes | 64-byte session ID in RPC interface. 48 bytes in gRPC interface. |
obj_ver | ObjVer | The version to change, by number: the checked-out version if the caller has the object checked out, otherwise the latest checked-in version. The LATEST marker is not accepted. |
obj_ver.obj_id | ObjID | The object. |
obj_ver.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_ver.obj_id.item_id | ItemID | The ID of the object within its type, in item_id.internal_id. |
obj_ver.version | ObjVerVersion | The version. Usually OBJ_VER_VERSION_TYPE_SPECIFIC with internal_version. |
obj_ver.version.type | ObjVerVersionType | What internal_version means. OBJ_VER_VERSION_TYPE_SPECIFIC for a version number.Values: OBJ_VER_VERSION_TYPE_UNINITIALIZED (0), OBJ_VER_VERSION_TYPE_LATEST (1), OBJ_VER_VERSION_TYPE_ANY (2), OBJ_VER_VERSION_TYPE_ALL (3), OBJ_VER_VERSION_TYPE_SPECIFIC (4), OBJ_VER_VERSION_TYPE_VALUE_LIST_ITEM (6), OBJ_VER_VERSION_TYPE_OBJECT_LEVEL_REFERENCE (7). |
obj_ver.version.internal_version | int32 | The version number, starting from 1, when type is OBJ_VER_VERSION_TYPE_SPECIFIC. The server returns -1 with OBJ_VER_VERSION_TYPE_LATEST. |
obj_ver.version.external_repository_version | string | Used only for objects in external repositories. Leave empty. |
obj_ver.version.external_repository_sort_key | int64 | Used only for objects in external repositories. Leave 0. |
allow_modifying_checked_in_object | bool | True to change a checked-in object: the server checks it out, applies the change and checks it in as one new version. Without it the object must be checked out to the caller. |
allow_missing_required_properties | bool | True to allow the object to lack required properties. Requires the vault-level right to change the metadata structure and a vault setting that allows it. |
fail_if_newer_version_exists | bool | With allow_modifying_checked_in_object, true to fail if obj_ver is not the latest checked-in version. Without it, the change goes to the latest version whatever version you name. |
version_guid | string | Optional version_guid of the version in obj_ver. With fail_if_newer_version_exists, the call also fails if that version has been replaced (for example by replication conflict resolution). Leave empty normally. |
properties[] | repeated PropertyValue | Property values to add or replace. Other properties stay unchanged. |
properties[].property_def | int32 | The property definition ID, for example 0 for "Name or title" or 100 for "Class". |
properties[].value | TypedValue | The value. Its type must match the data type of the property definition. |
properties[].value.is_null_value | bool | True if the value is empty. data is then unset. |
properties[].value.type | Datatype | The data type of the value. |
properties[].value.data | TypedValueUnion | The value, in the member that matches type. Unset for an empty value. |
remove_unspecified_properties | bool | True to treat properties as the full set and remove every other property the class does not list. properties must then include Class (100). Leave false. |
remove[] | repeated int32 | Property definition IDs to remove. Properties listed by the class cannot be removed; set them empty instead. |
object_flags | OBJECTOPFLAGS | Optional extra checks, for example disallow_name_change or require_edit_access_after_operation. |
object_flags.all | bool | Specifies all flags set; Including any future flags. |
object_flags.require_read_access_after_operation | bool | Requires read access to the object after the object operation. If available, the operation fails if the user does not have read access to the object after the operation. |
object_flags.require_edit_access_after_operation | bool | Requires edit access to the object after the object operation. If available, the operation fails if the user does not have edit access to the object after the operation. |
object_flags.disallow_name_change | bool | If specified, the operation will fail if it causes a change in the object version's name. |
object_flags.require_change_permissions_access_after_operation | bool | Requires security change access to the object after the object operation. If available, the operation fails if the user does not have security change access to the object after the operation. |
object_flags.require_full_access_after_operation | bool | Requires full access to the object after the object operation. If available, the operation fails if the user does not have full access to the object after the operation. |
object_flags.change_acl_in_all_versions | bool | Changes the ACL of all versions of the object. This is currently used to request setting the ACL of all versions of an object, not just a specific version, when calling ChangeSecurity. |
object_flags.verify_check_in_wopi_locked_document | bool | Verify the document is locked for WOPI Co-authoring or editing during checkin. |
acl_mode | ACLEnforcingMode | Which ACL the server starts from when it updates the object's permissions. The default, ACLENFORCING_MODE_USE_PREVIOUS, uses the object's current ACL; ACLENFORCING_MODE_USE_PROVIDED uses acl; ACLENFORCING_MODE_RESET_TO_DEFAULT uses the ACL calculated from the properties. ACLENFORCING_MODE_DISALLOW_CHANGES is rejected as invalid argument.Values: ACLENFORCING_MODE_USE_PREVIOUS (0), ACLENFORCING_MODE_USE_PROVIDED (1), ACLENFORCING_MODE_RESET_TO_DEFAULT (2), ACLENFORCING_MODE_DISALLOW_CHANGES (3). |
acl | AccessControlList | The permissions to use with ACLENFORCING_MODE_USE_PROVIDED. Unset otherwise. |
acl.checked_out_to_user | int32 | Specifies the ID of the user who has extended rights because of the checkout operation performed by her. 0 if such user does not exist. |
acl.is_fully_authoritative | bool | Specifies whether this access control list is set to ignore the secondary permissions that come from the latest checked in version. |
acl.custom_component | AccessControlListComponent | Accesses the custom component of this ACL. |
acl.custom_component.named_acl_id | int32 | Specifies the named ACL link of this component. |
acl.custom_component.has_named_acl | bool | True if the component links to a named ACL (named_acl_id). |
acl.custom_component.current_user_id | int32 | Specifies the current user binding of this component. |
acl.custom_component.has_current_user | bool | True if the component has an access control entry for the current user. |
acl.custom_component.permissions[] | repeated AccessControlEntry | The access control entry datas. The data belongs to the key in the corresponding index. |
acl.custom_component.overridability_permissions[] | repeated AccessControlEntry | Overridability permission data of this ACL component. |
acl.custom_component.status | ACCESSCONTROLLISTCOMPONENTSTATUSFLAGS | Modification status of this component. |
acl.restrictive_components[] | repeated AccessControlListComponentMapEntry | Accesses the restrictive automatic components of this ACL. |
acl.restrictive_components[].key | AccessControlListComponentKey | Access control list component. |
acl.restrictive_components[].component | AccessControlListComponent | Access control list component. |
acl.secondary_access_control_list | AccessControlList (recursive) | Secondary ACL used for latest version ACL. Not used for access check if null. |
acl.additive_components[] | repeated AccessControlListComponentMapEntry | Accesses the additive automatic components of this ACL. |
acl.additive_components[].key | AccessControlListComponentKey | Access control list component. |
acl.additive_components[].component | AccessControlListComponent | Access control list component. |
Response: SetPropertiesResponse
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 |
|---|---|---|
object_info | ExtObjectInfo | The object after the change: its latest version with properties and ACL. original_obj_ver echoes the requested version. |
object_info.is_visible | bool | True if any version of the object is visible to the caller. |
object_info.object_info | ObjectLevelInfo | Object-level information, if is_visible is true. |
object_info.object_info.obj_id | ObjID | The object type and ID of the object. |
object_info.object_info.external_id_status | ExtIDStatus | The status of this object's external ID.Values: EXT_IDSTATUS_UNKNOWN (0), EXT_IDSTATUS_EXTERNAL (1), EXT_IDSTATUS_INTERNAL (2), EXT_IDSTATUS_DISCARDED (3), EXT_IDSTATUS_NOT_AVAILABLE (4), EXT_IDSTATUS_EXTERNAL_REDUCED (5). |
object_info.object_info.external_id | string | The external ID (display ID) of this object. unset means that the external ID is the same as the internal ID. |
object_info.object_info.checked_out_version | ObjVerVersion | The version that is checked out. Version number 0 if the object is not checked out. |
object_info.object_info.checked_out_to_user_id | int32 | The ID of the user who has the object checked out. |
object_info.object_info.checked_out_to_user_name | string | The user name of the user who has the object checked out. |
object_info.object_info.checked_out_to_host_name | string | The host name of the computer to which the object was checked out. |
object_info.object_info.checked_out_at_utc | google.protobuf.Timestamp | The timestamp of the moment the object was checked out. |
object_info.object_info.checked_in_version | ObjVerVersion | The latest checked-in version. |
object_info.object_info.created_at_utc | google.protobuf.Timestamp | The time when the object was created (same as the PROPERTYDEF_CREATED propertyvalue). |
object_info.object_info.accessed_by_me_utc | google.protobuf.Timestamp | Accessed by me timestamp. Parallel operations may cause slight inconsistencies in the returned timestamp in rare cases and the precise value shouldn't be relied upon. The observed timestamp may even roll back. |
object_info.object_info.guid | string | The object GUID, in braces. The same value as GetObjectGUID returns. |
object_info.object_info.options | ITEMFLAGS | Bit flags that provide additional information on the object (e.g. is the object deleted or a stub). |
object_info.object_info.original_vault_guid | string | The GUID of the vault in which the object was originally created. |
object_info.object_info.original_vault_obj_id | ObjID | The original objid in the vault in which the object was originally created. |
object_info.object_info.associated_view_id | ItemID | Identifies the view associated with this object if any. |
object_info.object_info.external_repository_icon_id | string | If not null, identifies the icon of the object. Currently applicable only to unmanaged objects. |
object_info.object_info.primary_view_id | ItemID | If not null, identifies the primary view of the object that is also the default opening location of the object. Currently applicable only to unmanaged objects. |
object_info.object_info.capabilities | OBJECTCAPABILITYFLAGS | Bit flags that provide information on the object capabilities. |
object_info.is_latest_version_visible | bool | True if the latest version of the object is visible to the caller. |
object_info.latest_version | ObjectVersionExWP | The latest version of the object with its properties and ACL, if is_latest_version_visible is true. Some methods (for example UndoCheckout) return it without property values. |
object_info.latest_version.object_version | ObjectVersionEx | Object info. |
object_info.latest_version.properties[] | repeated PropertyValue | Property values, or an empty array. |
object_info.latest_version.acl | AccessControlList | If set, ACL. |
object_info.latest_version.current_user_permissions | ObjectPermissionsForClient | If set, permissions of the object version. |
object_info.original_obj_ver | ObjVer | The object version the request named, as sent. The version part may be unset. |
object_info.original_obj_ver.obj_id | ObjID | The object. |
object_info.original_obj_ver.version | ObjVerVersion | The version. Usually OBJ_VER_VERSION_TYPE_SPECIFIC with internal_version. |
updated_objects[] | repeated ObjectVersionEx | Information about objects that were also updated during the operation. (represented by ObjectVersionEx structs.) |
updated_objects[].version_info | ObjectVersion | Object Version information. |
updated_objects[].version_info.version | ObjVerVersion | The version number, as a specific version. |
updated_objects[].version_info.display_version | string | The version label to show, if it differs from the version number; empty otherwise. |
updated_objects[].version_info.title | string | The title (name) of the object in this version. |
updated_objects[].version_info.is_single_file_object | bool | True if the object is a single-file document, which has exactly one file. |
updated_objects[].version_info.has_relationships_from_this | bool | Note: this field is deprecated. True if relationships from this object version to one or more documents exist. |
updated_objects[].version_info.has_relationships_to_this | bool | Note: this field is deprecated. True if relationships from one or more documents to this object version exist. |
updated_objects[].version_info.has_assignments | bool | True if relationships from one or more assignments to this object version exist. |
updated_objects[].version_info.last_modified_at_utc | google.protobuf.Timestamp | When the version was last modified, in UTC. |
updated_objects[].version_info.files[] | repeated File | The files of this version. Each file_ver can be passed to DownloadFile_Begin. |
updated_objects[].version_info.object_version_flags | OBJVERFLAGS | Bit flags that provide additional information on the object version. |
updated_objects[].version_info.class_id | int32 | The class ID of the version. |
updated_objects[].version_info.version_guid | string | The GUID of this version. |
updated_objects[].version_info.base_properties[] | repeated PropertyValue | Not filled by the object read methods; read the property values with GetObjectVersionAndPropertiesOfMultipleObjects or GetProperties. |
updated_objects[].version_info.primary_file | FileID | File ID of the primary file of a multi-file object, if the object is a multi-file object. |
updated_objects[].object_info | ObjectLevelInfo | Object-level information. |
updated_objects[].object_info.obj_id | ObjID | The object type and ID of the object. |
updated_objects[].object_info.external_id_status | ExtIDStatus | The status of this object's external ID.Values: EXT_IDSTATUS_UNKNOWN (0), EXT_IDSTATUS_EXTERNAL (1), EXT_IDSTATUS_INTERNAL (2), EXT_IDSTATUS_DISCARDED (3), EXT_IDSTATUS_NOT_AVAILABLE (4), EXT_IDSTATUS_EXTERNAL_REDUCED (5). |
updated_objects[].object_info.external_id | string | The external ID (display ID) of this object. unset means that the external ID is the same as the internal ID. |
updated_objects[].object_info.checked_out_version | ObjVerVersion | The version that is checked out. Version number 0 if the object is not checked out. |
updated_objects[].object_info.checked_out_to_user_id | int32 | The ID of the user who has the object checked out. |
updated_objects[].object_info.checked_out_to_user_name | string | The user name of the user who has the object checked out. |
updated_objects[].object_info.checked_out_to_host_name | string | The host name of the computer to which the object was checked out. |
updated_objects[].object_info.checked_out_at_utc | google.protobuf.Timestamp | The timestamp of the moment the object was checked out. |
updated_objects[].object_info.checked_in_version | ObjVerVersion | The latest checked-in version. |
updated_objects[].object_info.created_at_utc | google.protobuf.Timestamp | The time when the object was created (same as the PROPERTYDEF_CREATED propertyvalue). |
updated_objects[].object_info.accessed_by_me_utc | google.protobuf.Timestamp | Accessed by me timestamp. Parallel operations may cause slight inconsistencies in the returned timestamp in rare cases and the precise value shouldn't be relied upon. The observed timestamp may even roll back. |
updated_objects[].object_info.guid | string | The object GUID, in braces. The same value as GetObjectGUID returns. |
updated_objects[].object_info.options | ITEMFLAGS | Bit flags that provide additional information on the object (e.g. is the object deleted or a stub). |
updated_objects[].object_info.original_vault_guid | string | The GUID of the vault in which the object was originally created. |
updated_objects[].object_info.original_vault_obj_id | ObjID | The original objid in the vault in which the object was originally created. |
updated_objects[].object_info.associated_view_id | ItemID | Identifies the view associated with this object if any. |
updated_objects[].object_info.external_repository_icon_id | string | If not null, identifies the icon of the object. Currently applicable only to unmanaged objects. |
updated_objects[].object_info.primary_view_id | ItemID | If not null, identifies the primary view of the object that is also the default opening location of the object. Currently applicable only to unmanaged objects. |
updated_objects[].object_info.capabilities | OBJECTCAPABILITYFLAGS | Bit flags that provide information on the object capabilities. |
Related methods
- GetWorkflowStatesAndTransitions -- Gets the states and transitions of the given workflow.
- IRPCLogin.LogIn -- Authenticates the caller and opens a session to a vault, or to the server when the vault GUID is all zeros.
- GetStateTransitionSignatureSettings -- Gets the signature settings for a state transition.
- SetPropertiesMultiple -- If the object is currently checked in, a new checked-in version is created. If the object is currently checked out, the changes are applied to the checked-out version.
- SetPropertiesWithMetadata -- Adds, replaces or removes property values of an object, also storing metadata about each value.
- SetPropertiesWithMetadataAttributedTo -- Sets property values with metadata and records the change as made by a built-in agent user.