Field.cs
2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using Contentful.Core.Models.Management;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Contentful.Core.Models
{
/// <summary>
/// Represents a field in a <seealso cref="ContentType"/>. Note that this is not the representation of a field with
/// actual value in an <seealso cref="Entry{T}"/> or <seealso cref="Asset"/>, but merely a representation of the fields data structure.
/// </summary>
public class Field
{
/// <summary>
/// The ID of the field. It must be unique among all fields of the <seealso cref="ContentType"/>.
/// </summary>
public string Id { get; set; }
/// <summary>
/// The name of the field. This will be the label of the field in the Contentful web app.
/// </summary>
public string Name { get; set; }
/// <summary>
/// The type of field. Determines what type of data can be stored in the field.
/// </summary>
public string Type { get; set; }
/// <summary>
/// Whether this field is mandatory or not.
/// </summary>
public bool Required { get; set; }
/// <summary>
/// Whether this field supports different values for different locales.
/// </summary>
public bool Localized { get; set; }
/// <summary>
/// The type of link, if any. Normally Asset or Entry.
/// </summary>
public string LinkType { get; set; }
/// <summary>
/// Whether this field is disabled. Disabled fields are not visible in the Contentful web app.
/// </summary>
public bool Disabled { get; set; }
/// <summary>
/// Whether this field is omitted in the response from the Content Delivery and Preview APIs.
/// </summary>
public bool Omitted { get; set; }
/// <summary>
/// Defines a schema for the elements of an array field. Will be null for other types.
/// </summary>
public Schema Items { get; set; }
/// <summary>
/// The validations that should be applied to the field.
/// </summary>
public List<IFieldValidator> Validations { get; set; }
}
}