hostinger-api-sdk 1.21.1 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api.ts +99 -1
- package/base.ts +1 -1
- package/common.ts +2 -2
- package/configuration.ts +2 -2
- package/dist/api.d.ts +323 -267
- package/dist/api.js +75 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +2 -2
- package/dist/esm/api.d.ts +323 -267
- package/dist/esm/api.js +75 -1
- package/dist/esm/base.d.ts +1 -1
- package/dist/esm/base.js +1 -1
- package/dist/esm/common.d.ts +1 -1
- package/dist/esm/common.js +1 -1
- package/dist/esm/configuration.d.ts +1 -1
- package/dist/esm/configuration.js +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/BillingSubscriptionsApi.md +59 -0
- package/docs/BillingV1SubscriptionRenewalRenewRequest.md +22 -0
- package/index.ts +1 -1
- package/package.json +1 -1
package/dist/esm/api.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.23.0
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -3311,6 +3311,41 @@ export const BillingSubscriptionsApiAxiosParamCreator = function (configuration)
|
|
|
3311
3311
|
options: localVarRequestOptions,
|
|
3312
3312
|
};
|
|
3313
3313
|
}),
|
|
3314
|
+
/**
|
|
3315
|
+
* Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
|
|
3316
|
+
* @summary Renew subscription
|
|
3317
|
+
* @param {string} subscriptionId Subscription ID
|
|
3318
|
+
* @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
|
|
3319
|
+
* @param {*} [options] Override http request option.
|
|
3320
|
+
* @throws {RequiredError}
|
|
3321
|
+
*/
|
|
3322
|
+
renewSubscriptionV1: (subscriptionId_1, billingV1SubscriptionRenewalRenewRequest_1, ...args_1) => __awaiter(this, [subscriptionId_1, billingV1SubscriptionRenewalRenewRequest_1, ...args_1], void 0, function* (subscriptionId, billingV1SubscriptionRenewalRenewRequest, options = {}) {
|
|
3323
|
+
// verify required parameter 'subscriptionId' is not null or undefined
|
|
3324
|
+
assertParamExists('renewSubscriptionV1', 'subscriptionId', subscriptionId);
|
|
3325
|
+
const localVarPath = `/api/billing/v1/subscriptions/{subscriptionId}/renew`
|
|
3326
|
+
.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(subscriptionId)));
|
|
3327
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3328
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3329
|
+
let baseOptions;
|
|
3330
|
+
if (configuration) {
|
|
3331
|
+
baseOptions = configuration.baseOptions;
|
|
3332
|
+
}
|
|
3333
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
3334
|
+
const localVarHeaderParameter = {};
|
|
3335
|
+
const localVarQueryParameter = {};
|
|
3336
|
+
// authentication apiToken required
|
|
3337
|
+
// http bearer authentication required
|
|
3338
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
3339
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
3340
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3341
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3342
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
3343
|
+
localVarRequestOptions.data = serializeDataIfNeeded(billingV1SubscriptionRenewalRenewRequest, localVarRequestOptions, configuration);
|
|
3344
|
+
return {
|
|
3345
|
+
url: toPathString(localVarUrlObj),
|
|
3346
|
+
options: localVarRequestOptions,
|
|
3347
|
+
};
|
|
3348
|
+
}),
|
|
3314
3349
|
};
|
|
3315
3350
|
};
|
|
3316
3351
|
/**
|
|
@@ -3364,6 +3399,22 @@ export const BillingSubscriptionsApiFp = function (configuration) {
|
|
|
3364
3399
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3365
3400
|
});
|
|
3366
3401
|
},
|
|
3402
|
+
/**
|
|
3403
|
+
* Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
|
|
3404
|
+
* @summary Renew subscription
|
|
3405
|
+
* @param {string} subscriptionId Subscription ID
|
|
3406
|
+
* @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
|
|
3407
|
+
* @param {*} [options] Override http request option.
|
|
3408
|
+
* @throws {RequiredError}
|
|
3409
|
+
*/
|
|
3410
|
+
renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options) {
|
|
3411
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3412
|
+
var _a, _b;
|
|
3413
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options);
|
|
3414
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['BillingSubscriptionsApi.renewSubscriptionV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
3415
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3416
|
+
});
|
|
3417
|
+
},
|
|
3367
3418
|
};
|
|
3368
3419
|
};
|
|
3369
3420
|
/**
|
|
@@ -3402,6 +3453,17 @@ export const BillingSubscriptionsApiFactory = function (configuration, basePath,
|
|
|
3402
3453
|
getSubscriptionListV1(options) {
|
|
3403
3454
|
return localVarFp.getSubscriptionListV1(options).then((request) => request(axios, basePath));
|
|
3404
3455
|
},
|
|
3456
|
+
/**
|
|
3457
|
+
* Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
|
|
3458
|
+
* @summary Renew subscription
|
|
3459
|
+
* @param {string} subscriptionId Subscription ID
|
|
3460
|
+
* @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
|
|
3461
|
+
* @param {*} [options] Override http request option.
|
|
3462
|
+
* @throws {RequiredError}
|
|
3463
|
+
*/
|
|
3464
|
+
renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options) {
|
|
3465
|
+
return localVarFp.renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options).then((request) => request(axios, basePath));
|
|
3466
|
+
},
|
|
3405
3467
|
};
|
|
3406
3468
|
};
|
|
3407
3469
|
/**
|
|
@@ -3443,6 +3505,18 @@ export class BillingSubscriptionsApi extends BaseAPI {
|
|
|
3443
3505
|
getSubscriptionListV1(options) {
|
|
3444
3506
|
return BillingSubscriptionsApiFp(this.configuration).getSubscriptionListV1(options).then((request) => request(this.axios, this.basePath));
|
|
3445
3507
|
}
|
|
3508
|
+
/**
|
|
3509
|
+
* Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
|
|
3510
|
+
* @summary Renew subscription
|
|
3511
|
+
* @param {string} subscriptionId Subscription ID
|
|
3512
|
+
* @param {BillingV1SubscriptionRenewalRenewRequest} [billingV1SubscriptionRenewalRenewRequest]
|
|
3513
|
+
* @param {*} [options] Override http request option.
|
|
3514
|
+
* @throws {RequiredError}
|
|
3515
|
+
* @memberof BillingSubscriptionsApi
|
|
3516
|
+
*/
|
|
3517
|
+
renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options) {
|
|
3518
|
+
return BillingSubscriptionsApiFp(this.configuration).renewSubscriptionV1(subscriptionId, billingV1SubscriptionRenewalRenewRequest, options).then((request) => request(this.axios, this.basePath));
|
|
3519
|
+
}
|
|
3446
3520
|
}
|
|
3447
3521
|
/**
|
|
3448
3522
|
* DNSSnapshotApi - axios parameter creator
|
package/dist/esm/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.
|
|
4
|
+
* API Version: 1.23.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/base.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.23.0
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/common.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.
|
|
4
|
+
* API Version: 1.23.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/common.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.23.0
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.
|
|
4
|
+
* API Version: 1.23.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.23.0
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -13,7 +13,7 @@ export class Configuration {
|
|
|
13
13
|
var _a;
|
|
14
14
|
this.accessToken = param.accessToken;
|
|
15
15
|
this.basePath = param.basePath;
|
|
16
|
-
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/1.
|
|
16
|
+
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/1.22.1" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
|
|
17
17
|
this.formDataCtor = param.formDataCtor;
|
|
18
18
|
}
|
|
19
19
|
/**
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.
|
|
4
|
+
* API Version: 1.23.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.23.0
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.
|
|
4
|
+
* API Version: 1.23.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Hostinger API
|
|
6
6
|
*
|
|
7
|
-
* API Version: 1.
|
|
7
|
+
* API Version: 1.23.0
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
10
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -7,6 +7,7 @@ All URIs are relative to *https://developers.hostinger.com*
|
|
|
7
7
|
|[**disableAutoRenewalV1**](#disableautorenewalv1) | **DELETE** /api/billing/v1/subscriptions/{subscriptionId}/auto-renewal/disable | Disable auto-renewal|
|
|
8
8
|
|[**enableAutoRenewalV1**](#enableautorenewalv1) | **PATCH** /api/billing/v1/subscriptions/{subscriptionId}/auto-renewal/enable | Enable auto-renewal|
|
|
9
9
|
|[**getSubscriptionListV1**](#getsubscriptionlistv1) | **GET** /api/billing/v1/subscriptions | Get subscription list|
|
|
10
|
+
|[**renewSubscriptionV1**](#renewsubscriptionv1) | **POST** /api/billing/v1/subscriptions/{subscriptionId}/renew | Renew subscription|
|
|
10
11
|
|
|
11
12
|
# **disableAutoRenewalV1**
|
|
12
13
|
> BillingV1SubscriptionSubscriptionResource disableAutoRenewalV1()
|
|
@@ -160,3 +161,61 @@ This endpoint does not have any parameters.
|
|
|
160
161
|
|
|
161
162
|
[[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)
|
|
162
163
|
|
|
164
|
+
# **renewSubscriptionV1**
|
|
165
|
+
> BillingV1OrderOrderResource renewSubscriptionV1()
|
|
166
|
+
|
|
167
|
+
Create a renewal order for an existing Hostinger subscription. This endpoint places a renewal order for a single subscription, leveraging the existing billing infrastructure. Use the [subscriptions endpoint](#tag/billing-subscriptions) to look up the `subscriptionId` values available for renewal. If no payment method is provided, your default payment method will be used automatically. Use this endpoint to renew any subscription available in your account.
|
|
168
|
+
|
|
169
|
+
### Example
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
import {
|
|
173
|
+
BillingSubscriptionsApi,
|
|
174
|
+
Configuration,
|
|
175
|
+
BillingV1SubscriptionRenewalRenewRequest
|
|
176
|
+
} from 'hostinger-api-sdk';
|
|
177
|
+
|
|
178
|
+
const configuration = new Configuration();
|
|
179
|
+
const apiInstance = new BillingSubscriptionsApi(configuration);
|
|
180
|
+
|
|
181
|
+
let subscriptionId: string; //Subscription ID (default to undefined)
|
|
182
|
+
let billingV1SubscriptionRenewalRenewRequest: BillingV1SubscriptionRenewalRenewRequest; // (optional)
|
|
183
|
+
|
|
184
|
+
const { status, data } = await apiInstance.renewSubscriptionV1(
|
|
185
|
+
subscriptionId,
|
|
186
|
+
billingV1SubscriptionRenewalRenewRequest
|
|
187
|
+
);
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Parameters
|
|
191
|
+
|
|
192
|
+
|Name | Type | Description | Notes|
|
|
193
|
+
|------------- | ------------- | ------------- | -------------|
|
|
194
|
+
| **billingV1SubscriptionRenewalRenewRequest** | **BillingV1SubscriptionRenewalRenewRequest**| | |
|
|
195
|
+
| **subscriptionId** | [**string**] | Subscription ID | defaults to undefined|
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
### Return type
|
|
199
|
+
|
|
200
|
+
**BillingV1OrderOrderResource**
|
|
201
|
+
|
|
202
|
+
### Authorization
|
|
203
|
+
|
|
204
|
+
[apiToken](../README.md#apiToken)
|
|
205
|
+
|
|
206
|
+
### HTTP request headers
|
|
207
|
+
|
|
208
|
+
- **Content-Type**: application/json
|
|
209
|
+
- **Accept**: application/json
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
### HTTP response details
|
|
213
|
+
| Status code | Description | Response headers |
|
|
214
|
+
|-------------|-------------|------------------|
|
|
215
|
+
|**200** | Success response | - |
|
|
216
|
+
|**422** | Validation error response | - |
|
|
217
|
+
|**401** | Unauthenticated response | - |
|
|
218
|
+
|**500** | Error response | - |
|
|
219
|
+
|
|
220
|
+
[[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)
|
|
221
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# BillingV1SubscriptionRenewalRenewRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**payment_method_id** | **number** | Payment method ID, default will be used if not provided | [optional] [default to undefined]
|
|
9
|
+
**coupons** | **Array<any>** | Discount coupon codes | [optional] [default to undefined]
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { BillingV1SubscriptionRenewalRenewRequest } from 'hostinger-api-sdk';
|
|
15
|
+
|
|
16
|
+
const instance: BillingV1SubscriptionRenewalRenewRequest = {
|
|
17
|
+
payment_method_id,
|
|
18
|
+
coupons,
|
|
19
|
+
};
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.23.0
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|