Skip to content

Commit f6a3201

Browse files
Add dropdown options to template responses (#560)
1 parent 52f962e commit f6a3201

21 files changed

Lines changed: 254 additions & 12 deletions

openapi-fern.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28363,6 +28363,11 @@ components:
2836328363
description: 'The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.'
2836428364
type: string
2836528365
nullable: true
28366+
options:
28367+
description: The options available for this dropdown form field.
28368+
type: array
28369+
items:
28370+
type: string
2836628371
type: object
2836728372
TemplateResponseDocumentFormFieldHyperlink:
2836828373
description: This class extends `TemplateResponseDocumentFormFieldBase`

openapi-raw.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12664,6 +12664,11 @@ components:
1266412664
description: '_t__TemplateResponseDocumentFormField::GROUP'
1266512665
type: string
1266612666
nullable: true
12667+
options:
12668+
description: '_t__TemplateResponseDocumentFormField::OPTIONS'
12669+
type: array
12670+
items:
12671+
type: string
1266712672
type: object
1266812673
TemplateResponseDocumentFormFieldHyperlink:
1266912674
description: '_t__TemplateResponseDocumentFormField::DESCRIPTION_EXTENDS'

openapi-sdk.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13106,6 +13106,11 @@ components:
1310613106
description: 'The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.'
1310713107
type: string
1310813108
nullable: true
13109+
options:
13110+
description: 'The options available for this dropdown form field.'
13111+
type: array
13112+
items:
13113+
type: string
1310913114
type: object
1311013115
TemplateResponseDocumentFormFieldHyperlink:
1311113116
description: 'This class extends `TemplateResponseDocumentFormFieldBase`'

openapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13092,6 +13092,11 @@ components:
1309213092
description: 'The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.'
1309313093
type: string
1309413094
nullable: true
13095+
options:
13096+
description: 'The options available for this dropdown form field.'
13097+
type: array
13098+
items:
13099+
type: string
1309513100
type: object
1309613101
TemplateResponseDocumentFormFieldHyperlink:
1309713102
description: 'This class extends `TemplateResponseDocumentFormFieldBase`'

sdks/dotnet/docs/TemplateResponseDocumentFormFieldDropdown.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Name | Type | Description | Notes
1313
**Width** | **int** | The width in pixels of this form field. | [optional]
1414
**Height** | **int** | The height in pixels of this form field. | [optional]
1515
**Required** | **bool** | Boolean showing whether or not this field is required. | [optional]
16-
**Type** | **string** | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "dropdown"]**Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | [optional]
16+
**Type** | **string** | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "dropdown"]**Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | [optional] **Options** | **List&lt;string&gt;** | The options available for this dropdown form field. | [optional]
1717

1818
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1919

sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected TemplateResponseDocumentFormFieldDropdown() { }
4343
/// </summary>
4444
/// <param name="type">The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses &#x60;TemplateResponseDocumentFormFieldText&#x60; * Dropdown Field uses &#x60;TemplateResponseDocumentFormFieldDropdown&#x60; * Hyperlink Field uses &#x60;TemplateResponseDocumentFormFieldHyperlink&#x60; * Checkbox Field uses &#x60;TemplateResponseDocumentFormFieldCheckbox&#x60; * Radio Field uses &#x60;TemplateResponseDocumentFormFieldRadio&#x60; * Signature Field uses &#x60;TemplateResponseDocumentFormFieldSignature&#x60; * Date Signed Field uses &#x60;TemplateResponseDocumentFormFieldDateSigned&#x60; * Initials Field uses &#x60;TemplateResponseDocumentFormFieldInitials&#x60; (required) (default to &quot;dropdown&quot;).</param>
4545
/// <param name="group">The name of the group this field is in. If this field is not a group, this defaults to &#x60;null&#x60; except for Radio fields..</param>
46+
/// <param name="options">The options available for this dropdown form field..</param>
4647
/// <param name="apiId">A unique id for the form field..</param>
4748
/// <param name="name">The name of the form field..</param>
4849
/// <param name="signer">The signer of the Form Field..</param>
@@ -51,7 +52,7 @@ protected TemplateResponseDocumentFormFieldDropdown() { }
5152
/// <param name="width">The width in pixels of this form field..</param>
5253
/// <param name="height">The height in pixels of this form field..</param>
5354
/// <param name="required">Boolean showing whether or not this field is required..</param>
54-
public TemplateResponseDocumentFormFieldDropdown(string type = @"dropdown", string group = default(string), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool))
55+
public TemplateResponseDocumentFormFieldDropdown(string type = @"dropdown", string group = default(string), List<string> options = default(List<string>), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool))
5556
{
5657
this.ApiId = apiId;
5758
this.Name = name;
@@ -69,6 +70,7 @@ protected TemplateResponseDocumentFormFieldDropdown() { }
6970
}
7071
this.Type = type;
7172
this.Group = group;
73+
this.Options = options;
7274
}
7375

