Skip to content

Commit b6e7f1e

Browse files
committed
fix: removed redundant json_decode
1 parent 4c9e4bd commit b6e7f1e

175 files changed

Lines changed: 3121 additions & 274 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ Class | Method | HTTP request | Description
8181
*BillingPaymentMethodsApi* | [**setDefaultPaymentMethodV1**](docs/Api/BillingPaymentMethodsApi.md#setdefaultpaymentmethodv1) | **POST** /api/billing/v1/payment-methods/{paymentMethodId} | Set default payment method
8282
*BillingSubscriptionsApi* | [**cancelSubscriptionV1**](docs/Api/BillingSubscriptionsApi.md#cancelsubscriptionv1) | **DELETE** /api/billing/v1/subscriptions/{subscriptionId} | Cancel subscription
8383
*BillingSubscriptionsApi* | [**getSubscriptionListV1**](docs/Api/BillingSubscriptionsApi.md#getsubscriptionlistv1) | **GET** /api/billing/v1/subscriptions | Get subscription list
84+
*DNSSnapshotApi* | [**getSnapshotListV1**](docs/Api/DNSSnapshotApi.md#getsnapshotlistv1) | **GET** /api/dns/v1/snapshots/{domain} | Get snapshot list
85+
*DNSSnapshotApi* | [**getSnapshotV1**](docs/Api/DNSSnapshotApi.md#getsnapshotv1) | **GET** /api/dns/v1/snapshots/{domain}/{snapshotId} | Get snapshot
86+
*DNSSnapshotApi* | [**restoreSnapshotV1**](docs/Api/DNSSnapshotApi.md#restoresnapshotv1) | **POST** /api/dns/v1/snapshots/{domain}/{snapshotId} | Restore snapshot
87+
*DNSZoneApi* | [**getRecordsV1**](docs/Api/DNSZoneApi.md#getrecordsv1) | **GET** /api/dns/v1/zones/{domain} | Get records
88+
*DNSZoneApi* | [**resetZoneRecordsV1**](docs/Api/DNSZoneApi.md#resetzonerecordsv1) | **POST** /api/dns/v1/zones/{domain}/reset | Reset zone records
8489
*DomainsPortfolioApi* | [**getDomainListV1**](docs/Api/DomainsPortfolioApi.md#getdomainlistv1) | **GET** /api/domains/v1/portfolio | Get domain list
8590
*VPSActionsApi* | [**getActionListV1**](docs/Api/VPSActionsApi.md#getactionlistv1) | **GET** /api/vps/v1/virtual-machines/{virtualMachineId}/actions | Get action list
8691
*VPSActionsApi* | [**getActionV1**](docs/Api/VPSActionsApi.md#getactionv1) | **GET** /api/vps/v1/virtual-machines/{virtualMachineId}/actions/{actionId} | Get action
@@ -152,6 +157,11 @@ Class | Method | HTTP request | Description
152157
- [CommonSchemaUnprocessableContentResponseSchema](docs/Model/CommonSchemaUnprocessableContentResponseSchema.md)
153158
- [CommonSchemaUnprocessableContentResponseSchemaErrors](docs/Model/CommonSchemaUnprocessableContentResponseSchemaErrors.md)
154159
- [CommonSuccessEmptyResource](docs/Model/CommonSuccessEmptyResource.md)
160+
- [DNSV1SnapshotSnapshotResource](docs/Model/DNSV1SnapshotSnapshotResource.md)
161+
- [DNSV1SnapshotSnapshotWithContentResource](docs/Model/DNSV1SnapshotSnapshotWithContentResource.md)
162+
- [DNSV1ZoneNameRecordResource](docs/Model/DNSV1ZoneNameRecordResource.md)
163+
- [DNSV1ZoneNameResource](docs/Model/DNSV1ZoneNameResource.md)
164+
- [DNSV1ZoneResetRequest](docs/Model/DNSV1ZoneResetRequest.md)
155165
- [DomainsV1DomainDomainResource](docs/Model/DomainsV1DomainDomainResource.md)
156166
- [VPSGetActionListV1200Response](docs/Model/VPSGetActionListV1200Response.md)
157167
- [VPSGetBackupListV1200Response](docs/Model/VPSGetBackupListV1200Response.md)

docs/Api/DNSSnapshotApi.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Hostinger\DNSSnapshotApi
2+
3+
All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
4+
5+
| Method | HTTP request | Description |
6+
| ------------- | ------------- | ------------- |
7+
| [**getSnapshotListV1()**](DNSSnapshotApi.md#getSnapshotListV1) | **GET** /api/dns/v1/snapshots/{domain} | Get snapshot list |
8+
| [**getSnapshotV1()**](DNSSnapshotApi.md#getSnapshotV1) | **GET** /api/dns/v1/snapshots/{domain}/{snapshotId} | Get snapshot |
9+
| [**restoreSnapshotV1()**](DNSSnapshotApi.md#restoreSnapshotV1) | **POST** /api/dns/v1/snapshots/{domain}/{snapshotId} | Restore snapshot |
10+
11+
12+
## `getSnapshotListV1()`
13+
14+
```php
15+
getSnapshotListV1($domain): \Hostinger\Model\DNSV1SnapshotSnapshotResource[]
16+
```
17+
18+
Get snapshot list
19+
20+
This endpoint retrieves list of DNS snapshots.
21+
22+
### Example
23+
24+
```php
25+
<?php
26+
require_once(__DIR__ . '/vendor/autoload.php');
27+
28+
29+
// Configure Bearer authorization: apiToken
30+
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
31+
32+
33+
$apiInstance = new Hostinger\Api\DNSSnapshotApi(config: $config);
34+
$domain = mydomain.tld; // string | Domain name
35+
36+
try {
37+
$result = $apiInstance->getSnapshotListV1($domain);
38+
print_r($result);
39+
} catch (Exception $e) {
40+
echo 'Exception when calling DNSSnapshotApi->getSnapshotListV1: ', $e->getMessage(), PHP_EOL;
41+
}
42+
```
43+
44+
### Parameters
45+
46+
| Name | Type | Description | Notes |
47+
| ------------- | ------------- | ------------- | ------------- |
48+
| **domain** | **string**| Domain name | |
49+
50+
### Return type
51+
52+
[**\Hostinger\Model\DNSV1SnapshotSnapshotResource[]**](../Model/DNSV1SnapshotSnapshotResource.md)
53+
54+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
55+
[[Back to Model list]](../../README.md#models)
56+
[[Back to README]](../../README.md)
57+
58+
## `getSnapshotV1()`
59+
60+
```php
61+
getSnapshotV1($domain, $snapshotId): \Hostinger\Model\DNSV1SnapshotSnapshotWithContentResource
62+
```
63+
64+
Get snapshot
65+
66+
This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
67+
68+
### Example
69+
70+
```php
71+
<?php
72+
require_once(__DIR__ . '/vendor/autoload.php');
73+
74+
75+
// Configure Bearer authorization: apiToken
76+
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
77+
78+
79+
$apiInstance = new Hostinger\Api\DNSSnapshotApi(config: $config);
80+
$domain = mydomain.tld; // string | Domain name
81+
$snapshotId = 53513053; // int | Snapshot ID
82+
83+
try {
84+
$result = $apiInstance->getSnapshotV1($domain, $snapshotId);
85+
print_r($result);
86+
} catch (Exception $e) {
87+
echo 'Exception when calling DNSSnapshotApi->getSnapshotV1: ', $e->getMessage(), PHP_EOL;
88+
}
89+
```
90+
91+
### Parameters
92+
93+
| Name | Type | Description | Notes |
94+
| ------------- | ------------- | ------------- | ------------- |
95+
| **domain** | **string**| Domain name | |
96+
| **snapshotId** | **int**| Snapshot ID | |
97+
98+
### Return type
99+
100+
[**\Hostinger\Model\DNSV1SnapshotSnapshotWithContentResource**](../Model/DNSV1SnapshotSnapshotWithContentResource.md)
101+
102+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
103+
[[Back to Model list]](../../README.md#models)
104+
[[Back to README]](../../README.md)
105+
106+
## `restoreSnapshotV1()`
107+
108+
```php
109+
restoreSnapshotV1($domain, $snapshotId): \Hostinger\Model\CommonSuccessEmptyResource
110+
```
111+
112+
Restore snapshot
113+
114+
This endpoint restores DNS zone to the selected snapshot.
115+
116+
### Example
117+
118+
```php
119+
<?php
120+
require_once(__DIR__ . '/vendor/autoload.php');
121+
122+
123+
// Configure Bearer authorization: apiToken
124+
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
125+
126+
127+
$apiInstance = new Hostinger\Api\DNSSnapshotApi(config: $config);
128+
$domain = mydomain.tld; // string | Domain name
129+
$snapshotId = 53513053; // int | Snapshot ID
130+
131+
try {
132+
$result = $apiInstance->restoreSnapshotV1($domain, $snapshotId);
133+
print_r($result);
134+
} catch (Exception $e) {
135+
echo 'Exception when calling DNSSnapshotApi->restoreSnapshotV1: ', $e->getMessage(), PHP_EOL;
136+
}
137+
```
138+
139+
### Parameters
140+
141+
| Name | Type | Description | Notes |
142+
| ------------- | ------------- | ------------- | ------------- |
143+
| **domain** | **string**| Domain name | |
144+
| **snapshotId** | **int**| Snapshot ID | |
145+
146+
### Return type
147+
148+
[**\Hostinger\Model\CommonSuccessEmptyResource**](../Model/CommonSuccessEmptyResource.md)
149+
150+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
151+
[[Back to Model list]](../../README.md#models)
152+
[[Back to README]](../../README.md)

docs/Api/DNSZoneApi.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Hostinger\DNSZoneApi
2+
3+
All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
4+
5+
| Method | HTTP request | Description |
6+
| ------------- | ------------- | ------------- |
7+
| [**getRecordsV1()**](DNSZoneApi.md#getRecordsV1) | **GET** /api/dns/v1/zones/{domain} | Get records |
8+
| [**resetZoneRecordsV1()**](DNSZoneApi.md#resetZoneRecordsV1) | **POST** /api/dns/v1/zones/{domain}/reset | Reset zone records |
9+
10+
11+
## `getRecordsV1()`
12+
13+
```php
14+
getRecordsV1($domain): \Hostinger\Model\DNSV1ZoneNameResource[]
15+
```
16+
17+
Get records
18+
19+
This endpoint retrieves DNS zone records for a specific domain.
20+
21+
### Example
22+
23+
```php
24+
<?php
25+
require_once(__DIR__ . '/vendor/autoload.php');
26+
27+
28+
// Configure Bearer authorization: apiToken
29+
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
30+
31+
32+
$apiInstance = new Hostinger\Api\DNSZoneApi(config: $config);
33+
$domain = mydomain.tld; // string | Domain name
34+
35+
try {
36+
$result = $apiInstance->getRecordsV1($domain);
37+
print_r($result);
38+
} catch (Exception $e) {
39+
echo 'Exception when calling DNSZoneApi->getRecordsV1: ', $e->getMessage(), PHP_EOL;
40+
}
41+
```
42+
43+
### Parameters
44+
45+
| Name | Type | Description | Notes |
46+
| ------------- | ------------- | ------------- | ------------- |
47+
| **domain** | **string**| Domain name | |
48+
49+
### Return type
50+
51+
[**\Hostinger\Model\DNSV1ZoneNameResource[]**](../Model/DNSV1ZoneNameResource.md)
52+
53+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
54+
[[Back to Model list]](../../README.md#models)
55+
[[Back to README]](../../README.md)
56+
57+
## `resetZoneRecordsV1()`
58+
59+
```php
60+
resetZoneRecordsV1($domain, $dNSV1ZoneResetRequest): \Hostinger\Model\CommonSuccessEmptyResource
61+
```
62+
63+
Reset zone records
64+
65+
This endpoint resets DNS zone to the default records.
66+
67+
### Example
68+
69+
```php
70+
<?php
71+
require_once(__DIR__ . '/vendor/autoload.php');
72+
73+
74+
// Configure Bearer authorization: apiToken
75+
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
76+
77+
78+
$apiInstance = new Hostinger\Api\DNSZoneApi(config: $config);
79+
$domain = mydomain.tld; // string | Domain name
80+
$dNSV1ZoneResetRequest = new \Hostinger\Model\DNSV1ZoneResetRequest(); // \Hostinger\Model\DNSV1ZoneResetRequest
81+
82+
try {
83+
$result = $apiInstance->resetZoneRecordsV1($domain, $dNSV1ZoneResetRequest);
84+
print_r($result);
85+
} catch (Exception $e) {
86+
echo 'Exception when calling DNSZoneApi->resetZoneRecordsV1: ', $e->getMessage(), PHP_EOL;
87+
}
88+
```
89+
90+
### Parameters
91+
92+
| Name | Type | Description | Notes |
93+
| ------------- | ------------- | ------------- | ------------- |
94+
| **domain** | **string**| Domain name | |
95+
| **dNSV1ZoneResetRequest** | [**\Hostinger\Model\DNSV1ZoneResetRequest**](../Model/DNSV1ZoneResetRequest.md)| | |
96+
97+
### Return type
98+
99+
[**\Hostinger\Model\CommonSuccessEmptyResource**](../Model/CommonSuccessEmptyResource.md)
100+
101+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
102+
[[Back to Model list]](../../README.md#models)
103+
[[Back to README]](../../README.md)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# # DNSV1SnapshotSnapshotResource
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **int** | Snapshot ID |
8+
**reason** | **string** | Reason of the update |
9+
**createdAt** | **\DateTime** | |
10+
11+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# # DNSV1SnapshotSnapshotWithContentResource
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **int** | Snapshot ID |
8+
**reason** | **string** | Reason of the update |
9+
**snapshot** | **string** | Contents of the DNS zone |
10+
**createdAt** | **\DateTime** | |
11+
12+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# # DNSV1ZoneNameRecordResource
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**content** | **string** | Content of the name record |
8+
**disabled** | **bool** | Flag to mark name record as disabled | [default to false]
9+
10+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# # DNSV1ZoneNameResource
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**name** | **string** | Name of the record (use &#x60;@&#x60; for wildcard name) |
8+
**records** | [**\Hostinger\Model\DNSV1ZoneNameRecordResource[]**](DNSV1ZoneNameRecordResource.md) | Array of [&#x60;DNS.V1.Zone.NameRecordResource&#x60;](#model/dnsv1zonenamerecordresource) |
9+
**ttl** | **int** | TTL (Time-To-Live) of the record |
10+
**type** | **string** | Type of the record |
11+
12+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# # DNSV1ZoneResetRequest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**sync** | **bool** | Determines if operation should be run synchronously | [default to true]
8+
**resetEmailRecords** | **bool** | Determines if email records should be reset | [default to true]
9+
**whitelistedRecordTypes** | **string[]** | Specifies which record types to not reset |
10+
11+
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

src/Api/BillingCatalogApi.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Hostinger API PHP SDK
55
*
6-
* API Version: 0.0.7
6+
* API Version: 0.0.14
77
* @url https://github.com/hostinger/api-php-sdk
88
*
99
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
@@ -76,7 +76,6 @@ public function getCatalogItemListV1(): array|\Hostinger\Model\CommonSchemaUnaut
7676

7777
$statusCode = $response->getStatusCode();
7878
$returnType = null;
79-
$content = \GuzzleHttp\Utils::jsonDecode((string) $response->getBody(), false, 512, JSON_THROW_ON_ERROR);
8079

8180
switch ($statusCode) {
8281
case 200:
@@ -90,7 +89,7 @@ public function getCatalogItemListV1(): array|\Hostinger\Model\CommonSchemaUnaut
9089
break;
9190
}
9291

93-
return ObjectSerializer::deserialize($content, $returnType);
92+
return ObjectSerializer::deserialize($response->getBody()->getContents(), $returnType);
9493
}
9594

9695
/**

src/Api/BillingOrdersApi.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Hostinger API PHP SDK
55
*
6-
* API Version: 0.0.7
6+
* API Version: 0.0.14
77
* @url https://github.com/hostinger/api-php-sdk
88
*
99
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
@@ -76,7 +76,6 @@ public function createNewServiceOrderV1(\Hostinger\Model\BillingV1OrderStoreRequ
7676

7777
$statusCode = $response->getStatusCode();
7878
$returnType = null;
79-
$content = \GuzzleHttp\Utils::jsonDecode((string) $response->getBody(), false, 512, JSON_THROW_ON_ERROR);
8079

8180
switch ($statusCode) {
8281
case 200:
@@ -93,7 +92,7 @@ public function createNewServiceOrderV1(\Hostinger\Model\BillingV1OrderStoreRequ
9392
break;
9493
}
9594

96-
return ObjectSerializer::deserialize($content, $returnType);
95+
return ObjectSerializer::deserialize($response->getBody()->getContents(), $returnType);
9796
}
9897

9998
/**

0 commit comments

Comments
 (0)