Skip to content

Commit c957899

Browse files
committed
1 parent ac099fc commit c957899

File tree

3 files changed

+259
-22
lines changed

3 files changed

+259
-22
lines changed

sdk-client/src/main/java/org/domainrobot/sdk/client/clients/CertificateClient.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import org.domainrobot.sdk.models.DomainrobotApiException;
77
import org.domainrobot.sdk.models.generated.Certificate;
88
import org.domainrobot.sdk.models.generated.CertificateData;
9+
import org.domainrobot.sdk.models.generated.Job;
910
import org.domainrobot.sdk.models.generated.JsonResponseDataCertificate;
1011
import org.domainrobot.sdk.models.generated.JsonResponseDataCertificateData;
12+
import org.domainrobot.sdk.models.JsonResponseDataJob;
1113
import org.domainrobot.sdk.models.generated.JsonResponseDataJsonNoData;
12-
import org.domainrobot.sdk.models.generated.JsonResponseDataObjectJob;
13-
import org.domainrobot.sdk.models.generated.ObjectJob;
1414
import org.domainrobot.sdk.models.generated.Query;
1515
import org.springframework.http.HttpMethod;
1616
import org.springframework.http.RequestEntity;
@@ -94,16 +94,15 @@ public CertificateData prepareOrder(CertificateData body, Map<String, String> cu
9494
* generate the necessary DCV data. Returns a Job with an id that can be used
9595
* for polling.
9696
*
97-
* @return ObjectJob
97+
* @return Job
9898
* @throws DomainrobotApiException
9999
*/
100-
public ObjectJob create(Certificate body, Map<String, String> customHeaders)
101-
throws DomainrobotApiException, Exception {
100+
public Job create(Certificate body, Map<String, String> customHeaders) throws DomainrobotApiException, Exception {
102101
RequestEntity<String> request = buildRequestEntity(body, HttpMethod.POST, baseUrl + "/certificate",
103102
customHeaders);
104-
ResponseEntity<JsonResponseDataObjectJob> response = null;
103+
ResponseEntity<JsonResponseDataJob> response = null;
105104
try {
106-
response = template.exchange(request, JsonResponseDataObjectJob.class);
105+
response = template.exchange(request, JsonResponseDataJob.class);
107106
} catch (Exception e) {
108107
handleException(e);
109108
}
@@ -116,21 +115,21 @@ public ObjectJob create(Certificate body, Map<String, String> customHeaders)
116115
* generate the necessary DCV data. Returns a Job with an id that can be used
117116
* for polling.
118117
*
119-
* @return ObjectJob
118+
* @return Job
120119
* @throws DomainrobotApiException
121120
* @throws IllegalArgumentException If the id field of the body parameter is
122121
* missing.
123122
*/
124-
public ObjectJob reissue(Certificate body, Map<String, String> customHeaders)
123+
public Job reissue(Certificate body, Map<String, String> customHeaders)
125124
throws DomainrobotApiException, IllegalArgumentException, Exception {
126125
if (body.getId() == null) {
127126
throw new IllegalArgumentException("Field Certificate.id is missing.");
128127
}
129128
RequestEntity<String> request = buildRequestEntity(body, HttpMethod.PUT,
130129
baseUrl + "/certificate/" + body.getId().toString(), customHeaders);
131-
ResponseEntity<JsonResponseDataObjectJob> response = null;
130+
ResponseEntity<JsonResponseDataJob> response = null;
132131
try {
133-
response = template.exchange(request, JsonResponseDataObjectJob.class);
132+
response = template.exchange(request, JsonResponseDataJob.class);
134133
} catch (Exception e) {
135134
handleException(e);
136135
}
@@ -144,12 +143,12 @@ public ObjectJob reissue(Certificate body, Map<String, String> customHeaders)
144143
*
145144
* @throws DomainrobotApiException
146145
*/
147-
public ObjectJob delete(int id, Map<String, String> customHeaders) throws DomainrobotApiException, Exception {
146+
public Job delete(int id, Map<String, String> customHeaders) throws DomainrobotApiException, Exception {
148147
RequestEntity<String> request = buildRequestEntity(HttpMethod.DELETE, baseUrl + "/certificate/" + id,
149148
customHeaders);
150-
ResponseEntity<JsonResponseDataObjectJob> response = null;
149+
ResponseEntity<JsonResponseDataJob> response = null;
151150
try {
152-
response = template.exchange(request, JsonResponseDataObjectJob.class);
151+
response = template.exchange(request, JsonResponseDataJob.class);
153152
} catch (Exception e) {
154153
handleException(e);
155154
}
@@ -222,21 +221,21 @@ public List<Certificate> list(Query body, Map<String, String> customHeaders, Map
222221
* generate the necessary DCV data. Returns a Job with an id that can be used
223222
* for polling.
224223
*
225-
* @return ObjectJob
224+
* @return Job
226225
* @throws DomainrobotApiException
227226
* @throws IllegalArgumentException If the id field of the body parameter is
228227
* missing.
229228
*/
230-
public ObjectJob renew(Certificate body, Map<String, String> customHeaders)
229+
public Job renew(Certificate body, Map<String, String> customHeaders)
231230
throws DomainrobotApiException, IllegalArgumentException, Exception {
232231
if (body.getId() == null) {
233232
throw new IllegalArgumentException("Field Certificate.id is missing.");
234233
}
235234
RequestEntity<String> request = buildRequestEntity(body, HttpMethod.PUT,
236235
baseUrl + "/certificate/" + body.getId().toString() + "/_renew", customHeaders);
237-
ResponseEntity<JsonResponseDataObjectJob> response = null;
236+
ResponseEntity<JsonResponseDataJob> response = null;
238237
try {
239-
response = template.exchange(request, JsonResponseDataObjectJob.class);
238+
response = template.exchange(request, JsonResponseDataJob.class);
240239
} catch (Exception e) {
241240
handleException(e);
242241
}

sdk-client/src/main/java/org/domainrobot/sdk/client/clients/DomainClient.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
import org.domainrobot.sdk.models.DomainrobotApiException;
77
import org.domainrobot.sdk.models.generated.Domain;
88
import org.domainrobot.sdk.models.generated.DomainRestore;
9+
import org.domainrobot.sdk.models.generated.Job;
910
import org.domainrobot.sdk.models.generated.JsonResponseDataDomain;
1011
import org.domainrobot.sdk.models.generated.JsonResponseDataDomainRestore;
12+
import org.domainrobot.sdk.models.JsonResponseDataJob;
1113
import org.domainrobot.sdk.models.generated.JsonResponseDataObjectJob;
1214
import org.domainrobot.sdk.models.generated.ObjectJob;
1315
import org.domainrobot.sdk.models.generated.Query;
@@ -40,14 +42,14 @@ public DomainClient(String userName, String context, String password, String bas
4042
*
4143
* Sends a Domain create request.
4244
*
43-
* @return ObjectJob
45+
* @return Job
4446
* @throws DomainrobotApiException
4547
*/
46-
public ObjectJob create(Domain body, Map<String, String> customHeaders) throws DomainrobotApiException, Exception {
48+
public Job create(Domain body, Map<String, String> customHeaders) throws DomainrobotApiException, Exception {
4749
RequestEntity<String> request = buildRequestEntity(body, HttpMethod.POST, baseUrl + "/domain", customHeaders);
48-
ResponseEntity<JsonResponseDataObjectJob> response = null;
50+
ResponseEntity<JsonResponseDataJob> response = null;
4951
try {
50-
response = template.exchange(request, JsonResponseDataObjectJob.class);
52+
response = template.exchange(request, JsonResponseDataJob.class);
5153
} catch (Exception e) {
5254
handleException(e);
5355
}
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
/*
2+
* Domainrobot JSON API
3+
* Domainrobot JSON API for managing: Domains, SSL Certificates, DNS and much more.
4+
*
5+
* OpenAPI spec version: v1
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package org.domainrobot.sdk.models;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import com.fasterxml.jackson.annotation.JsonProperty;
18+
import com.fasterxml.jackson.annotation.JsonCreator;
19+
import com.fasterxml.jackson.annotation.JsonValue;
20+
import io.swagger.annotations.ApiModel;
21+
import io.swagger.annotations.ApiModelProperty;
22+
import java.util.ArrayList;
23+
import java.util.List;
24+
import org.domainrobot.sdk.models.generated.Message;
25+
import org.domainrobot.sdk.models.generated.Job;
26+
import org.domainrobot.sdk.models.generated.ResponseObject;
27+
import org.domainrobot.sdk.models.generated.ResponseStatus;
28+
import javax.validation.constraints.*;
29+
import javax.validation.Valid;
30+
31+
/**
32+
* JsonResponseDataJob
33+
*/
34+
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-07-17T17:02:20.970+02:00")
35+
public class JsonResponseDataJob {
36+
@JsonProperty("stid")
37+
private String stid = null;
38+
39+
@JsonProperty("messages")
40+
private List<Message> messages = null;
41+
42+
@JsonProperty("status")
43+
private ResponseStatus status = null;
44+
45+
@JsonProperty("object")
46+
private ResponseObject object = null;
47+
48+
@JsonProperty("data")
49+
private List<Job> data = null;
50+
51+
@JsonProperty("ctid")
52+
private String ctid = null;
53+
54+
public JsonResponseDataJob stid(String stid) {
55+
this.stid = stid;
56+
return this;
57+
}
58+
59+
/**
60+
* The server transaction id for the response.
61+
*
62+
* @return stid
63+
**/
64+
@ApiModelProperty(value = "The server transaction id for the response.")
65+
public String getStid() {
66+
return stid;
67+
}
68+
69+
public void setStid(String stid) {
70+
this.stid = stid;
71+
}
72+
73+
public JsonResponseDataJob messages(List<Message> messages) {
74+
this.messages = messages;
75+
return this;
76+
}
77+
78+
public JsonResponseDataJob addMessagesItem(Message messagesItem) {
79+
if (this.messages == null) {
80+
this.messages = new ArrayList<Message>();
81+
}
82+
this.messages.add(messagesItem);
83+
return this;
84+
}
85+
86+
/**
87+
* The messages belonging to the response.
88+
*
89+
* @return messages
90+
**/
91+
@Valid
92+
@ApiModelProperty(value = "The messages belonging to the response.")
93+
public List<Message> getMessages() {
94+
return messages;
95+
}
96+
97+
public void setMessages(List<Message> messages) {
98+
this.messages = messages;
99+
}
100+
101+
public JsonResponseDataJob status(ResponseStatus status) {
102+
this.status = status;
103+
return this;
104+
}
105+
106+
/**
107+
* The status of the response.
108+
*
109+
* @return status
110+
**/
111+
@Valid
112+
@ApiModelProperty(value = "The status of the response.")
113+
public ResponseStatus getStatus() {
114+
return status;
115+
}
116+
117+
public void setStatus(ResponseStatus status) {
118+
this.status = status;
119+
}
120+
121+
public JsonResponseDataJob object(ResponseObject object) {
122+
this.object = object;
123+
return this;
124+
}
125+
126+
/**
127+
* The object of the response.
128+
*
129+
* @return object
130+
**/
131+
@Valid
132+
@ApiModelProperty(value = "The object of the response.")
133+
public ResponseObject getObject() {
134+
return object;
135+
}
136+
137+
public void setObject(ResponseObject object) {
138+
this.object = object;
139+
}
140+
141+
public JsonResponseDataJob data(List<Job> data) {
142+
this.data = data;
143+
return this;
144+
}
145+
146+
public JsonResponseDataJob addDataItem(Job dataItem) {
147+
if (this.data == null) {
148+
this.data = new ArrayList<Job>();
149+
}
150+
this.data.add(dataItem);
151+
return this;
152+
}
153+
154+
/**
155+
* The data for the response. The type of the objects are depending on the
156+
* request and are also specified in the responseObject value of the response.
157+
*
158+
* @return data
159+
**/
160+
@Valid
161+
@ApiModelProperty(value = "The data for the response. The type of the objects are depending on the request and are also specified in the responseObject value of the response.")
162+
public List<Job> getData() {
163+
return data;
164+
}
165+
166+
public void setData(List<Job> data) {
167+
this.data = data;
168+
}
169+
170+
public JsonResponseDataJob ctid(String ctid) {
171+
this.ctid = ctid;
172+
return this;
173+
}
174+
175+
/**
176+
* The client transaction id for the response.
177+
*
178+
* @return ctid
179+
**/
180+
@ApiModelProperty(value = "The client transaction id for the response.")
181+
public String getCtid() {
182+
return ctid;
183+
}
184+
185+
public void setCtid(String ctid) {
186+
this.ctid = ctid;
187+
}
188+
189+
@Override
190+
public boolean equals(java.lang.Object o) {
191+
if (this == o) {
192+
return true;
193+
}
194+
if (o == null || getClass() != o.getClass()) {
195+
return false;
196+
}
197+
JsonResponseDataJob JsonResponseDataJob = (JsonResponseDataJob) o;
198+
return Objects.equals(this.stid, JsonResponseDataJob.stid)
199+
&& Objects.equals(this.messages, JsonResponseDataJob.messages)
200+
&& Objects.equals(this.status, JsonResponseDataJob.status)
201+
&& Objects.equals(this.object, JsonResponseDataJob.object)
202+
&& Objects.equals(this.data, JsonResponseDataJob.data) && Objects.equals(this.ctid, JsonResponseDataJob.ctid);
203+
}
204+
205+
@Override
206+
public int hashCode() {
207+
return Objects.hash(stid, messages, status, object, data, ctid);
208+
}
209+
210+
@Override
211+
public String toString() {
212+
StringBuilder sb = new StringBuilder();
213+
sb.append("class JsonResponseDataJob {\n");
214+
215+
sb.append(" stid: ").append(toIndentedString(stid)).append("\n");
216+
sb.append(" messages: ").append(toIndentedString(messages)).append("\n");
217+
sb.append(" status: ").append(toIndentedString(status)).append("\n");
218+
sb.append(" object: ").append(toIndentedString(object)).append("\n");
219+
sb.append(" data: ").append(toIndentedString(data)).append("\n");
220+
sb.append(" ctid: ").append(toIndentedString(ctid)).append("\n");
221+
sb.append("}");
222+
return sb.toString();
223+
}
224+
225+
/**
226+
* Convert the given object to string with each line indented by 4 spaces
227+
* (except the first line).
228+
*/
229+
private String toIndentedString(java.lang.Object o) {
230+
if (o == null) {
231+
return "null";
232+
}
233+
return o.toString().replace("\n", "\n ");
234+
}
235+
236+
}

0 commit comments

Comments
 (0)