Skip to content

Commit 3d72e05

Browse files
committed
updated java-petstore-okhttp-gson-parcelable sample.
1 parent 8ee0fa2 commit 3d72e05

36 files changed

+192
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0-SNAPSHOT
1+
3.0.3-SNAPSHOT

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
250250
### Example
251251
```java
252252
// Import classes:
253+
//import io.swagger.client.ApiClient;
253254
//import io.swagger.client.ApiException;
255+
//import io.swagger.client.Configuration;
256+
//import io.swagger.client.auth.*;
254257
//import io.swagger.client.api.FakeApi;
255258

259+
ApiClient defaultClient = Configuration.getDefaultApiClient();
260+
// Configure HTTP basic authorization: http_basic_test
261+
HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
262+
http_basic_test.setUsername("YOUR USERNAME");
263+
http_basic_test.setPassword("YOUR PASSWORD");
256264

257265
FakeApi apiInstance = new FakeApi();
258266
Object body = null; // Object |

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@ To test class name in snake case
1515
### Example
1616
```java
1717
// Import classes:
18+
//import io.swagger.client.ApiClient;
1819
//import io.swagger.client.ApiException;
20+
//import io.swagger.client.Configuration;
21+
//import io.swagger.client.auth.*;
1922
//import io.swagger.client.api.FakeClassnameTags123Api;
2023

24+
ApiClient defaultClient = Configuration.getDefaultApiClient();
25+
26+
// Configure API key authorization: api_key_query
27+
ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
28+
api_key_query.setApiKey("YOUR API KEY");
29+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
30+
//api_key_query.setApiKeyPrefix("Token");
2131

2232
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api();
2333
Client body = new Client(); // Client | client model

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@ Add a new pet to the store
2222
### Example
2323
```java
2424
// Import classes:
25+
//import io.swagger.client.ApiClient;
2526
//import io.swagger.client.ApiException;
27+
//import io.swagger.client.Configuration;
28+
//import io.swagger.client.auth.*;
2629
//import io.swagger.client.api.PetApi;
2730

31+
ApiClient defaultClient = Configuration.getDefaultApiClient();
32+
33+
// Configure OAuth2 access token for authorization: petstore_auth
34+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
35+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
2836

2937
PetApi apiInstance = new PetApi();
3038
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -64,9 +72,17 @@ Deletes a pet
6472
### Example
6573
```java
6674
// Import classes:
75+
//import io.swagger.client.ApiClient;
6776
//import io.swagger.client.ApiException;
77+
//import io.swagger.client.Configuration;
78+
//import io.swagger.client.auth.*;
6879
//import io.swagger.client.api.PetApi;
6980

81+
ApiClient defaultClient = Configuration.getDefaultApiClient();
82+
83+
// Configure OAuth2 access token for authorization: petstore_auth
84+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
85+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
7086

7187
PetApi apiInstance = new PetApi();
7288
Integer petId = 56; // Integer | Pet id to delete
@@ -110,9 +126,17 @@ Multiple status values can be provided with comma separated strings
110126
### Example
111127
```java
112128
// Import classes:
129+
//import io.swagger.client.ApiClient;
113130
//import io.swagger.client.ApiException;
131+
//import io.swagger.client.Configuration;
132+
//import io.swagger.client.auth.*;
114133
//import io.swagger.client.api.PetApi;
115134

135+
ApiClient defaultClient = Configuration.getDefaultApiClient();
136+
137+
// Configure OAuth2 access token for authorization: petstore_auth
138+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
139+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
116140

117141
PetApi apiInstance = new PetApi();
118142
List<String> status = Arrays.asList("status_example"); // List<String> | Status values that need to be considered for filter
@@ -155,9 +179,17 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
155179
### Example
156180
```java
157181
// Import classes:
182+
//import io.swagger.client.ApiClient;
158183
//import io.swagger.client.ApiException;
184+
//import io.swagger.client.Configuration;
185+
//import io.swagger.client.auth.*;
159186
//import io.swagger.client.api.PetApi;
160187

188+
ApiClient defaultClient = Configuration.getDefaultApiClient();
189+
190+
// Configure OAuth2 access token for authorization: petstore_auth
191+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
192+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
161193

162194
PetApi apiInstance = new PetApi();
163195
List<String> tags = Arrays.asList("tags_example"); // List<String> | Tags to filter by
@@ -200,9 +232,19 @@ Returns a single pet
200232
### Example
201233
```java
202234
// Import classes:
235+
//import io.swagger.client.ApiClient;
203236
//import io.swagger.client.ApiException;
237+
//import io.swagger.client.Configuration;
238+
//import io.swagger.client.auth.*;
204239
//import io.swagger.client.api.PetApi;
205240

241+
ApiClient defaultClient = Configuration.getDefaultApiClient();
242+
243+
// Configure API key authorization: api_key
244+
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
245+
api_key.setApiKey("YOUR API KEY");
246+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
247+
//api_key.setApiKeyPrefix("Token");
206248

207249
PetApi apiInstance = new PetApi();
208250
Integer petId = 56; // Integer | ID of pet to return
@@ -243,9 +285,17 @@ Update an existing pet
243285
### Example
244286
```java
245287
// Import classes:
288+
//import io.swagger.client.ApiClient;
246289
//import io.swagger.client.ApiException;
290+
//import io.swagger.client.Configuration;
291+
//import io.swagger.client.auth.*;
247292
//import io.swagger.client.api.PetApi;
248293

