Skip to content

Commit b6b0c52

Browse files
committed
Auto-generate wrapper from updated spec
1 parent ef79f42 commit b6b0c52

12 files changed

Lines changed: 2543 additions & 0 deletions

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Class | Method | HTTP request | Description
103103
*ResourcesCreatorApi* | [**getV2ResourcesCreatorStores**](docs/Api/ResourcesCreatorApi.md#getv2resourcescreatorstores) | **GET** /v2/resources/creator/stores | Fetch a list of your stores
104104
*ResourcesCreatorApi* | [**getV2ResourcesCreatorUpdates**](docs/Api/ResourcesCreatorApi.md#getv2resourcescreatorupdates) | **GET** /v2/resources/creator/updates | Fetch a list of your resource's updates
105105
*ResourcesCreatorApi* | [**getV2ResourcesCreatorVersions**](docs/Api/ResourcesCreatorApi.md#getv2resourcescreatorversions) | **GET** /v2/resources/creator/versions | Fetch a list of your resources' versions
106+
*ResourcesCreatorApi* | [**postV2ResourcesCreatorCoupons**](docs/Api/ResourcesCreatorApi.md#postv2resourcescreatorcoupons) | **POST** /v2/resources/creator/coupons | Create a new coupon
106107
*ResourcesCreatorApi* | [**postV2ResourcesCreatorUpdate**](docs/Api/ResourcesCreatorApi.md#postv2resourcescreatorupdate) | **POST** /v2/resources/creator/update | Post a resource update
107108
*ResourcesDiscoveryApi* | [**getResourcesDiscoverCategories**](docs/Api/ResourcesDiscoveryApi.md#getresourcesdiscovercategories) | **GET** /v2/resources/discover/categories | Fetch a list of categories
108109
*ResourcesDiscoveryApi* | [**getResourcesDiscoverResources**](docs/Api/ResourcesDiscoveryApi.md#getresourcesdiscoverresources) | **GET** /v2/resources/discover/resources | Fetch a list of resources
@@ -189,6 +190,9 @@ Class | Method | HTTP request | Description
189190
- [PostV2ResourcesCreatorBatch200ResponseData](docs/Model/PostV2ResourcesCreatorBatch200ResponseData.md)
190191
- [PostV2ResourcesCreatorBatchRequest](docs/Model/PostV2ResourcesCreatorBatchRequest.md)
191192
- [PostV2ResourcesCreatorBatchRequestChangesInner](docs/Model/PostV2ResourcesCreatorBatchRequestChangesInner.md)
193+
- [PostV2ResourcesCreatorCoupons200Response](docs/Model/PostV2ResourcesCreatorCoupons200Response.md)
194+
- [PostV2ResourcesCreatorCoupons200ResponseData](docs/Model/PostV2ResourcesCreatorCoupons200ResponseData.md)
195+
- [PostV2ResourcesCreatorCouponsRequest](docs/Model/PostV2ResourcesCreatorCouponsRequest.md)
192196
- [PostV2ResourcesCreatorUpdate200Response](docs/Model/PostV2ResourcesCreatorUpdate200Response.md)
193197
- [PostV2ResourcesCreatorUpdate200ResponseData](docs/Model/PostV2ResourcesCreatorUpdate200ResponseData.md)
194198
- [PostV2ResourcesCreatorUpdateRequest](docs/Model/PostV2ResourcesCreatorUpdateRequest.md)

docs/Api/ResourcesCreatorApi.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ All URIs are relative to https://api.builtbybit.com, except if the operation def
1515
| [**getV2ResourcesCreatorStores()**](ResourcesCreatorApi.md#getV2ResourcesCreatorStores) | **GET** /v2/resources/creator/stores | Fetch a list of your stores |
1616
| [**getV2ResourcesCreatorUpdates()**](ResourcesCreatorApi.md#getV2ResourcesCreatorUpdates) | **GET** /v2/resources/creator/updates | Fetch a list of your resource's updates |
1717
| [**getV2ResourcesCreatorVersions()**](ResourcesCreatorApi.md#getV2ResourcesCreatorVersions) | **GET** /v2/resources/creator/versions | Fetch a list of your resources' versions |
18+
| [**postV2ResourcesCreatorCoupons()**](ResourcesCreatorApi.md#postV2ResourcesCreatorCoupons) | **POST** /v2/resources/creator/coupons | Create a new coupon |
1819
| [**postV2ResourcesCreatorUpdate()**](ResourcesCreatorApi.md#postV2ResourcesCreatorUpdate) | **POST** /v2/resources/creator/update | Post a resource update |
1920

2021

@@ -664,6 +665,68 @@ try {
664665
[[Back to Model list]](../../README.md#models)
665666
[[Back to README]](../../README.md)
666667

668+
## `postV2ResourcesCreatorCoupons()`
669+
670+
```php
671+
postV2ResourcesCreatorCoupons($post_v2_resources_creator_coupons_request): \OpenAPI\Client\Model\PostV2ResourcesCreatorCoupons200Response
672+
```
673+
674+
Create a new coupon
675+
676+
This endpoint is currently limited to percent-based coupons with a maximum discount of 50%.
677+
678+
### Example
679+
680+
```php
681+
<?php
682+
require_once(__DIR__ . '/vendor/autoload.php');
683+
684+
685+
// Configure API key authorization: token
686+
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
687+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
688+
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
689+
690+
691+
$apiInstance = new OpenAPI\Client\Api\ResourcesCreatorApi(
692+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
693+
// This is optional, `GuzzleHttp\Client` will be used as default.
694+
new GuzzleHttp\Client(),
695+
$config
696+
);
697+
$post_v2_resources_creator_coupons_request = new \OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest(); // \OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest
698+
699+
try {
700+
$result = $apiInstance->postV2ResourcesCreatorCoupons($post_v2_resources_creator_coupons_request);
701+
print_r($result);
702+
} catch (Exception $e) {
703+
echo 'Exception when calling ResourcesCreatorApi->postV2ResourcesCreatorCoupons: ', $e->getMessage(), PHP_EOL;
704+
}
705+
```
706+
707+
### Parameters
708+
709+
| Name | Type | Description | Notes |
710+
| ------------- | ------------- | ------------- | ------------- |
711+
| **post_v2_resources_creator_coupons_request** | [**\OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest**](../Model/PostV2ResourcesCreatorCouponsRequest.md)| | [optional] |
712+
713+
### Return type
714+
715+
[**\OpenAPI\Client\Model\PostV2ResourcesCreatorCoupons200Response**](../Model/PostV2ResourcesCreatorCoupons200Response.md)
716+
717+
### Authorization
718+
719+
[token](../../README.md#token)
720+
721+
### HTTP request headers
722+
723+
- **Content-Type**: `application/json`
724+
- **Accept**: `application/json`
725+
726+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
727+
[[Back to Model list]](../../README.md#models)
728+
[[Back to README]](../../README.md)
729+
667730
## `postV2ResourcesCreatorUpdate()`
668731

669732
```php
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# # PostV2ResourcesCreatorCoupons200Response
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**result** | **string** | | [optional]
8+
**data** | [**\OpenAPI\Client\Model\PostV2ResourcesCreatorCoupons200ResponseData**](PostV2ResourcesCreatorCoupons200ResponseData.md) | | [optional]
9+
10+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# # PostV2ResourcesCreatorCoupons200ResponseData
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**coupon** | [**\OpenAPI\Client\Model\Coupon**](Coupon.md) | | [optional]
8+
9+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# # PostV2ResourcesCreatorCouponsRequest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**type** | **string** | Must be &#39;perecent&#39;. |
8+
**discount** | **float** | |
9+
**label** | **string** | The trailing part of the coupon code (without &#39;{user_id}-&#39;). |
10+
**do_expiry** | **bool** | Whether or not to respect the &#39;expiry_date&#39; field. No expiry date is set otherwise. | [optional]
11+
**expiry_date** | **string** | | [optional]
12+
**limited_uses** | **bool** | Whether or not to respect the &#39;max_uses&#39; field. No max use limit is set otherwise. | [optional]
13+
**max_uses** | **int** | | [optional]
14+
**limited_user_uses** | **bool** | Whether or not to respect the &#39;max_per_user_uses&#39; field. No max uses per user limit is set otherwise. | [optional]
15+
**max_per_user_uses** | **int** | | [optional]
16+
**all_content_types** | **string[]** | If a content type is included, all of the creator&#39;s content (of that type) can be used against this coupon. Support values include: &#39;resource&#39;, &#39;addon&#39;, and &#39;bundle&#39; | [optional]
17+
**resources** | **string** | A comma-separated list of resource IDs which this coupon can be used against. | [optional]
18+
**addons** | **string** | A comma-separated list of addon IDs which this coupon can be used against. | [optional]
19+
**bundles** | **string** | A comma-separated list of bundle IDs which this coupon can be used against. | [optional]
20+
21+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

0 commit comments

Comments
 (0)