Skip to content

Commit a07effd

Browse files
chore: sdk update
1 parent e669ccb commit a07effd

1,436 files changed

Lines changed: 3084 additions & 1427 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ Class | Method | HTTP request | Description
321321
*HostingWebsitesApi* | [**create_website_v1**](docs/HostingWebsitesApi.md#create_website_v1) | **POST** /api/hosting/v1/websites | Create website
322322
*HostingWebsitesApi* | [**delete_website_v1**](docs/HostingWebsitesApi.md#delete_website_v1) | **DELETE** /api/hosting/v1/websites/{domain} | Delete website
323323
*HostingWebsitesApi* | [**deploy_static_site_archive_v1**](docs/HostingWebsitesApi.md#deploy_static_site_archive_v1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/deploy | Deploy static site archive
324+
*HostingWebsitesApi* | [**generate_website_images_v1**](docs/HostingWebsitesApi.md#generate_website_images_v1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/content/images/generate | Generate website images
325+
*HostingWebsitesApi* | [**get_website_image_generation_result_v1**](docs/HostingWebsitesApi.md#get_website_image_generation_result_v1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/content/generations/{generation_id} | Get website image generation result
324326
*HostingWebsitesApi* | [**list_website_setups_v1**](docs/HostingWebsitesApi.md#list_website_setups_v1) | **GET** /api/hosting/v1/onboardings | List website setups
325327
*HostingWebsitesApi* | [**list_websites_v1**](docs/HostingWebsitesApi.md#list_websites_v1) | **GET** /api/hosting/v1/websites | List websites
326328
*HostingWebsitesApi* | [**start_website_setup_v1**](docs/HostingWebsitesApi.md#start_website_setup_v1) | **POST** /api/hosting/v1/orders/{order_id}/onboardings | Start website setup
@@ -809,6 +811,10 @@ Class | Method | HTTP request | Description
809811
- [HostingV1CacheToggleCacheRequest](docs/HostingV1CacheToggleCacheRequest.md)
810812
- [HostingV1CacheToggleCachelessModeRequest](docs/HostingV1CacheToggleCachelessModeRequest.md)
811813
- [HostingV1CdnCdnStatusResource](docs/HostingV1CdnCdnStatusResource.md)
814+
- [HostingV1ContentGenerateImagesRequest](docs/HostingV1ContentGenerateImagesRequest.md)
815+
- [HostingV1ContentGeneratedImageResource](docs/HostingV1ContentGeneratedImageResource.md)
816+
- [HostingV1ContentGeneratedImagesResource](docs/HostingV1ContentGeneratedImagesResource.md)
817+
- [HostingV1ContentGenerationResource](docs/HostingV1ContentGenerationResource.md)
812818
- [HostingV1CronJobsCreateCronJobRequest](docs/HostingV1CronJobsCreateCronJobRequest.md)
813819
- [HostingV1CronJobsCronJobOutputResource](docs/HostingV1CronJobsCronJobOutputResource.md)
814820
- [HostingV1CronJobsCronJobResource](docs/HostingV1CronJobsCronJobResource.md)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# HostingV1ContentGenerateImagesRequest
2+
3+
Generate images from a prompt and an image type
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**prompt** | **str** | What the image should show. For the logo type, the wordmark and mark to render. |
10+
**image_type** | **str** | Kind of image to generate. It sets the default size and cropping. |
11+
**num_of_images** | **int** | How many images to generate | [optional] [default to 1]
12+
**width** | **int** | Output width in pixels. Defaults per image type and is ignored for the logo type. | [optional]
13+
**height** | **int** | Output height in pixels. Defaults per image type and is ignored for the logo type. | [optional]
14+
**style** | **str** | Style tokens appended to photographic prompts. Ignored for the logo type. | [optional]
15+
**color_guidance** | **str** | Colour direction for the logo type only. It is not rendered as text. | [optional]
16+
17+
## Example
18+
19+
```python
20+
from hostinger_api.models.hosting_v1_content_generate_images_request import HostingV1ContentGenerateImagesRequest
21+
22+
# TODO update the JSON string below
23+
json = "{}"
24+
# create an instance of HostingV1ContentGenerateImagesRequest from a JSON string
25+
hosting_v1_content_generate_images_request_instance = HostingV1ContentGenerateImagesRequest.from_json(json)
26+
# print the JSON string representation of the object
27+
print(HostingV1ContentGenerateImagesRequest.to_json())
28+
29+
# convert the object into a dict
30+
hosting_v1_content_generate_images_request_dict = hosting_v1_content_generate_images_request_instance.to_dict()
31+
# create an instance of HostingV1ContentGenerateImagesRequest from a dict
32+
hosting_v1_content_generate_images_request_from_dict = HostingV1ContentGenerateImagesRequest.from_dict(hosting_v1_content_generate_images_request_dict)
33+
```
34+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
35+
36+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# HostingV1ContentGeneratedImageResource
2+
3+
Single image generated by the AI image generator.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**url** | **str** | Temporary URL of the generated image, valid until the `expires_at` time of the result |
10+
**width** | **int** | Image width in pixels |
11+
**height** | **int** | Image height in pixels |
12+
**content_type** | **str** | MIME type of the image |
13+
14+
## Example
15+
16+
```python
17+
from hostinger_api.models.hosting_v1_content_generated_image_resource import HostingV1ContentGeneratedImageResource
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of HostingV1ContentGeneratedImageResource from a JSON string
22+
hosting_v1_content_generated_image_resource_instance = HostingV1ContentGeneratedImageResource.from_json(json)
23+
# print the JSON string representation of the object
24+
print(HostingV1ContentGeneratedImageResource.to_json())
25+
26+
# convert the object into a dict
27+
hosting_v1_content_generated_image_resource_dict = hosting_v1_content_generated_image_resource_instance.to_dict()
28+
# create an instance of HostingV1ContentGeneratedImageResource from a dict
29+
hosting_v1_content_generated_image_resource_from_dict = HostingV1ContentGeneratedImageResource.from_dict(hosting_v1_content_generated_image_resource_dict)
30+
```
31+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
32+
33+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# HostingV1ContentGeneratedImagesResource
2+
3+
Images generated by the AI image generator.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**images** | [**List[HostingV1ContentGeneratedImageResource]**](HostingV1ContentGeneratedImageResource.md) | Generated images, each available at a temporary URL |
10+
**expires_at** | **datetime** | Time after which the image URLs stop working. Download the images before then. |
11+
12+
## Example
13+
14+
```python
15+
from hostinger_api.models.hosting_v1_content_generated_images_resource import HostingV1ContentGeneratedImagesResource
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of HostingV1ContentGeneratedImagesResource from a JSON string
20+
hosting_v1_content_generated_images_resource_instance = HostingV1ContentGeneratedImagesResource.from_json(json)
21+
# print the JSON string representation of the object
22+
print(HostingV1ContentGeneratedImagesResource.to_json())
23+
24+
# convert the object into a dict
25+
hosting_v1_content_generated_images_resource_dict = hosting_v1_content_generated_images_resource_instance.to_dict()
26+
# create an instance of HostingV1ContentGeneratedImagesResource from a dict
27+
hosting_v1_content_generated_images_resource_from_dict = HostingV1ContentGeneratedImagesResource.from_dict(hosting_v1_content_generated_images_resource_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# HostingV1ContentGenerationResource
2+
3+
State of an AI image generation for a website and, once completed, its result.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**generation_id** | **str** | Generation ID (UUID) used to poll for the result |
10+
**type** | **str** | Kind of generation |
11+
**status** | **str** | `in-progress` while the generation is still running, `completed` once `result` is available, `failed` when the generation stopped without a result. |
12+
**result** | [**HostingV1ContentGeneratedImagesResource**](HostingV1ContentGeneratedImagesResource.md) | |
13+
14+
## Example
15+
16+
```python
17+
from hostinger_api.models.hosting_v1_content_generation_resource import HostingV1ContentGenerationResource
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of HostingV1ContentGenerationResource from a JSON string
22+
hosting_v1_content_generation_resource_instance = HostingV1ContentGenerationResource.from_json(json)
23+
# print the JSON string representation of the object
24+
print(HostingV1ContentGenerationResource.to_json())
25+
26+
# convert the object into a dict
27+
hosting_v1_content_generation_resource_dict = hosting_v1_content_generation_resource_instance.to_dict()
28+
# create an instance of HostingV1ContentGenerationResource from a dict
29+
hosting_v1_content_generation_resource_from_dict = HostingV1ContentGenerationResource.from_dict(hosting_v1_content_generation_resource_dict)
30+
```
31+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
32+
33+

‎docs/HostingWebsitesApi.md‎

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Method | HTTP request | Description
77
[**create_website_v1**](HostingWebsitesApi.md#create_website_v1) | **POST** /api/hosting/v1/websites | Create website
88
[**delete_website_v1**](HostingWebsitesApi.md#delete_website_v1) | **DELETE** /api/hosting/v1/websites/{domain} | Delete website
99
[**deploy_static_site_archive_v1**](HostingWebsitesApi.md#deploy_static_site_archive_v1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/deploy | Deploy static site archive
10+
[**generate_website_images_v1**](HostingWebsitesApi.md#generate_website_images_v1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/content/images/generate | Generate website images
11+
[**get_website_image_generation_result_v1**](HostingWebsitesApi.md#get_website_image_generation_result_v1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/content/generations/{generation_id} | Get website image generation result
1012
[**list_website_setups_v1**](HostingWebsitesApi.md#list_website_setups_v1) | **GET** /api/hosting/v1/onboardings | List website setups
1113
[**list_websites_v1**](HostingWebsitesApi.md#list_websites_v1) | **GET** /api/hosting/v1/websites | List websites
1214
[**start_website_setup_v1**](HostingWebsitesApi.md#start_website_setup_v1) | **POST** /api/hosting/v1/orders/{order_id}/onboardings | Start website setup
@@ -280,6 +282,201 @@ Name | Type | Description | Notes
280282

281283
[[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)
282284

285+
# **generate_website_images_v1**
286+
> HostingV1ContentGenerationResource generate_website_images_v1(username, domain, hosting_v1_content_generate_images_request)
287+
288+
Generate website images
289+
290+
Start generating one or more images from a prompt and an image type with the Hostinger
291+
AI image generator, for any website of the hosting account, whatever its type. WordPress
292+
does not need to be installed on the website. Use it to get original images for a website
293+
you are building.
294+
295+
The generation runs asynchronously: the response is returned right away with
296+
`status: in-progress` and a `generation_id`. Poll
297+
GET /api/hosting/v1/accounts/{username}/websites/{domain}/content/generations/{generation_id}
298+
every few seconds until `status` is `completed` or `failed`.
299+
300+
A completed generation returns temporary image URLs together with the time they expire;
301+
download the images before then. Images are returned at exactly the requested size.
302+
Logos are transparent images cropped to the mark and ignore the requested size. The
303+
result gives the real `width` and `height` of each image.
304+
305+
Only one image generation can run per website at a time. A request sent while one is
306+
running returns 409 and starts nothing. The 409 does not include the ID of the running
307+
generation: if you have its `generation_id`, keep polling it; if you do not, wait for it
308+
to finish (up to a few minutes) and then send the request again. Do not retry a 409 right
309+
away. To get several images of the same kind, set `num_of_images` instead of sending
310+
several requests.
311+
312+
Starting a generation is limited to 10 requests per minute; above that the endpoint
313+
returns 429. Polling the result does not count towards this limit.
314+
315+
Provide the hosting account username and the website domain in the path. Both can be
316+
obtained from GET /api/hosting/v1/websites (the `username` and `domain` fields). A domain
317+
that is not a website of that account returns 404.
318+
319+
### Example
320+
321+
* Bearer Authentication (apiToken):
322+
323+
```python
324+
import hostinger_api
325+
from hostinger_api.models.hosting_v1_content_generate_images_request import HostingV1ContentGenerateImagesRequest
326+
from hostinger_api.models.hosting_v1_content_generation_resource import HostingV1ContentGenerationResource
327+
from hostinger_api.rest import ApiException
328+
from pprint import pprint
329+
330+
331+
# Configure Bearer authorization: apiToken
332+
configuration = hostinger_api.Configuration(
333+
access_token = os.environ["BEARER_TOKEN"]
334+
)
335+
336+
# Enter a context with an instance of the API client
337+
with hostinger_api.ApiClient(configuration) as api_client:
338+
# Create an instance of the API class
339+
api_instance = hostinger_api.HostingWebsitesApi(api_client)
340+
username = 'u123456789' # str |
341+
domain = 'mydomain.tld' # str | Domain name
342+
hosting_v1_content_generate_images_request = hostinger_api.HostingV1ContentGenerateImagesRequest() # HostingV1ContentGenerateImagesRequest |
343+
344+
try:
345+
# Generate website images
346+
api_response = api_instance.generate_website_images_v1(username, domain, hosting_v1_content_generate_images_request)
347+
print("The response of HostingWebsitesApi->generate_website_images_v1:\n")
348+
pprint(api_response)
349+
except Exception as e:
350+
print("Exception when calling HostingWebsitesApi->generate_website_images_v1: %s\n" % e)
351+
```
352+
353+
354+
355+
### Parameters
356+
357+
358+
Name | Type | Description | Notes
359+
------------- | ------------- | ------------- | -------------
360+
**username** | **str**| |
361+
**domain** | **str**| Domain name |
362+
**hosting_v1_content_generate_images_request** | [**HostingV1ContentGenerateImagesRequest**](HostingV1ContentGenerateImagesRequest.md)| |
363+
364+
### Return type
365+
366+
[**HostingV1ContentGenerationResource**](HostingV1ContentGenerationResource.md)
367+
368+
### Authorization
369+
370+
[apiToken](../README.md#apiToken)
371+
372+
### HTTP request headers
373+
374+
- **Content-Type**: application/json
375+
- **Accept**: application/json
376+
377+
### HTTP response details
378+
379+
| Status code | Description | Response headers |
380+
|-------------|-------------|------------------|
381+
**202** | Accepted response | - |
382+
**422** | Validation error response | - |
383+
**401** | Unauthenticated response | - |
384+
**404** | Error response | - |
385+
**409** | Conflict response. &#x60;Retry-After&#x60;, when present, is the number of seconds to wait before retrying. | * Retry-After - Seconds to wait before retrying the request <br> |
386+
**429** | Error response | - |
387+
**500** | Error response | - |
388+
389+
[[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)
390+
391+
# **get_website_image_generation_result_v1**
392+
> HostingV1ContentGenerationResource get_website_image_generation_result_v1(username, domain, generation_id)
393+
394+
Get website image generation result
395+
396+
Get the state and result of an AI image generation started for a website of the hosting
397+
account with
398+
POST /api/hosting/v1/accounts/{username}/websites/{domain}/content/images/generate.
399+
It works for any website of the account, with or without WordPress.
400+
401+
While the generation is still running only `status: in-progress` is returned and `result`
402+
is `null`; poll every few seconds. Once `completed`, `result` holds temporary image URLs
403+
together with the time they expire, so download the images before then. Each image comes
404+
with its real `width` and `height`; only a logo's differ from the requested size. A `failed`
405+
generation has no `result`; start a new one. Unknown or expired generation IDs return
406+
404: a result is kept for about 10 minutes after the generation finishes. Polling is not
407+
subject to the 10 requests per minute limit of starting a generation.
408+
409+
Use the same hosting account username and website domain the generation was started
410+
with.
411+
412+
### Example
413+
414+
* Bearer Authentication (apiToken):
415+
416+
```python
417+
import hostinger_api
418+
from hostinger_api.models.hosting_v1_content_generation_resource import HostingV1ContentGenerationResource
419+
from hostinger_api.rest import ApiException
420+
from pprint import pprint
421+
422+
423+
# Configure Bearer authorization: apiToken
424+
configuration = hostinger_api.Configuration(
425+
access_token = os.environ["BEARER_TOKEN"]
426+
)
427+
428+
# Enter a context with an instance of the API client
429+
with hostinger_api.ApiClient(configuration) as api_client:
430+
# Create an instance of the API class
431+
api_instance = hostinger_api.HostingWebsitesApi(api_client)
432+
username = 'u123456789' # str |
433+
domain = 'mydomain.tld' # str | Domain name
434+
generation_id = '9d4f8a1e-2b3c-4d5e-8f6a-7b8c9d0e1f2a' # str | Generation ID returned when the generation was started
435+
436+
try:
437+
# Get website image generation result
438+
api_response = api_instance.get_website_image_generation_result_v1(username, domain, generation_id)
439+
print("The response of HostingWebsitesApi->get_website_image_generation_result_v1:\n")
440+
pprint(api_response)
441+
except Exception as e:
442+
print("Exception when calling HostingWebsitesApi->get_website_image_generation_result_v1: %s\n" % e)
443+
```
444+
445+
446+
447+
### Parameters
448+
449+
450+
Name | Type | Description | Notes
451+
------------- | ------------- | ------------- | -------------
452+
**username** | **str**| |
453+
**domain** | **str**| Domain name |
454+
**generation_id** | **str**| Generation ID returned when the generation was started |
455+
456+
### Return type
457+
458+
[**HostingV1ContentGenerationResource**](HostingV1ContentGenerationResource.md)
459+
460+
### Authorization
461+
462+
[apiToken](../README.md#apiToken)
463+
464+
### HTTP request headers
465+
466+
- **Content-Type**: Not defined
467+
- **Accept**: application/json
468+
469+
### HTTP response details
470+
471+
| Status code | Description | Response headers |
472+
|-------------|-------------|------------------|
473+
**200** | Success response | - |
474+
**401** | Unauthenticated response | - |
475+
**404** | Error response | - |
476+
**500** | Error response | - |
477+
478+
[[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)
479+
283480
# **list_website_setups_v1**
284481
> List[HostingV1OnboardingsOnboardingResource] list_website_setups_v1(order_id=order_id, subscription_id=subscription_id, domain=domain)
285482

0 commit comments

Comments
 (0)