Skip to content

Commit 5c36049

Browse files
committed
Spec 1.1.0
1 parent 251d969 commit 5c36049

File tree

13 files changed

+1339
-51
lines changed

13 files changed

+1339
-51
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ $apiInstance = new Sigwin\RedditClient\Api\ThingApi(
6161
$config
6262
);
6363
$id = t3_11e9mr5; // string
64+
$sr_name = pics; // string
6465

6566
try {
66-
$result = $apiInstance->getInfo($id);
67+
$result = $apiInstance->getInfo($id, $sr_name);
6768
print_r($result);
6869
} catch (Exception $e) {
6970
echo 'Exception when calling ThingApi->getInfo: ', $e->getMessage(), PHP_EOL;
@@ -78,16 +79,18 @@ All URIs are relative to *https://oauth.reddit.com*
7879
Class | Method | HTTP request | Description
7980
------------ | ------------- | ------------- | -------------
8081
*ThingApi* | [**getInfo**](docs/Api/ThingApi.md#getinfo) | **GET** /api/info | Get thing info
82+
*UserApi* | [**getAbout**](docs/Api/UserApi.md#getabout) | **GET** /user/{username}/about | Returns the identity of a user.
8183
*UserApi* | [**getSaved**](docs/Api/UserApi.md#getsaved) | **GET** /user/{username}/saved | Get user saved things
82-
*UserApi* | [**me**](docs/Api/UserApi.md#me) | **GET** /api/me | Returns the identity of the user.
84+
*UserApi* | [**me**](docs/Api/UserApi.md#me) | **GET** /api/me | Returns the identity of the current user.
8385

8486
## Models
8587

8688
- [Listing](docs/Model/Listing.md)
8789
- [ListingEnvelope](docs/Model/ListingEnvelope.md)
88-
- [Me](docs/Model/Me.md)
8990
- [Thing](docs/Model/Thing.md)
9091
- [ThingData](docs/Model/ThingData.md)
92+
- [User](docs/Model/User.md)
93+
- [UserData](docs/Model/UserData.md)
9194

9295
## Authorization
9396

@@ -116,5 +119,5 @@ [email protected]
116119

117120
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
118121

119-
- API version: `1.2.0`
122+
- API version: `1.1.0`
120123
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

docs/Api/ThingApi.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All URIs are relative to https://oauth.reddit.com, except if the operation defin
1010
## `getInfo()`
1111

1212
```php
13-
getInfo($id): \Sigwin\RedditClient\Model\ListingEnvelope
13+
getInfo($id, $sr_name): \Sigwin\RedditClient\Model\ListingEnvelope
1414
```
1515

1616
Get thing info
@@ -33,9 +33,10 @@ $apiInstance = new Sigwin\RedditClient\Api\ThingApi(
3333
$config
3434
);
3535
$id = t3_11e9mr5; // string
36+
$sr_name = pics; // string
3637

3738
try {
38-
$result = $apiInstance->getInfo($id);
39+
$result = $apiInstance->getInfo($id, $sr_name);
3940
print_r($result);
4041
} catch (Exception $e) {
4142
echo 'Exception when calling ThingApi->getInfo: ', $e->getMessage(), PHP_EOL;
@@ -46,7 +47,8 @@ try {
4647

4748
| Name | Type | Description | Notes |
4849
| ------------- | ------------- | ------------- | ------------- |
49-
| **id** | **string**| | |
50+
| **id** | **string**| | [optional] |
51+
| **sr_name** | **string**| | [optional] |
5052

5153
### Return type
5254

docs/Api/UserApi.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,69 @@ All URIs are relative to https://oauth.reddit.com, except if the operation defin
44

55
| Method | HTTP request | Description |
66
| ------------- | ------------- | ------------- |
7+
| [**getAbout()**](UserApi.md#getAbout) | **GET** /user/{username}/about | Returns the identity of a user. |
78
| [**getSaved()**](UserApi.md#getSaved) | **GET** /user/{username}/saved | Get user saved things |
8-
| [**me()**](UserApi.md#me) | **GET** /api/me | Returns the identity of the user. |
9+
| [**me()**](UserApi.md#me) | **GET** /api/me | Returns the identity of the current user. |
910

1011

12+
## `getAbout()`
13+
14+
```php
15+
getAbout($username): \Sigwin\RedditClient\Model\User
16+
```
17+
18+
Returns the identity of a user.
19+
20+
### Example
21+
22+
```php
23+
<?php
24+
require_once(__DIR__ . '/vendor/autoload.php');
25+
26+
27+
// Configure OAuth2 access token for authorization: oauth2
28+
$config = Sigwin\RedditClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
29+
30+
31+
$apiInstance = new Sigwin\RedditClient\Api\UserApi(
32+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
33+
// This is optional, `GuzzleHttp\Client` will be used as default.
34+
new GuzzleHttp\Client(),
35+
$config
36+
);
37+
$username = snoo; // string
38+
39+
try {
40+
$result = $apiInstance->getAbout($username);
41+
print_r($result);
42+
} catch (Exception $e) {
43+
echo 'Exception when calling UserApi->getAbout: ', $e->getMessage(), PHP_EOL;
44+
}
45+
```
46+
47+
### Parameters
48+
49+
| Name | Type | Description | Notes |
50+
| ------------- | ------------- | ------------- | ------------- |
51+
| **username** | **string**| | |
52+
53+
### Return type
54+
55+
[**\Sigwin\RedditClient\Model\User**](../Model/User.md)
56+
57+
### Authorization
58+
59+
[oauth2](../../README.md#oauth2)
60+
61+
### HTTP request headers
62+
63+
- **Content-Type**: Not defined
64+
- **Accept**: `application/json`
65+
66+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
67+
[[Back to Model list]](../../README.md#models)
68+
[[Back to README]](../../README.md)
69+
1170
## `getSaved()`
1271

1372
```php
@@ -75,10 +134,10 @@ try {
75134
## `me()`
76135

77136
```php
78-
me(): \Sigwin\RedditClient\Model\Me
137+
me(): \Sigwin\RedditClient\Model\UserData
79138
```
80139

81-
Returns the identity of the user.
140+
Returns the identity of the current user.
82141

83142
### Example
84143

@@ -112,7 +171,7 @@ This endpoint does not need any parameter.
112171

113172
### Return type
114173

115-
[**\Sigwin\RedditClient\Model\Me**](../Model/Me.md)
174+
[**\Sigwin\RedditClient\Model\UserData**](../Model/UserData.md)
116175

117176
### Authorization
118177

docs/Model/User.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# # User
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**kind** | **string** | |
8+
**data** | [**\Sigwin\RedditClient\Model\UserData**](UserData.md) | |
9+
10+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/UserData.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# # UserData
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **string** | |
8+
**name** | **string** | |
9+
10+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

src/Api/ThingApi.php

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,16 @@ public function getConfig(): Configuration
117117
*
118118
* Get thing info
119119
*
120-
* @param string $id id (required)
120+
* @param string $id id (optional)
121+
* @param string $sr_name sr_name (optional)
121122
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
122123
*
123124
* @throws \InvalidArgumentException
124125
* @throws \Sigwin\RedditClient\ApiException on non-2xx response
125126
*/
126-
public function getInfo($id, string $contentType = self::contentTypes['getInfo'][0]): \Sigwin\RedditClient\Model\ListingEnvelope
127+
public function getInfo($id = null, $sr_name = null, string $contentType = self::contentTypes['getInfo'][0]): \Sigwin\RedditClient\Model\ListingEnvelope
127128
{
128-
[$response] = $this->getInfoWithHttpInfo($id, $contentType);
129+
[$response] = $this->getInfoWithHttpInfo($id, $sr_name, $contentType);
129130

130131
return $response;
131132
}
@@ -135,17 +136,18 @@ public function getInfo($id, string $contentType = self::contentTypes['getInfo']
135136
*
136137
* Get thing info
137138
*
138-
* @param string $id (required)
139+
* @param string $id (optional)
140+
* @param string $sr_name (optional)
139141
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
140142
*
141143
* @return array of \Sigwin\RedditClient\Model\ListingEnvelope, HTTP status code, HTTP response headers (array of strings)
142144
*
143145
* @throws \InvalidArgumentException
144146
* @throws \Sigwin\RedditClient\ApiException on non-2xx response
145147
*/
146-
public function getInfoWithHttpInfo($id, string $contentType = self::contentTypes['getInfo'][0]): array
148+
public function getInfoWithHttpInfo($id = null, $sr_name = null, string $contentType = self::contentTypes['getInfo'][0]): array
147149
{
148-
$request = $this->getInfoRequest($id, $contentType);
150+
$request = $this->getInfoRequest($id, $sr_name, $contentType);
149151

150152
try {
151153
$options = $this->createHttpClientOption();
@@ -216,14 +218,15 @@ public function getInfoWithHttpInfo($id, string $contentType = self::contentType
216218
*
217219
* Get thing info
218220
*
219-
* @param string $id (required)
221+
* @param string $id (optional)
222+
* @param string $sr_name (optional)
220223
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
221224
*
222225
* @throws \InvalidArgumentException
223226
*/
224-
public function getInfoAsync($id, string $contentType = self::contentTypes['getInfo'][0]): \GuzzleHttp\Promise\PromiseInterface
227+
public function getInfoAsync($id = null, $sr_name = null, string $contentType = self::contentTypes['getInfo'][0]): \GuzzleHttp\Promise\PromiseInterface
225228
{
226-
return $this->getInfoAsyncWithHttpInfo($id, $contentType)
229+
return $this->getInfoAsyncWithHttpInfo($id, $sr_name, $contentType)
227230
->then(
228231
static function ($response) {
229232
return $response[0];
@@ -237,15 +240,16 @@ static function ($response) {
237240
*
238241
* Get thing info
239242
*
240-
* @param string $id (required)
243+
* @param string $id (optional)
244+
* @param string $sr_name (optional)
241245
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
242246
*
243247
* @throws \InvalidArgumentException
244248
*/
245-
public function getInfoAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getInfo'][0]): \GuzzleHttp\Promise\PromiseInterface
249+
public function getInfoAsyncWithHttpInfo($id = null, $sr_name = null, string $contentType = self::contentTypes['getInfo'][0]): \GuzzleHttp\Promise\PromiseInterface
246250
{
247251
$returnType = '\Sigwin\RedditClient\Model\ListingEnvelope';
248-
$request = $this->getInfoRequest($id, $contentType);
252+
$request = $this->getInfoRequest($id, $sr_name, $contentType);
249253

250254
return $this->client
251255
->sendAsync($request, $this->createHttpClientOption())
@@ -278,18 +282,14 @@ static function ($exception): void {
278282
/**
279283
* Create request for operation 'getInfo'.
280284
*
281-
* @param string $id (required)
285+
* @param string $id (optional)
286+
* @param string $sr_name (optional)
282287
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInfo'] to see the possible values for this operation
283288
*
284289
* @throws \InvalidArgumentException
285290
*/
286-
public function getInfoRequest($id, string $contentType = self::contentTypes['getInfo'][0]): Request
291+
public function getInfoRequest($id = null, $sr_name = null, string $contentType = self::contentTypes['getInfo'][0]): Request
287292
{
288-
// verify the required parameter 'id' is set
289-
if ($id === null || (\is_array($id) && \count($id) === 0)) {
290-
throw new \InvalidArgumentException('Missing the required parameter $id when calling getInfo');
291-
}
292-
293293
$resourcePath = '/api/info';
294294
$formParams = [];
295295
$queryParams = [];
@@ -304,7 +304,16 @@ public function getInfoRequest($id, string $contentType = self::contentTypes['ge
304304
'string', // openApiType
305305
'', // style
306306
false, // explode
307-
true // required
307+
false // required
308+
) ?? []);
309+
// query params
310+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
311+
$sr_name,
312+
'sr_name', // param base name
313+
'string', // openApiType
314+
'', // style
315+
false, // explode
316+
false // required
308317
) ?? []);
309318

310319
$headers = $this->headerSelector->selectHeaders(

0 commit comments

Comments
 (0)