Skip to content

Commit dce5d64

Browse files
committed
update openapi client
* add support for API key auth
1 parent f7b1a60 commit dce5d64

39 files changed

Lines changed: 157 additions & 246 deletions

app/src/main/java/org/pyload/android/openapi/ApiClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -61,9 +61,9 @@ public ApiClient(String[] authNames) {
6161
this();
6262
for(String authName : authNames) {
6363
Interceptor auth = null;
64-
if ("basicAuth".equals(authName)) {
65-
auth = new HttpBasicAuth();
66-
} else {
64+
if ("ApiKeyAuth".equals(authName)) {
65+
auth = new ApiKeyAuth("header", "X-API-Key");
66+
} else {
6767
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
6868
}
6969
if (auth != null) {

app/src/main/java/org/pyload/android/openapi/CollectionFormats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

app/src/main/java/org/pyload/android/openapi/JSON.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

app/src/main/java/org/pyload/android/openapi/ServerConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -18,7 +18,7 @@
1818
/**
1919
* Representing a Server configuration.
2020
*/
21-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT")
21+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
2222
public class ServerConfiguration {
2323
public String URL;
2424
public String description;

app/src/main/java/org/pyload/android/openapi/ServerVariable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -18,7 +18,7 @@
1818
/**
1919
* Representing a Server Variable for server URL template substitution.
2020
*/
21-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT")
21+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
2222
public class ServerVariable {
2323
public String description;
2424
public String defaultValue;

app/src/main/java/org/pyload/android/openapi/StringUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@
1616
import java.util.Collection;
1717
import java.util.Iterator;
1818

19-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT")
19+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
2020
public class StringUtil {
2121
/**
2222
* Check if the given array contains the given value (with case-insensitive comparison).

app/src/main/java/org/pyload/android/openapi/auth/ApiKeyAuth.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,6 @@
1616
import java.io.IOException;
1717
import java.net.URI;
1818
import java.net.URISyntaxException;
19-
import java.util.Locale;
2019

2120
import okhttp3.Interceptor;
2221
import okhttp3.Request;
@@ -78,7 +77,7 @@ public Response intercept(Chain chain) throws IOException {
7877
.build();
7978
} else if ("cookie".equals(location)) {
8079
request = request.newBuilder()
81-
.addHeader("Cookie", String.format(Locale.ROOT, "%s=%s", paramName, apiKey))
80+
.addHeader("Cookie", String.format(java.util.Locale.ROOT, "%s=%s", paramName, apiKey))
8281
.build();
8382
}
8483
return chain.proceed(request);

app/src/main/java/org/pyload/android/openapi/auth/HttpBasicAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

app/src/main/java/org/pyload/android/openapi/auth/HttpBearerAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

app/src/main/java/org/pyload/android/openapi/models/AccountInfo.java

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* pyLoad API Documentation - OpenAPI
33
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
44
*
5-
* The version of the OpenAPI document: 1.1.0
5+
* The version of the OpenAPI document: 1.2.0
66
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -15,7 +15,6 @@
1515

1616
import java.util.Objects;
1717
import java.util.Arrays;
18-
import java.util.Locale;
1918
import com.google.gson.TypeAdapter;
2019
import com.google.gson.annotations.JsonAdapter;
2120
import com.google.gson.annotations.SerializedName;
@@ -26,7 +25,7 @@
2625
/**
2726
* AccountInfo
2827
*/
29-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT")
28+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
3029
public class AccountInfo {
3130
public static final String SERIALIZED_NAME_VALIDUNTIL = "validuntil";
3231
@SerializedName(SERIALIZED_NAME_VALIDUNTIL)
@@ -35,18 +34,18 @@ public class AccountInfo {
3534

3635
public static final String SERIALIZED_NAME_LOGIN = "login";
3736
@SerializedName(SERIALIZED_NAME_LOGIN)
38-
@javax.annotation.Nonnull
39-
private String login;
37+
@javax.annotation.Nullable
38+
private String login = "";
4039

4140
public static final String SERIALIZED_NAME_OPTIONS = "options";
4241
@SerializedName(SERIALIZED_NAME_OPTIONS)
43-
@javax.annotation.Nonnull
44-
private Object options;
42+
@javax.annotation.Nullable
43+
private Object options = new Object();
4544

4645
public static final String SERIALIZED_NAME_VALID = "valid";
4746
@SerializedName(SERIALIZED_NAME_VALID)
48-
@javax.annotation.Nonnull
49-
private Boolean valid;
47+
@javax.annotation.Nullable
48+
private Boolean valid = false;
5049

5150
public static final String SERIALIZED_NAME_TRAFFICLEFT = "trafficleft";
5251
@SerializedName(SERIALIZED_NAME_TRAFFICLEFT)
@@ -55,13 +54,13 @@ public class AccountInfo {
5554

5655
public static final String SERIALIZED_NAME_PREMIUM = "premium";
5756
@SerializedName(SERIALIZED_NAME_PREMIUM)
58-
@javax.annotation.Nonnull
59-
private Boolean premium;
57+
@javax.annotation.Nullable
58+
private Boolean premium = false;
6059

6160
public static final String SERIALIZED_NAME_TYPE = "type";
6261
@SerializedName(SERIALIZED_NAME_TYPE)
63-
@javax.annotation.Nonnull
64-
private String type;
62+
@javax.annotation.Nullable
63+
private String type = "";
6564

6665
public AccountInfo() {
6766
}
@@ -87,7 +86,7 @@ public void setValiduntil(@javax.annotation.Nullable Float validuntil) {
8786
this.validuntil = validuntil;
8887
}
8988

90-
public AccountInfo login(@javax.annotation.Nonnull String login) {
89+
public AccountInfo login(@javax.annotation.Nullable String login) {
9190

9291
this.login = login;
9392
return this;
@@ -97,18 +96,18 @@ public AccountInfo login(@javax.annotation.Nonnull String login) {
9796
* Get login
9897
* @return login
9998
*/
100-
@javax.annotation.Nonnull
99+
@javax.annotation.Nullable
101100

102101
public String getLogin() {
103102
return login;
104103
}
105104

106105

107-
public void setLogin(@javax.annotation.Nonnull String login) {
106+
public void setLogin(@javax.annotation.Nullable String login) {
108107
this.login = login;
109108
}
110109

111-
public AccountInfo options(@javax.annotation.Nonnull Object options) {
110+
public AccountInfo options(@javax.annotation.Nullable Object options) {
112111

113112
this.options = options;
114113
return this;
@@ -118,18 +117,18 @@ public AccountInfo options(@javax.annotation.Nonnull Object options) {
118117
* Get options
119118
* @return options
120119
*/
121-
@javax.annotation.Nonnull
120+
@javax.annotation.Nullable
122121

123122
public Object getOptions() {
124123
return options;
125124
}
126125

127126

128-
public void setOptions(@javax.annotation.Nonnull Object options) {
127+
public void setOptions(@javax.annotation.Nullable Object options) {
129128
this.options = options;
130129
}
131130

132-
public AccountInfo valid(@javax.annotation.Nonnull Boolean valid) {
131+
public AccountInfo valid(@javax.annotation.Nullable Boolean valid) {
133132

134133
this.valid = valid;
135134
return this;
@@ -139,14 +138,14 @@ public AccountInfo valid(@javax.annotation.Nonnull Boolean valid) {
139138
* Get valid
140139
* @return valid
141140
*/
142-
@javax.annotation.Nonnull
141+
@javax.annotation.Nullable
143142

144143
public Boolean getValid() {
145144
return valid;
146145
}
147146

148147

149-
public void setValid(@javax.annotation.Nonnull Boolean valid) {
148+
public void setValid(@javax.annotation.Nullable Boolean valid) {
150149
this.valid = valid;
151150
}
152151

@@ -171,7 +170,7 @@ public void setTrafficleft(@javax.annotation.Nullable Long trafficleft) {
171170
this.trafficleft = trafficleft;
172171
}
173172

174-
public AccountInfo premium(@javax.annotation.Nonnull Boolean premium) {
173+
public AccountInfo premium(@javax.annotation.Nullable Boolean premium) {
175174

176175
this.premium = premium;
177176
return this;
@@ -181,18 +180,18 @@ public AccountInfo premium(@javax.annotation.Nonnull Boolean premium) {
181180
* Get premium
182181
* @return premium
183182
*/
184-
@javax.annotation.Nonnull
183+
@javax.annotation.Nullable
185184

186185
public Boolean getPremium() {
187186
return premium;
188187
}
189188

190189

191-
public void setPremium(@javax.annotation.Nonnull Boolean premium) {
190+
public void setPremium(@javax.annotation.Nullable Boolean premium) {
192191
this.premium = premium;
193192
}
194193

195-
public AccountInfo type(@javax.annotation.Nonnull String type) {
194+
public AccountInfo type(@javax.annotation.Nullable String type) {
196195

197196
this.type = type;
198197
return this;
@@ -202,17 +201,18 @@ public AccountInfo type(@javax.annotation.Nonnull String type) {
202201
* Get type
203202
* @return type
204203
*/
205-
@javax.annotation.Nonnull
204+
@javax.annotation.Nullable
206205

207206
public String getType() {
208207
return type;
209208
}
210209

211210

212-
public void setType(@javax.annotation.Nonnull String type) {
211+
public void setType(@javax.annotation.Nullable String type) {
213212
this.type = type;
214213
}
215214

215+
216216
@Override
217217
public boolean equals(Object o) {
218218
if (this == o) {
@@ -256,10 +256,7 @@ public String toString() {
256256
* (except the first line).
257257
*/
258258
private String toIndentedString(Object o) {
259-
if (o == null) {
260-
return "null";
261-
}
262-
return o.toString().replace("\n", "\n ");
259+
return o == null ? "null" : o.toString().replace("\n", "\n ");
263260
}
264261

265262
}

0 commit comments

Comments
 (0)