294+
ApiClient defaultClient = Configuration.getDefaultApiClient();
295+
296+
// Configure OAuth2 access token for authorization: petstore_auth
297+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
298+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
249299

250300
PetApi apiInstance = new PetApi();
251301
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -285,9 +335,17 @@ Updates a pet in the store with form data
285335
### Example
286336
```java
287337
// Import classes:
338+
//import io.swagger.client.ApiClient;
288339
//import io.swagger.client.ApiException;
340+
//import io.swagger.client.Configuration;
341+
//import io.swagger.client.auth.*;
289342
//import io.swagger.client.api.PetApi;
290343

344+
ApiClient defaultClient = Configuration.getDefaultApiClient();
345+
346+
// Configure OAuth2 access token for authorization: petstore_auth
347+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
348+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
291349

292350
PetApi apiInstance = new PetApi();
293351
Integer petId = 56; // Integer | ID of pet that needs to be updated
@@ -331,9 +389,17 @@ uploads an image
331389
### Example
332390
```java
333391
// Import classes:
392+
//import io.swagger.client.ApiClient;
334393
//import io.swagger.client.ApiException;
394+
//import io.swagger.client.Configuration;
395+
//import io.swagger.client.auth.*;
335396
//import io.swagger.client.api.PetApi;
336397

398+
ApiClient defaultClient = Configuration.getDefaultApiClient();
399+
400+
// Configure OAuth2 access token for authorization: petstore_auth
401+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
402+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
337403

338404
PetApi apiInstance = new PetApi();
339405
Integer petId = 56; // Integer | ID of pet to update

samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,19 @@ Returns a map of status codes to quantities
6464
### Example
6565
```java
6666
// Import classes:
67+
//import io.swagger.client.ApiClient;
6768
//import io.swagger.client.ApiException;
69+
//import io.swagger.client.Configuration;
70+
//import io.swagger.client.auth.*;
6871
//import io.swagger.client.api.StoreApi;
6972

73+
ApiClient defaultClient = Configuration.getDefaultApiClient();
74+
75+
// Configure API key authorization: api_key
76+
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
77+
api_key.setApiKey("YOUR API KEY");
78+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
79+
//api_key.setApiKeyPrefix("Token");
7080

7181
StoreApi apiInstance = new StoreApi();
7282
try {

samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ public com.squareup.okhttp.Call testEnumParametersCall(Object body, List<String>
801801
List<Pair> localVarQueryParams = new ArrayList<Pair>();
802802
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
803803
if (enumQueryStringArray != null)
804-
localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string_array", enumQueryStringArray));
804+
localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray));
805805
if (enumQueryString != null)
806806
localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string", enumQueryString));
807807
if (enumQueryInteger != null)

samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public com.squareup.okhttp.Call findPetsByStatusCall(List<String> status, final
319319
List<Pair> localVarQueryParams = new ArrayList<Pair>();
320320
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
321321
if (status != null)
322-
localVarQueryParams.addAll(apiClient.parameterToPair("status", status));
322+
localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
323323

324324
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
325325

@@ -445,7 +445,7 @@ public com.squareup.okhttp.Call findPetsByTagsCall(List<String> tags, final Prog
445445
List<Pair> localVarQueryParams = new ArrayList<Pair>();
446446
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
447447
if (tags != null)
448-
localVarQueryParams.addAll(apiClient.parameterToPair("tags", tags));
448+
localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
449449

450450
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
451451

samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
*/
3232

3333
public class AdditionalPropertiesClass {
34+
3435
@SerializedName("map_property")
3536
private Map<String, String> mapProperty = null;
37+
3638
@SerializedName("map_of_map_property")
3739
private Map<String, Map<String, String>> mapOfMapProperty = null;
3840
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {

samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929

3030

3131
public class Animal {
32+
3233
@SerializedName("className")
3334
private String className = null;
35+
3436
@SerializedName("color")
3537
private String color = "red";
3638
public Animal className(String className) {

samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232

3333
public class ArrayOfArrayOfNumberOnly {
34+
3435
@SerializedName("ArrayArrayNumber")
3536
private List<List<BigDecimal>> arrayArrayNumber = null;
3637
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {

0 commit comments

Comments
 (0)