# Declarative metadata structure (protobuf) (IRPCDeclarativeMetadataStructureAsProtobuf)

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructureAsProtobuf/

Reads and replaces the whole metadata structure of a vault as one typed message. Preview feature,
off by default; for the declarative configuration converter.

- **gRPC service:** `MFiles.IRPCDeclarativeMetadataStructureAsProtobuf`
- **Book and level:** [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md), specialized
- **Methods:** 4
- **Proto file:** [`mfiles/IRPCDeclarativeMetadataStructureAsProtobuf.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCDeclarativeMetadataStructureAsProtobuf.proto)

<a id="overview"></a>

## Overview

**For M-Files components only.** It is meant for the declarative configuration converter that
is installed with M-Files Server, which reads and deploys the vault's structure through it.
Applications should not call it.

- **Not available by default.** On a server where the declarative metadata structure feature is
  not enabled, every method fails with "Not implemented." (gRPC status `UNKNOWN`, error code
  0x80004001) before any rights check.
  [SetDeclarativeMetadataStructureBeginSessionAsProtobuf](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructureAsProtobuf/SetDeclarativeMetadataStructureBeginSessionAsProtobuf/index.md)
  and
  [SetDeclarativeMetadataStructureEndSessionAsProtobuf](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructureAsProtobuf/SetDeclarativeMetadataStructureEndSessionAsProtobuf/index.md)
  are not implemented even when it is on.
- **Relation to the JSON service.** This service exchanges the structure as a
  [DeclarativeMetadataStructure](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DeclarativeMetadataStructure/index.md) message that uses the
  vault's IDs. [IRPCDeclarativeMetadataStructure](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructure/index.md)
  exchanges the same structure as a declarative JSON document in which elements refer to each
  other by name; the server converts between the two forms. See that service for the format.
- **Session and rights.** Every method requires a vault session and the vault right
  `change_metadata_structure`, reads included.
- Every method sends the `mfiles-metadata-version-bin` trailer when it succeeds.

<a id="methods"></a>

## Methods

| Method | Summary | Facts |
|---|---|---|
| [GetDeclarativeMetadataStructureAsProtobuf](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructureAsProtobuf/GetDeclarativeMetadataStructureAsProtobuf/index.md) | Gets the vault's current metadata structure as one typed message. | `internal: not for applications` `admin` `session` `returns metadata structure version` |
| [SetDeclarativeMetadataStructureAsProtobuf](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructureAsProtobuf/SetDeclarativeMetadataStructureAsProtobuf/index.md) | Replaces the vault's metadata structure with the given structure. | `internal: not for applications` `admin` `session` `returns metadata structure version` |
| [SetDeclarativeMetadataStructureBeginSessionAsProtobuf](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructureAsProtobuf/SetDeclarativeMetadataStructureBeginSessionAsProtobuf/index.md) | Reserved for setting a structure in several parts. Not implemented. | `internal: not for applications` `admin` `session` `returns metadata structure version` |
| [SetDeclarativeMetadataStructureEndSessionAsProtobuf](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDeclarativeMetadataStructureAsProtobuf/SetDeclarativeMetadataStructureEndSessionAsProtobuf/index.md) | Reserved for setting a structure in several parts. Not implemented. | `internal: not for applications` `admin` `session` `returns metadata structure version` |