7476
/// <summary>
@@ -101,6 +103,13 @@ public static TemplateResponseDocumentFormFieldDropdown Init(string jsonData)
101103
[DataMember(Name = "group", EmitDefaultValue = true)]
102104
public string Group { get; set; }
103105

106+
/// <summary>
107+
/// The options available for this dropdown form field.
108+
/// </summary>
109+
/// <value>The options available for this dropdown form field.</value>
110+
[DataMember(Name = "options", EmitDefaultValue = true)]
111+
public List<string> Options { get; set; }
112+
104113
/// <summary>
105114
/// Returns the string presentation of the object
106115
/// </summary>
@@ -112,6 +121,7 @@ public override string ToString()
112121
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
113122
sb.Append(" Type: ").Append(Type).Append("\n");
114123
sb.Append(" Group: ").Append(Group).Append("\n");
124+
sb.Append(" Options: ").Append(Options).Append("\n");
115125
sb.Append("}\n");
116126
return sb.ToString();
117127
}
@@ -156,6 +166,12 @@ public bool Equals(TemplateResponseDocumentFormFieldDropdown input)
156166
this.Group == input.Group ||
157167
(this.Group != null &&
158168
this.Group.Equals(input.Group))
169+
) && base.Equals(input) &&
170+
(
171+
this.Options == input.Options ||
172+
this.Options != null &&
173+
input.Options != null &&
174+
this.Options.SequenceEqual(input.Options)
159175
);
160176
}
161177

@@ -176,6 +192,10 @@ public override int GetHashCode()
176192
{
177193
hashCode = (hashCode * 59) + this.Group.GetHashCode();
178194
}
195+
if (this.Options != null)
196+
{
197+
hashCode = (hashCode * 59) + this.Options.GetHashCode();
198+
}
179199
return hashCode;
180200
}
181201
}
@@ -220,6 +240,13 @@ public List<OpenApiType> GetOpenApiTypes()
220240
Type = "string",
221241
Value = Group,
222242
});
243+
types.Add(new OpenApiType()
244+
{
245+
Name = "options",
246+
Property = "Options",
247+
Type = "List<string>",
248+
Value = Options,
249+
});
223250

224251
return types;
225252
}

