• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

53.33
/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBody.java
1
package com.box.sdkgen.managers.metadatatemplates;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.fasterxml.jackson.annotation.JsonFilter;
6
import com.fasterxml.jackson.annotation.JsonProperty;
7
import java.util.List;
8
import java.util.Objects;
9

10
@JsonFilter("nullablePropertyFilter")
11
public class CreateMetadataTemplateRequestBody extends SerializableObject {
12

13
  /**
14
   * The scope of the metadata template to create. Applications can only create templates for use
15
   * within the authenticated user's enterprise.
16
   *
17
   * <p>This value needs to be set to `enterprise`, as `global` scopes can not be created by
18
   * applications.
19
   */
20
  protected final String scope;
21

22
  /**
23
   * A unique identifier for the template. This identifier needs to be unique across the enterprise
24
   * for which the metadata template is being created.
25
   *
26
   * <p>When not provided, the API will create a unique `templateKey` based on the value of the
27
   * `displayName`.
28
   */
29
  protected String templateKey;
30

31
  /** The display name of the template. */
32
  protected final String displayName;
33

34
  /**
35
   * Defines if this template is visible in the Box web app UI, or if it is purely intended for
36
   * usage through the API.
37
   */
38
  protected Boolean hidden;
39

40
  /**
41
   * An ordered list of template fields which are part of the template. Each field can be a regular
42
   * text field, date field, number field, as well as a single or multi-select list.
43
   */
44
  protected List<CreateMetadataTemplateRequestBodyFieldsField> fields;
45

46
  /**
47
   * Whether or not to copy any metadata attached to a file or folder when it is copied. By default,
48
   * metadata is not copied along with a file or folder when it is copied.
49
   */
50
  protected Boolean copyInstanceOnItemCopy;
51

52
  public CreateMetadataTemplateRequestBody(
53
      @JsonProperty("scope") String scope, @JsonProperty("displayName") String displayName) {
54
    super();
×
55
    this.scope = scope;
×
56
    this.displayName = displayName;
×
57
  }
×
58

59
  protected CreateMetadataTemplateRequestBody(Builder builder) {
60
    super();
1✔
61
    this.scope = builder.scope;
1✔
62
    this.templateKey = builder.templateKey;
1✔
63
    this.displayName = builder.displayName;
1✔
64
    this.hidden = builder.hidden;
1✔
65
    this.fields = builder.fields;
1✔
66
    this.copyInstanceOnItemCopy = builder.copyInstanceOnItemCopy;
1✔
67
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
68
  }
1✔
69

70
  public String getScope() {
71
    return scope;
1✔
72
  }
73

74
  public String getTemplateKey() {
75
    return templateKey;
1✔
76
  }
77

78
  public String getDisplayName() {
79
    return displayName;
1✔
80
  }
81

82
  public Boolean getHidden() {
83
    return hidden;
1✔
84
  }
85

86
  public List<CreateMetadataTemplateRequestBodyFieldsField> getFields() {
87
    return fields;
1✔
88
  }
89

90
  public Boolean getCopyInstanceOnItemCopy() {
91
    return copyInstanceOnItemCopy;
1✔
92
  }
93

94
  @Override
95
  public boolean equals(Object o) {
96
    if (this == o) {
×
97
      return true;
×
98
    }
99
    if (o == null || getClass() != o.getClass()) {
×
100
      return false;
×
101
    }
102
    CreateMetadataTemplateRequestBody casted = (CreateMetadataTemplateRequestBody) o;
×
103
    return Objects.equals(scope, casted.scope)
×
104
        && Objects.equals(templateKey, casted.templateKey)
×
105
        && Objects.equals(displayName, casted.displayName)
×
106
        && Objects.equals(hidden, casted.hidden)
×
107
        && Objects.equals(fields, casted.fields)
×
108
        && Objects.equals(copyInstanceOnItemCopy, casted.copyInstanceOnItemCopy);
×
109
  }
110

111
  @Override
112
  public int hashCode() {
113
    return Objects.hash(scope, templateKey, displayName, hidden, fields, copyInstanceOnItemCopy);
×
114
  }
115

116
  @Override
117
  public String toString() {
118
    return "CreateMetadataTemplateRequestBody{"
×
119
        + "scope='"
120
        + scope
121
        + '\''
122
        + ", "
123
        + "templateKey='"
124
        + templateKey
125
        + '\''
126
        + ", "
127
        + "displayName='"
128
        + displayName
129
        + '\''
130
        + ", "
131
        + "hidden='"
132
        + hidden
133
        + '\''
134
        + ", "
135
        + "fields='"
136
        + fields
137
        + '\''
138
        + ", "
139
        + "copyInstanceOnItemCopy='"
140
        + copyInstanceOnItemCopy
141
        + '\''
142
        + "}";
143
  }
144

145
  public static class Builder extends NullableFieldTracker {
146

147
    protected final String scope;
148

149
    protected String templateKey;
150

151
    protected final String displayName;
152

153
    protected Boolean hidden;
154

155
    protected List<CreateMetadataTemplateRequestBodyFieldsField> fields;
156

157
    protected Boolean copyInstanceOnItemCopy;
158

159
    public Builder(String scope, String displayName) {
160
      super();
1✔
161
      this.scope = scope;
1✔
162
      this.displayName = displayName;
1✔
163
    }
1✔
164

165
    public Builder templateKey(String templateKey) {
166
      this.templateKey = templateKey;
1✔
167
      return this;
1✔
168
    }
169

170
    public Builder hidden(Boolean hidden) {
171
      this.hidden = hidden;
×
172
      return this;
×
173
    }
174

175
    public Builder fields(List<CreateMetadataTemplateRequestBodyFieldsField> fields) {
176
      this.fields = fields;
1✔
177
      return this;
1✔
178
    }
179

180
    public Builder copyInstanceOnItemCopy(Boolean copyInstanceOnItemCopy) {
181
      this.copyInstanceOnItemCopy = copyInstanceOnItemCopy;
×
182
      return this;
×
183
    }
184

185
    public CreateMetadataTemplateRequestBody build() {
186
      return new CreateMetadataTemplateRequestBody(this);
1✔
187
    }
188
  }
189
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc