|
| 1 | +# voucherify.BinApi |
| 2 | + |
| 3 | +All URIs are relative to *https://api.voucherify.io* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**delete_bin_entry**](BinApi.md#delete_bin_entry) | **DELETE** /v1/trash-bin/{binEntryId} | Delete Bin Entry |
| 8 | +[**list_bin_entries**](BinApi.md#list_bin_entries) | **GET** /v1/trash-bin | List Bin Entries |
| 9 | + |
| 10 | + |
| 11 | +# **delete_bin_entry** |
| 12 | +> delete_bin_entry(bin_entry_id) |
| 13 | +
|
| 14 | +Delete Bin Entry |
| 15 | + |
| 16 | +Deletes permanently a bin entry with a given ID.The following resources can be moved to the bin and permanently deleted: - campaigns - vouchers - products - SKUs To use this endpoint and delete a given resource type, you must have the following permissions: - vouchers.delete to delete a voucher, - campaigns.delete to delete a campaign, - products.delete to delete a product or SKU. |
| 17 | + |
| 18 | +### Example |
| 19 | + |
| 20 | +* Api Key Authentication (X-App-Id): |
| 21 | +* Api Key Authentication (X-App-Token): |
| 22 | + |
| 23 | +```python |
| 24 | +import voucherify |
| 25 | +from voucherify.rest import ApiException |
| 26 | +from pprint import pprint |
| 27 | + |
| 28 | +# Defining the host is optional and defaults to https://api.voucherify.io |
| 29 | +# See configuration.py for a list of all supported configuration parameters. |
| 30 | +configuration = voucherify.Configuration( |
| 31 | + host = "https://api.voucherify.io" |
| 32 | +) |
| 33 | + |
| 34 | +# The client must configure the authentication and authorization parameters |
| 35 | +# in accordance with the API server security policy. |
| 36 | +# Examples for each auth method are provided below, use the example that |
| 37 | +# satisfies your auth use case. |
| 38 | + |
| 39 | +# Configure API key authorization: X-App-Id |
| 40 | +configuration.api_key['X-App-Id'] = os.environ["API_KEY"] |
| 41 | + |
| 42 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 43 | +# configuration.api_key_prefix['X-App-Id'] = 'Bearer' |
| 44 | + |
| 45 | +# Configure API key authorization: X-App-Token |
| 46 | +configuration.api_key['X-App-Token'] = os.environ["API_KEY"] |
| 47 | + |
| 48 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 49 | +# configuration.api_key_prefix['X-App-Token'] = 'Bearer' |
| 50 | + |
| 51 | +# Enter a context with an instance of the API client |
| 52 | +with voucherify.ApiClient(configuration) as api_client: |
| 53 | + # Create an instance of the API class |
| 54 | + api_instance = voucherify.BinApi(api_client) |
| 55 | + bin_entry_id = 'bin_entry_id_example' # str | Provide the unique identifier of the bin entry. |
| 56 | + |
| 57 | + try: |
| 58 | + # Delete Bin Entry |
| 59 | + api_instance.delete_bin_entry(bin_entry_id) |
| 60 | + except Exception as e: |
| 61 | + print("Exception when calling BinApi->delete_bin_entry: %s\n" % e) |
| 62 | +``` |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +### Parameters |
| 67 | + |
| 68 | + |
| 69 | +Name | Type | Description | Notes |
| 70 | +------------- | ------------- | ------------- | ------------- |
| 71 | + **bin_entry_id** | **str**| Provide the unique identifier of the bin entry. | |
| 72 | + |
| 73 | +### Return type |
| 74 | + |
| 75 | +void (empty response body) |
| 76 | + |
| 77 | +### Authorization |
| 78 | + |
| 79 | +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) |
| 80 | + |
| 81 | +### HTTP request headers |
| 82 | + |
| 83 | + - **Content-Type**: Not defined |
| 84 | + - **Accept**: Not defined |
| 85 | + |
| 86 | +### HTTP response details |
| 87 | + |
| 88 | +| Status code | Description | Response headers | |
| 89 | +|-------------|-------------|------------------| |
| 90 | +**2XX** | Returns no content if deletion is successful. | - | |
| 91 | + |
| 92 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 93 | + |
| 94 | +# **list_bin_entries** |
| 95 | +> TrashBinListResponseBody list_bin_entries(limit=limit, order=order, starting_after_id=starting_after_id, filters=filters) |
| 96 | +
|
| 97 | +List Bin Entries |
| 98 | + |
| 99 | +Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read |
| 100 | + |
| 101 | +### Example |
| 102 | + |
| 103 | +* Api Key Authentication (X-App-Id): |
| 104 | +* Api Key Authentication (X-App-Token): |
| 105 | + |
| 106 | +```python |
| 107 | +import voucherify |
| 108 | +from voucherify.models.parameter_filters_list_bin import ParameterFiltersListBin |
| 109 | +from voucherify.models.parameter_order_list_bin import ParameterOrderListBin |
| 110 | +from voucherify.models.trash_bin_list_response_body import TrashBinListResponseBody |
| 111 | +from voucherify.rest import ApiException |
| 112 | +from pprint import pprint |
| 113 | + |
| 114 | +# Defining the host is optional and defaults to https://api.voucherify.io |
| 115 | +# See configuration.py for a list of all supported configuration parameters. |
| 116 | +configuration = voucherify.Configuration( |
| 117 | + host = "https://api.voucherify.io" |
| 118 | +) |
| 119 | + |
| 120 | +# The client must configure the authentication and authorization parameters |
| 121 | +# in accordance with the API server security policy. |
| 122 | +# Examples for each auth method are provided below, use the example that |
| 123 | +# satisfies your auth use case. |
| 124 | + |
| 125 | +# Configure API key authorization: X-App-Id |
| 126 | +configuration.api_key['X-App-Id'] = os.environ["API_KEY"] |
| 127 | + |
| 128 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 129 | +# configuration.api_key_prefix['X-App-Id'] = 'Bearer' |
| 130 | + |
| 131 | +# Configure API key authorization: X-App-Token |
| 132 | +configuration.api_key['X-App-Token'] = os.environ["API_KEY"] |
| 133 | + |
| 134 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 135 | +# configuration.api_key_prefix['X-App-Token'] = 'Bearer' |
| 136 | + |
| 137 | +# Enter a context with an instance of the API client |
| 138 | +with voucherify.ApiClient(configuration) as api_client: |
| 139 | + # Create an instance of the API class |
| 140 | + api_instance = voucherify.BinApi(api_client) |
| 141 | + limit = 56 # int | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional) |
| 142 | + order = voucherify.ParameterOrderListBin() # ParameterOrderListBin | Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. (optional) |
| 143 | + starting_after_id = 'starting_after_id_example' # str | A cursor for pagination. It retrieves the events starting after an event with the given ID. (optional) |
| 144 | + filters = voucherify.ParameterFiltersListBin() # ParameterFiltersListBin | Filters for listing bin entries. (optional) |
| 145 | + |
| 146 | + try: |
| 147 | + # List Bin Entries |
| 148 | + api_response = api_instance.list_bin_entries(limit=limit, order=order, starting_after_id=starting_after_id, filters=filters) |
| 149 | + print("The response of BinApi->list_bin_entries:\n") |
| 150 | + pprint(api_response) |
| 151 | + except Exception as e: |
| 152 | + print("Exception when calling BinApi->list_bin_entries: %s\n" % e) |
| 153 | +``` |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +### Parameters |
| 158 | + |
| 159 | + |
| 160 | +Name | Type | Description | Notes |
| 161 | +------------- | ------------- | ------------- | ------------- |
| 162 | + **limit** | **int**| Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| 163 | + **order** | [**ParameterOrderListBin**](.md)| Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. | [optional] |
| 164 | + **starting_after_id** | **str**| A cursor for pagination. It retrieves the events starting after an event with the given ID. | [optional] |
| 165 | + **filters** | [**ParameterFiltersListBin**](.md)| Filters for listing bin entries. | [optional] |
| 166 | + |
| 167 | +### Return type |
| 168 | + |
| 169 | +[**TrashBinListResponseBody**](TrashBinListResponseBody.md) |
| 170 | + |
| 171 | +### Authorization |
| 172 | + |
| 173 | +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) |
| 174 | + |
| 175 | +### HTTP request headers |
| 176 | + |
| 177 | + - **Content-Type**: Not defined |
| 178 | + - **Accept**: application/json |
| 179 | + |
| 180 | +### HTTP response details |
| 181 | + |
| 182 | +| Status code | Description | Response headers | |
| 183 | +|-------------|-------------|------------------| |
| 184 | +**2XX** | Returns the list of all the bin entries matching the query parameters. | - | |
| 185 | + |
| 186 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 187 | + |
0 commit comments