sdks/java-v1/docs/TemplateResponseDocumentFormFieldDropdown.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This class extends `TemplateResponseDocumentFormFieldBase`
1010
|------------ | ------------- | ------------- | -------------|
1111
| `type`<sup>*_required_</sup> | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | |
1212
| `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
13+
| `options` | ```List<String>``` | The options available for this dropdown form field. | |
1314

1415

1516

sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
2121
import com.fasterxml.jackson.annotation.JsonTypeInfo;
2222
import com.fasterxml.jackson.databind.ObjectMapper;
23+
import java.util.ArrayList;
2324
import java.util.HashMap;
25+
import java.util.List;
2426
import java.util.Map;
2527
import java.util.Objects;
2628

2729
/** This class extends &#x60;TemplateResponseDocumentFormFieldBase&#x60; */
2830
@JsonPropertyOrder({
2931
TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE,
30-
TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_GROUP
32+
TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_GROUP,
33+
TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_OPTIONS
3134
})
3235
@javax.annotation.Generated(
3336
value = "org.openapitools.codegen.languages.JavaClientCodegen",
@@ -48,6 +51,9 @@ public class TemplateResponseDocumentFormFieldDropdown
4851
public static final String JSON_PROPERTY_GROUP = "group";
4952
@javax.annotation.Nullable private String group;
5053

54+
public static final String JSON_PROPERTY_OPTIONS = "options";
55+
@javax.annotation.Nullable private List<String> options = null;
56+
5157
public TemplateResponseDocumentFormFieldDropdown() {}
5258

5359
/**
@@ -122,6 +128,37 @@ public void setGroup(@javax.annotation.Nullable String group) {
122128
this.group = group;
123129
}
124130

131+
public TemplateResponseDocumentFormFieldDropdown options(
132+
@javax.annotation.Nullable List<String> options) {
133+
this.options = options;
134+
return this;
135+
}
136+
137+
public TemplateResponseDocumentFormFieldDropdown addOptionsItem(String optionsItem) {
138+
if (this.options == null) {
139+
this.options = new ArrayList<>();
140+
}
141+
this.options.add(optionsItem);
142+
return this;
143+
}
144+
145+
/**
146+
* The options available for this dropdown form field.
147+
*
148+
* @return options
149+
*/
150+
@javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OPTIONS)
151+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
152+
public List<String> getOptions() {
153+
return options;
154+
}
155+
156+
@JsonProperty(JSON_PROPERTY_OPTIONS)
157+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
158+
public void setOptions(@javax.annotation.Nullable List<String> options) {
159+
this.options = options;
160+
}
161+
125162
/** Return true if this TemplateResponseDocumentFormFieldDropdown object is equal to o. */
126163
@Override
127164
public boolean equals(Object o) {
@@ -135,12 +172,13 @@ public boolean equals(Object o) {
135172
(TemplateResponseDocumentFormFieldDropdown) o;
136173
return Objects.equals(this.type, templateResponseDocumentFormFieldDropdown.type)
137174
&& Objects.equals(this.group, templateResponseDocumentFormFieldDropdown.group)
175+
&& Objects.equals(this.options, templateResponseDocumentFormFieldDropdown.options)
138176
&& super.equals(o);
139177
}
140178

141179
@Override
142180
public int hashCode() {
143-
return Objects.hash(type, group, super.hashCode());
181+
return Objects.hash(type, group, options, super.hashCode());
144182
}
145183

146184
@Override
@@ -150,6 +188,7 @@ public String toString() {
150188
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
151189
sb.append(" type: ").append(toIndentedString(type)).append("\n");
152190
sb.append(" group: ").append(toIndentedString(group)).append("\n");
191+
sb.append(" options: ").append(toIndentedString(options)).append("\n");
153192
sb.append("}");
154193
return sb.toString();
155194
}
@@ -195,6 +234,24 @@ public Map<String, Object> createFormData() throws ApiException {
195234
map.put("group", JSON.getDefault().getMapper().writeValueAsString(group));
196235
}
197236
}
237+
if (options != null) {
238+
if (isFileTypeOrListOfFiles(options)) {
239+
fileTypeFound = true;
240+
}
241+
242+
if (options.getClass().equals(java.io.File.class)
243+
|| options.getClass().equals(Integer.class)
244+
|| options.getClass().equals(String.class)
245+
|| options.getClass().isEnum()) {
246+
map.put("options", options);
247+
} else if (isListOfFile(options)) {
248+
for (int i = 0; i < getListSize(options); i++) {
249+
map.put("options[" + i + "]", getFromList(options, i));
250+
}
251+
} else {
252+
map.put("options", JSON.getDefault().getMapper().writeValueAsString(options));
253+
}
254+
}
198255
} catch (Exception e) {
199256
throw new ApiException(e);
200257
}

sdks/java-v2/docs/TemplateResponseDocumentFormFieldDropdown.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This class extends `TemplateResponseDocumentFormFieldBase`
1010
|------------ | ------------- | ------------- | -------------|
1111
| `type`<sup>*_required_</sup> | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).<br><br>* Text Field uses `TemplateResponseDocumentFormFieldText`<br>* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`<br>* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`<br>* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`<br>* Radio Field uses `TemplateResponseDocumentFormFieldRadio`<br>* Signature Field uses `TemplateResponseDocumentFormFieldSignature`<br>* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`<br>* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | |
1212
| `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | |
13+
| `options` | ```List<String>``` | The options available for this dropdown form field. | |
1314

1415

1516

0 commit comments

Comments
 (0)