Skip to content

Commit 79bd84a

Browse files
committed
Spec 1.2.0
1 parent f171357 commit 79bd84a

File tree

7 files changed

+491
-32
lines changed

7 files changed

+491
-32
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,19 @@ require_once(__DIR__ . '/vendor/autoload.php');
5454
$config = Sigwin\RedditClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
5555

5656

57-
$apiInstance = new Sigwin\RedditClient\Api\UserApi(
57+
$apiInstance = new Sigwin\RedditClient\Api\ThingApi(
5858
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
5959
// This is optional, `GuzzleHttp\Client` will be used as default.
6060
new GuzzleHttp\Client(),
6161
$config
6262
);
63-
$username = snoo; // string
64-
$after = 'after_example'; // string
65-
$before = 'before_example'; // string
66-
$limit = 25; // int
63+
$id = t3_11e9mr5; // string
6764

6865
try {
69-
$result = $apiInstance->getSaved($username, $after, $before, $limit);
66+
$result = $apiInstance->getInfo($id);
7067
print_r($result);
7168
} catch (Exception $e) {
72-
echo 'Exception when calling UserApi->getSaved: ', $e->getMessage(), PHP_EOL;
69+
echo 'Exception when calling ThingApi->getInfo: ', $e->getMessage(), PHP_EOL;
7370
}
7471

7572
```
@@ -80,8 +77,9 @@ All URIs are relative to *https://oauth.reddit.com*
8077

8178
Class | Method | HTTP request | Description
8279
------------ | ------------- | ------------- | -------------
80+
*ThingApi* | [**getInfo**](docs/Api/ThingApi.md#getinfo) | **GET** /api/info | Get thing info
8381
*UserApi* | [**getSaved**](docs/Api/UserApi.md#getsaved) | **GET** /user/{username}/saved | Get user saved things
84-
*UserApi* | [**me**](docs/Api/UserApi.md#me) | **GET** /me | Returns the identity of the user.
82+
*UserApi* | [**me**](docs/Api/UserApi.md#me) | **GET** /api/me | Returns the identity of the user.
8583

8684
## Models
8785

docs/Api/ThingApi.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Sigwin\RedditClient\ThingApi
2+
3+
All URIs are relative to https://oauth.reddit.com.
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**getInfo()**](ThingApi.md#getInfo) | **GET** /api/info | Get thing info
8+
9+
10+
## `getInfo()`
11+
12+
```php
13+
getInfo($id): \Sigwin\RedditClient\Model\ListingEnvelope
14+
```
15+
16+
Get thing info
17+
18+
### Example
19+
20+
```php
21+
<?php
22+
require_once(__DIR__ . '/vendor/autoload.php');
23+
24+
25+
// Configure OAuth2 access token for authorization: oauth2
26+
$config = Sigwin\RedditClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
27+
28+
29+
$apiInstance = new Sigwin\RedditClient\Api\ThingApi(
30+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
31+
// This is optional, `GuzzleHttp\Client` will be used as default.
32+
new GuzzleHttp\Client(),
33+
$config
34+
);
35+
$id = t3_11e9mr5; // string
36+
37+
try {
38+
$result = $apiInstance->getInfo($id);
39+
print_r($result);
40+
} catch (Exception $e) {
41+
echo 'Exception when calling ThingApi->getInfo: ', $e->getMessage(), PHP_EOL;
42+
}
43+
```
44+
45+
### Parameters
46+
47+
Name | Type | Description | Notes
48+
------------- | ------------- | ------------- | -------------
49+
**id** | **string**| |
50+
51+
### Return type
52+
53+
[**\Sigwin\RedditClient\Model\ListingEnvelope**](../Model/ListingEnvelope.md)
54+
55+
### Authorization
56+
57+
[oauth2](../../README.md#oauth2)
58+
59+
### HTTP request headers
60+
61+
- **Content-Type**: Not defined
62+
- **Accept**: `application/json`
63+
64+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
65+
[[Back to Model list]](../../README.md#models)
66+
[[Back to README]](../../README.md)

docs/Api/UserApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All URIs are relative to https://oauth.reddit.com.
55
Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**getSaved()**](UserApi.md#getSaved) | **GET** /user/{username}/saved | Get user saved things
8-
[**me()**](UserApi.md#me) | **GET** /me | Returns the identity of the user.
8+
[**me()**](UserApi.md#me) | **GET** /api/me | Returns the identity of the user.
99

1010

1111
## `getSaved()`

0 commit comments

Comments
 (0)