Skip to content

Commit 8ce281b

Browse files
committed
Auto-generate wrapper from updated spec
1 parent 716e71c commit 8ce281b

4 files changed

Lines changed: 98 additions & 11 deletions

File tree

‎docs/Api/ResourcesDiscoverApi.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ try {
8080
## `getResourcesDiscoverResources()`
8181

8282
```php
83-
getResourcesDiscoverResources($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids): \OpenAPI\Client\Model\GetResourcesDiscoverResources200Response
83+
getResourcesDiscoverResources($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $min_referrer_rate): \OpenAPI\Client\Model\GetResourcesDiscoverResources200Response
8484
```
8585

8686
Fetch a list of resources
@@ -115,9 +115,10 @@ $per_page = 25; // float | The number of resources to return per page.
115115
$no_dependencies = True; // bool | Whether or not to exclude resources with dependencies listed.
116116
$excluded_resource_ids = 'excluded_resource_ids_example'; // string | A comma-separated list of resource IDs to exclude. No filter will be applied if empty.
117117
$excluded_creator_ids = 'excluded_creator_ids_example'; // string | A comma-separated list of creator IDs to exclude. No filter will be applied if empty.
118+
$min_referrer_rate = 56; // int | A minimum referral rate (percent) to filter on. Defaults to 0%.
118119

119120
try {
120-
$result = $apiInstance->getResourcesDiscoverResources($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids);
121+
$result = $apiInstance->getResourcesDiscoverResources($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $min_referrer_rate);
121122
print_r($result);
122123
} catch (Exception $e) {
123124
echo 'Exception when calling ResourcesDiscoverApi->getResourcesDiscoverResources: ', $e->getMessage(), PHP_EOL;
@@ -137,6 +138,7 @@ try {
137138
| **no_dependencies** | **bool**| Whether or not to exclude resources with dependencies listed. | [optional] |
138139
| **excluded_resource_ids** | **string**| A comma-separated list of resource IDs to exclude. No filter will be applied if empty. | [optional] |
139140
| **excluded_creator_ids** | **string**| A comma-separated list of creator IDs to exclude. No filter will be applied if empty. | [optional] |
141+
| **min_referrer_rate** | **int**| A minimum referral rate (percent) to filter on. Defaults to 0%. | [optional] |
140142

141143
### Return type
142144

‎docs/Model/Resource.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Name | Type | Description | Notes
88
**title** | **string** | | [optional]
99
**summary** | **string** | | [optional]
1010
**url** | **string** | | [optional]
11+
**referrer_url** | **string** | | [optional]
12+
**referrer_rate** | **int** | | [optional]
1113
**creator_id** | **int** | | [optional]
1214
**published_at** | **int** | | [optional]
1315
**last_updated_at** | **int** | | [optional]

‎lib/Api/ResourcesDiscoverApi.php‎

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -480,15 +480,16 @@ public function getResourcesDiscoverCategoriesRequest($category_id = null, $with
480480
* @param bool $no_dependencies Whether or not to exclude resources with dependencies listed. (optional)
481481
* @param string $excluded_resource_ids A comma-separated list of resource IDs to exclude. No filter will be applied if empty. (optional)
482482
* @param string $excluded_creator_ids A comma-separated list of creator IDs to exclude. No filter will be applied if empty. (optional)
483+
* @param int $min_referrer_rate A minimum referral rate (percent) to filter on. Defaults to 0%. (optional)
483484
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getResourcesDiscoverResources'] to see the possible values for this operation
484485
*
485486
* @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format
486487
* @throws \InvalidArgumentException
487488
* @return \OpenAPI\Client\Model\GetResourcesDiscoverResources200Response|\OpenAPI\Client\Model\GetResourcesDiscoverResources4XXResponse|\OpenAPI\Client\Model\GetResourcesDiscoverResources4XXResponse
488489
*/
489-
public function getResourcesDiscoverResources($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
490+
public function getResourcesDiscoverResources($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, $min_referrer_rate = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
490491
{
491-
list($response) = $this->getResourcesDiscoverResourcesWithHttpInfo($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $contentType);
492+
list($response) = $this->getResourcesDiscoverResourcesWithHttpInfo($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $min_referrer_rate, $contentType);
492493
return $response;
493494
}
494495

@@ -506,15 +507,16 @@ public function getResourcesDiscoverResources($category_id = null, $with = null,
506507
* @param bool $no_dependencies Whether or not to exclude resources with dependencies listed. (optional)
507508
* @param string $excluded_resource_ids A comma-separated list of resource IDs to exclude. No filter will be applied if empty. (optional)
508509
* @param string $excluded_creator_ids A comma-separated list of creator IDs to exclude. No filter will be applied if empty. (optional)
510+
* @param int $min_referrer_rate A minimum referral rate (percent) to filter on. Defaults to 0%. (optional)
509511
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getResourcesDiscoverResources'] to see the possible values for this operation
510512
*
511513
* @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format
512514
* @throws \InvalidArgumentException
513515
* @return array of \OpenAPI\Client\Model\GetResourcesDiscoverResources200Response|\OpenAPI\Client\Model\GetResourcesDiscoverResources4XXResponse|\OpenAPI\Client\Model\GetResourcesDiscoverResources4XXResponse, HTTP status code, HTTP response headers (array of strings)
514516
*/
515-
public function getResourcesDiscoverResourcesWithHttpInfo($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
517+
public function getResourcesDiscoverResourcesWithHttpInfo($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, $min_referrer_rate = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
516518
{
517-
$request = $this->getResourcesDiscoverResourcesRequest($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $contentType);
519+
$request = $this->getResourcesDiscoverResourcesRequest($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $min_referrer_rate, $contentType);
518520

519521
try {
520522
$options = $this->createHttpClientOption();
@@ -642,14 +644,15 @@ public function getResourcesDiscoverResourcesWithHttpInfo($category_id = null, $
642644
* @param bool $no_dependencies Whether or not to exclude resources with dependencies listed. (optional)
643645
* @param string $excluded_resource_ids A comma-separated list of resource IDs to exclude. No filter will be applied if empty. (optional)
644646
* @param string $excluded_creator_ids A comma-separated list of creator IDs to exclude. No filter will be applied if empty. (optional)
647+
* @param int $min_referrer_rate A minimum referral rate (percent) to filter on. Defaults to 0%. (optional)
645648
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getResourcesDiscoverResources'] to see the possible values for this operation
646649
*
647650
* @throws \InvalidArgumentException
648651
* @return \GuzzleHttp\Promise\PromiseInterface
649652
*/
650-
public function getResourcesDiscoverResourcesAsync($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
653+
public function getResourcesDiscoverResourcesAsync($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, $min_referrer_rate = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
651654
{
652-
return $this->getResourcesDiscoverResourcesAsyncWithHttpInfo($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $contentType)
655+
return $this->getResourcesDiscoverResourcesAsyncWithHttpInfo($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $min_referrer_rate, $contentType)
653656
->then(
654657
function ($response) {
655658
return $response[0];
@@ -671,15 +674,16 @@ function ($response) {
671674
* @param bool $no_dependencies Whether or not to exclude resources with dependencies listed. (optional)
672675
* @param string $excluded_resource_ids A comma-separated list of resource IDs to exclude. No filter will be applied if empty. (optional)
673676
* @param string $excluded_creator_ids A comma-separated list of creator IDs to exclude. No filter will be applied if empty. (optional)
677+
* @param int $min_referrer_rate A minimum referral rate (percent) to filter on. Defaults to 0%. (optional)
674678
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getResourcesDiscoverResources'] to see the possible values for this operation
675679
*
676680
* @throws \InvalidArgumentException
677681
* @return \GuzzleHttp\Promise\PromiseInterface
678682
*/
679-
public function getResourcesDiscoverResourcesAsyncWithHttpInfo($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
683+
public function getResourcesDiscoverResourcesAsyncWithHttpInfo($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, $min_referrer_rate = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
680684
{
681685
$returnType = '\OpenAPI\Client\Model\GetResourcesDiscoverResources200Response';
682-
$request = $this->getResourcesDiscoverResourcesRequest($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $contentType);
686+
$request = $this->getResourcesDiscoverResourcesRequest($category_id, $with, $filters, $resource_ids, $page, $per_page, $no_dependencies, $excluded_resource_ids, $excluded_creator_ids, $min_referrer_rate, $contentType);
683687

684688
return $this->client
685689
->sendAsync($request, $this->createHttpClientOption())
@@ -729,12 +733,13 @@ function ($exception) {
729733
* @param bool $no_dependencies Whether or not to exclude resources with dependencies listed. (optional)
730734
* @param string $excluded_resource_ids A comma-separated list of resource IDs to exclude. No filter will be applied if empty. (optional)
731735
* @param string $excluded_creator_ids A comma-separated list of creator IDs to exclude. No filter will be applied if empty. (optional)
736+
* @param int $min_referrer_rate A minimum referral rate (percent) to filter on. Defaults to 0%. (optional)
732737
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getResourcesDiscoverResources'] to see the possible values for this operation
733738
*
734739
* @throws \InvalidArgumentException
735740
* @return \GuzzleHttp\Psr7\Request
736741
*/
737-
public function getResourcesDiscoverResourcesRequest($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
742+
public function getResourcesDiscoverResourcesRequest($category_id = null, $with = null, $filters = null, $resource_ids = null, $page = 1, $per_page = 25, $no_dependencies = null, $excluded_resource_ids = null, $excluded_creator_ids = null, $min_referrer_rate = null, string $contentType = self::contentTypes['getResourcesDiscoverResources'][0])
738743
{
739744

740745

@@ -750,6 +755,7 @@ public function getResourcesDiscoverResourcesRequest($category_id = null, $with
750755

751756

752757

758+
753759
$resourcePath = '/v2/resources/discover/resources';
754760
$formParams = [];
755761
$queryParams = [];
@@ -838,6 +844,15 @@ public function getResourcesDiscoverResourcesRequest($category_id = null, $with
838844
true, // explode
839845
false // required
840846
) ?? []);
847+
// query params
848+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
849+
$min_referrer_rate,
850+
'min_referrer_rate', // param base name
851+
'integer', // openApiType
852+
'form', // style
853+
true, // explode
854+
false // required
855+
) ?? []);
841856

842857

843858

‎lib/Model/Resource.php‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class Resource implements ModelInterface, ArrayAccess, \JsonSerializable
6262
'title' => 'string',
6363
'summary' => 'string',
6464
'url' => 'string',
65+
'referrer_url' => 'string',
66+
'referrer_rate' => 'int',
6567
'creator_id' => 'int',
6668
'published_at' => 'int',
6769
'last_updated_at' => 'int',
@@ -96,6 +98,8 @@ class Resource implements ModelInterface, ArrayAccess, \JsonSerializable
9698
'title' => null,
9799
'summary' => null,
98100
'url' => null,
101+
'referrer_url' => null,
102+
'referrer_rate' => null,
99103
'creator_id' => null,
100104
'published_at' => null,
101105
'last_updated_at' => null,
@@ -128,6 +132,8 @@ class Resource implements ModelInterface, ArrayAccess, \JsonSerializable
128132
'title' => false,
129133
'summary' => false,
130134
'url' => false,
135+
'referrer_url' => false,
136+
'referrer_rate' => false,
131137
'creator_id' => false,
132138
'published_at' => false,
133139
'last_updated_at' => false,
@@ -240,6 +246,8 @@ public function isNullableSetToNull(string $property): bool
240246
'title' => 'title',
241247
'summary' => 'summary',
242248
'url' => 'url',
249+
'referrer_url' => 'referrer_url',
250+
'referrer_rate' => 'referrer_rate',
243251
'creator_id' => 'creator_id',
244252
'published_at' => 'published_at',
245253
'last_updated_at' => 'last_updated_at',
@@ -272,6 +280,8 @@ public function isNullableSetToNull(string $property): bool
272280
'title' => 'setTitle',
273281
'summary' => 'setSummary',
274282
'url' => 'setUrl',
283+
'referrer_url' => 'setReferrerUrl',
284+
'referrer_rate' => 'setReferrerRate',
275285
'creator_id' => 'setCreatorId',
276286
'published_at' => 'setPublishedAt',
277287
'last_updated_at' => 'setLastUpdatedAt',
@@ -304,6 +314,8 @@ public function isNullableSetToNull(string $property): bool
304314
'title' => 'getTitle',
305315
'summary' => 'getSummary',
306316
'url' => 'getUrl',
317+
'referrer_url' => 'getReferrerUrl',
318+
'referrer_rate' => 'getReferrerRate',
307319
'creator_id' => 'getCreatorId',
308320
'published_at' => 'getPublishedAt',
309321
'last_updated_at' => 'getLastUpdatedAt',
@@ -387,6 +399,8 @@ public function __construct(array $data = null)
387399
$this->setIfExists('title', $data ?? [], null);
388400
$this->setIfExists('summary', $data ?? [], null);
389401
$this->setIfExists('url', $data ?? [], null);
402+
$this->setIfExists('referrer_url', $data ?? [], null);
403+
$this->setIfExists('referrer_rate', $data ?? [], null);
390404
$this->setIfExists('creator_id', $data ?? [], null);
391405
$this->setIfExists('published_at', $data ?? [], null);
392406
$this->setIfExists('last_updated_at', $data ?? [], null);
@@ -559,6 +573,60 @@ public function setUrl($url)
559573
return $this;
560574
}
561575

576+
/**
577+
* Gets referrer_url
578+
*
579+
* @return string|null
580+
*/
581+
public function getReferrerUrl()
582+
{
583+
return $this->container['referrer_url'];
584+
}
585+
586+
/**
587+
* Sets referrer_url
588+
*
589+
* @param string|null $referrer_url referrer_url
590+
*
591+
* @return self
592+
*/
593+
public function setReferrerUrl($referrer_url)
594+
{
595+
if (is_null($referrer_url)) {
596+
throw new \InvalidArgumentException('non-nullable referrer_url cannot be null');
597+
}
598+
$this->container['referrer_url'] = $referrer_url;
599+
600+
return $this;
601+
}
602+
603+
/**
604+
* Gets referrer_rate
605+
*
606+
* @return int|null
607+
*/
608+
public function getReferrerRate()
609+
{
610+
return $this->container['referrer_rate'];
611+
}
612+
613+
/**
614+
* Sets referrer_rate
615+
*
616+
* @param int|null $referrer_rate referrer_rate
617+
*
618+
* @return self
619+
*/
620+
public function setReferrerRate($referrer_rate)
621+
{
622+
if (is_null($referrer_rate)) {
623+
throw new \InvalidArgumentException('non-nullable referrer_rate cannot be null');
624+
}
625+
$this->container['referrer_rate'] = $referrer_rate;
626+
627+
return $this;
628+
}
629+
562630
/**
563631
* Gets creator_id
564632
*

0 commit comments

Comments
 (0)