# AssociatedPropertyDef

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

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

A PropertyDef that is associated with a class.

- **Full name:** `MFiles.AssociatedPropertyDef`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-property_def"></a>`property_def` | `int32` | 1 | The ID of the property definition. |
| <a id="f-is_required"></a>`is_required` | `bool` | 2 | True if objects of the class must have a value for this property. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCPropertyDefsAdmin.AddObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/AddObjectClass/index.md): Creates a class with its property associations.
- [IRPCPropertyDefsAdmin.GetAssociatedPropertyDefs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/GetAssociatedPropertyDefs/index.md): Gets the properties of a class: the property definitions associated with it and whether each is required.
- [IRPCPropertyDefsAdmin.ModifyObjectClass](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/ModifyObjectClass/index.md): Saves a changed class and, optionally, its property associations.

<a id="used-in-fields"></a>

## Used in fields

- [`ObjectClass.associated_property_defs`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectClass/index.md#f-associated_property_defs): The properties of objects of this class, each with `is_required`. Lists only property definitions the caller can see, and includes the built-in properties that every object has (such as 20 Created and 25 Created by).
- [`ObjectClassDecl.associated_property_defs`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectClassDecl/index.md#f-associated_property_defs): PropertyDefs associated with this class.
- [`GetAssociatedPropertyDefsResponse.values`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/GetAssociatedPropertyDefs/index.md#response): One [AssociatedPropertyDef](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AssociatedPropertyDef/index.md) per property of the class.
- [`AddObjectClassRequest.property_defs`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/AddObjectClass/index.md#request): The properties of the class and whether each is required.
- [`ModifyObjectClassRequest.property_defs`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCPropertyDefsAdmin/ModifyObjectClass/index.md#request): The new property associations. Ignored when `modify_associations` is false.
