Skip to content

Commit ba6f604

Browse files
authored
Application and customer functionality and test updates (#35)
1 parent a7f075c commit ba6f604

28 files changed

+4223
-174
lines changed

api/openapi.yaml

Lines changed: 293 additions & 51 deletions
Large diffs are not rendered by default.

src/main/java/unit/java/sdk/api/UnitApi.java

Lines changed: 266 additions & 7 deletions
Large diffs are not rendered by default.
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
/*
2+
* Unit OpenAPI specifications
3+
* An OpenAPI specifications for unit-sdk clients
4+
*
5+
* The version of the OpenAPI document: 0.1.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package unit.java.sdk.model;
15+
16+
import java.net.URLEncoder;
17+
import java.nio.charset.StandardCharsets;
18+
import java.util.StringJoiner;
19+
import java.util.Objects;
20+
import java.util.Map;
21+
import java.util.HashMap;
22+
import com.fasterxml.jackson.annotation.JsonInclude;
23+
import com.fasterxml.jackson.annotation.JsonProperty;
24+
import com.fasterxml.jackson.annotation.JsonCreator;
25+
import com.fasterxml.jackson.annotation.JsonTypeName;
26+
import com.fasterxml.jackson.annotation.JsonValue;
27+
import java.util.Arrays;
28+
import unit.java.sdk.model.AddAuthorizedUsersRequestData;
29+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
30+
31+
32+
/**
33+
* AddAuthorizedUsersRequest
34+
*/
35+
@JsonPropertyOrder({
36+
AddAuthorizedUsersRequest.JSON_PROPERTY_DATA
37+
})
38+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
39+
public class AddAuthorizedUsersRequest {
40+
public static final String JSON_PROPERTY_DATA = "data";
41+
private AddAuthorizedUsersRequestData data;
42+
43+
public AddAuthorizedUsersRequest() {
44+
}
45+
46+
public AddAuthorizedUsersRequest data(AddAuthorizedUsersRequestData data) {
47+
this.data = data;
48+
return this;
49+
}
50+
51+
/**
52+
* Get data
53+
* @return data
54+
**/
55+
@jakarta.annotation.Nullable
56+
@JsonProperty(JSON_PROPERTY_DATA)
57+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
58+
59+
public AddAuthorizedUsersRequestData getData() {
60+
return data;
61+
}
62+
63+
64+
@JsonProperty(JSON_PROPERTY_DATA)
65+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
66+
public void setData(AddAuthorizedUsersRequestData data) {
67+
this.data = data;
68+
}
69+
70+
71+
/**
72+
* Return true if this AddAuthorizedUsersRequest object is equal to o.
73+
*/
74+
@Override
75+
public boolean equals(Object o) {
76+
if (this == o) {
77+
return true;
78+
}
79+
if (o == null || getClass() != o.getClass()) {
80+
return false;
81+
}
82+
AddAuthorizedUsersRequest addAuthorizedUsersRequest = (AddAuthorizedUsersRequest) o;
83+
return Objects.equals(this.data, addAuthorizedUsersRequest.data);
84+
}
85+
86+
@Override
87+
public int hashCode() {
88+
return Objects.hash(data);
89+
}
90+
91+
@Override
92+
public String toString() {
93+
StringBuilder sb = new StringBuilder();
94+
sb.append("class AddAuthorizedUsersRequest {\n");
95+
sb.append(" data: ").append(toIndentedString(data)).append("\n");
96+
sb.append("}");
97+
return sb.toString();
98+
}
99+
100+
/**
101+
* Convert the given object to string with each line indented by 4 spaces
102+
* (except the first line).
103+
*/
104+
private String toIndentedString(Object o) {
105+
if (o == null) {
106+
return "null";
107+
}
108+
return o.toString().replace("\n", "\n ");
109+
}
110+
111+
/**
112+
* Convert the instance into URL query string.
113+
*
114+
* @return URL query string
115+
*/
116+
public String toUrlQueryString() {
117+
return toUrlQueryString(null);
118+
}
119+
120+
/**
121+
* Convert the instance into URL query string.
122+
*
123+
* @param prefix prefix of the query string
124+
* @return URL query string
125+
*/
126+
public String toUrlQueryString(String prefix) {
127+
String suffix = "";
128+
String containerSuffix = "";
129+
String containerPrefix = "";
130+
if (prefix == null) {
131+
// style=form, explode=true, e.g. /pet?name=cat&type=manx
132+
prefix = "";
133+
} else {
134+
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
135+
prefix = prefix + "[";
136+
suffix = "]";
137+
containerSuffix = "]";
138+
containerPrefix = "[";
139+
}
140+
141+
StringJoiner joiner = new StringJoiner("&");
142+
143+
// add `data` to the URL query string
144+
if (getData() != null) {
145+
joiner.add(getData().toUrlQueryString(prefix + "data" + suffix));
146+
}
147+
148+
return joiner.toString();
149+
}
150+
}
151+
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
/*
2+
* Unit OpenAPI specifications
3+
* An OpenAPI specifications for unit-sdk clients
4+
*
5+
* The version of the OpenAPI document: 0.1.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package unit.java.sdk.model;
15+
16+
import java.net.URLEncoder;
17+
import java.nio.charset.StandardCharsets;
18+
import java.util.StringJoiner;
19+
import java.util.Objects;
20+
import java.util.Map;
21+
import java.util.HashMap;
22+
import com.fasterxml.jackson.annotation.JsonInclude;
23+
import com.fasterxml.jackson.annotation.JsonProperty;
24+
import com.fasterxml.jackson.annotation.JsonCreator;
25+
import com.fasterxml.jackson.annotation.JsonTypeName;
26+
import com.fasterxml.jackson.annotation.JsonValue;
27+
import java.util.Arrays;
28+
import unit.java.sdk.model.AddAuthorizedUsersRequestDataAttributes;
29+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
30+
31+
32+
/**
33+
* AddAuthorizedUsersRequestData
34+
*/
35+
@JsonPropertyOrder({
36+
AddAuthorizedUsersRequestData.JSON_PROPERTY_TYPE,
37+
AddAuthorizedUsersRequestData.JSON_PROPERTY_ATTRIBUTES
38+
})
39+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
40+
public class AddAuthorizedUsersRequestData {
41+
/**
42+
* Gets or Sets type
43+
*/
44+
public enum TypeEnum {
45+
ADDAUTHORIZEDUSERS("addAuthorizedUsers");
46+
47+
private String value;
48+
49+
TypeEnum(String value) {
50+
this.value = value;
51+
}
52+
53+
@JsonValue
54+
public String getValue() {
55+
return value;
56+
}
57+
58+
@Override
59+
public String toString() {
60+
return String.valueOf(value);
61+
}
62+
63+
@JsonCreator
64+
public static TypeEnum fromValue(String value) {
65+
for (TypeEnum b : TypeEnum.values()) {
66+
if (b.value.equals(value)) {
67+
return b;
68+
}
69+
}
70+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
71+
}
72+
}
73+
74+
public static final String JSON_PROPERTY_TYPE = "type";
75+
private TypeEnum type = TypeEnum.ADDAUTHORIZEDUSERS;
76+
77+
public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
78+
private AddAuthorizedUsersRequestDataAttributes attributes;
79+
80+
public AddAuthorizedUsersRequestData() {
81+
}
82+
83+
public AddAuthorizedUsersRequestData type(TypeEnum type) {
84+
this.type = type;
85+
return this;
86+
}
87+
88+
/**
89+
* Get type
90+
* @return type
91+
**/
92+
@jakarta.annotation.Nullable
93+
@JsonProperty(JSON_PROPERTY_TYPE)
94+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
95+
96+
public TypeEnum getType() {
97+
return type;
98+
}
99+
100+
101+
@JsonProperty(JSON_PROPERTY_TYPE)
102+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
103+
public void setType(TypeEnum type) {
104+
this.type = type;
105+
}
106+
107+
108+
public AddAuthorizedUsersRequestData attributes(AddAuthorizedUsersRequestDataAttributes attributes) {
109+
this.attributes = attributes;
110+
return this;
111+
}
112+
113+
/**
114+
* Get attributes
115+
* @return attributes
116+
**/
117+
@jakarta.annotation.Nullable
118+
@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
119+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
120+
121+
public AddAuthorizedUsersRequestDataAttributes getAttributes() {
122+
return attributes;
123+
}
124+
125+
126+
@JsonProperty(JSON_PROPERTY_ATTRIBUTES)
127+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
128+
public void setAttributes(AddAuthorizedUsersRequestDataAttributes attributes) {
129+
this.attributes = attributes;
130+
}
131+
132+
133+
/**
134+
* Return true if this AddAuthorizedUsersRequest_data object is equal to o.
135+
*/
136+
@Override
137+
public boolean equals(Object o) {
138+
if (this == o) {
139+
return true;
140+
}
141+
if (o == null || getClass() != o.getClass()) {
142+
return false;
143+
}
144+
AddAuthorizedUsersRequestData addAuthorizedUsersRequestData = (AddAuthorizedUsersRequestData) o;
145+
return Objects.equals(this.type, addAuthorizedUsersRequestData.type) &&
146+
Objects.equals(this.attributes, addAuthorizedUsersRequestData.attributes);
147+
}
148+
149+
@Override
150+
public int hashCode() {
151+
return Objects.hash(type, attributes);
152+
}
153+
154+
@Override
155+
public String toString() {
156+
StringBuilder sb = new StringBuilder();
157+
sb.append("class AddAuthorizedUsersRequestData {\n");
158+
sb.append(" type: ").append(toIndentedString(type)).append("\n");
159+
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
160+
sb.append("}");
161+
return sb.toString();
162+
}
163+
164+
/**
165+
* Convert the given object to string with each line indented by 4 spaces
166+
* (except the first line).
167+
*/
168+
private String toIndentedString(Object o) {
169+
if (o == null) {
170+
return "null";
171+
}
172+
return o.toString().replace("\n", "\n ");
173+
}
174+
175+
/**
176+
* Convert the instance into URL query string.
177+
*
178+
* @return URL query string
179+
*/
180+
public String toUrlQueryString() {
181+
return toUrlQueryString(null);
182+
}
183+
184+
/**
185+
* Convert the instance into URL query string.
186+
*
187+
* @param prefix prefix of the query string
188+
* @return URL query string
189+
*/
190+
public String toUrlQueryString(String prefix) {
191+
String suffix = "";
192+
String containerSuffix = "";
193+
String containerPrefix = "";
194+
if (prefix == null) {
195+
// style=form, explode=true, e.g. /pet?name=cat&type=manx
196+
prefix = "";
197+
} else {
198+
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
199+
prefix = prefix + "[";
200+
suffix = "]";
201+
containerSuffix = "]";
202+
containerPrefix = "[";
203+
}
204+
205+
StringJoiner joiner = new StringJoiner("&");
206+
207+
// add `type` to the URL query string
208+
if (getType() != null) {
209+
joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
210+
}
211+
212+
// add `attributes` to the URL query string
213+
if (getAttributes() != null) {
214+
joiner.add(getAttributes().toUrlQueryString(prefix + "attributes" + suffix));
215+
}
216+
217+
return joiner.toString();
218+
}
219+
}
220+

0 commit comments

Comments
 (0)