Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup, find_packages
from setuptools import setup, find_packages # noqa: H301
from pathlib import Path

NAME = "shotstack-sdk"
Expand Down Expand Up @@ -30,6 +30,7 @@
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
license="MIT",
long_description=long_description,
long_description_content_type="text/markdown"
)
5 changes: 3 additions & 2 deletions shotstack_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"""
Shotstack

Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.io/docs/guide/) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b> # noqa: E501
Official Python SDK for the Shotstack Cloud Video Editing API

The version of the OpenAPI document: v1
Contact: pypi@shotstack.io
Generated by: https://openapi-generator.tech
"""


__version__ = "1.0.0"
__version__ = "0.2.6"

# import ApiClient
from shotstack_sdk.api_client import ApiClient
Expand Down
2 changes: 1 addition & 1 deletion shotstack_sdk/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# do not import all apis into this module because that uses a lot of memory and stack frames
# if you need the ability to import all apis from one package, import them with
# from shotstack_sdk.apis import EditApi
# from shotstack_sdk.apis import CreateApi
307 changes: 307 additions & 0 deletions shotstack_sdk/api/create_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
"""
Shotstack

Official Python SDK for the Shotstack Cloud Video Editing API

The version of the OpenAPI document: v1
Contact: pypi@shotstack.io
Generated by: https://openapi-generator.tech
"""


import re # noqa: F401
import sys # noqa: F401

from shotstack_sdk.api_client import ApiClient, Endpoint as _Endpoint
from shotstack_sdk.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from shotstack_sdk.model.generated_asset import GeneratedAsset
from shotstack_sdk.model.generated_asset_error_response import GeneratedAssetErrorResponse
from shotstack_sdk.model.generated_asset_response import GeneratedAssetResponse


class CreateApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech

Do not edit the class manually.
"""

def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
self.get_generated_asset_endpoint = _Endpoint(
settings={
'response_type': (GeneratedAssetResponse,),
'auth': [
'DeveloperKey'
],
'endpoint_path': '/assets/{id}',
'operation_id': 'get_generated_asset',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
'id',
],
'required': [
'id',
],
'nullable': [
],
'enum': [
],
'validation': [
'id',
]
},
root_map={
'validations': {
('id',): {

'regex': {
'pattern': r'^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$', # noqa: E501
},
},
},
'allowed_values': {
},
'openapi_types': {
'id':
(str,),
},
'attribute_map': {
'id': 'id',
},
'location_map': {
'id': 'path',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.post_generate_asset_endpoint = _Endpoint(
settings={
'response_type': (GeneratedAssetResponse,),
'auth': [
'DeveloperKey'
],
'endpoint_path': '/assets',
'operation_id': 'post_generate_asset',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'generated_asset',
],
'required': [
'generated_asset',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'generated_asset':
(GeneratedAsset,),
},
'attribute_map': {
},
'location_map': {
'generated_asset': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)

def get_generated_asset(
self,
id,
**kwargs
):
"""Get Generated Asset # noqa: E501

Get the generated assets status, url and details by ID. **Base URL:** <a href=\"#\">https://api.shotstack.io/create/{version}</a> # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_generated_asset(id, async_req=True)
>>> result = thread.get()

Args:
id (str): The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format.

Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously

Returns:
GeneratedAssetResponse
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['id'] = \
id
return self.get_generated_asset_endpoint.call_with_http_info(**kwargs)

def post_generate_asset(
self,
generated_asset,
**kwargs
):
"""Generate Asset # noqa: E501

Generate an asset using a Shotstack or third party provider. Chose the provider, type of asset and provide prompts, inputs and options to generate the asset. Once generated the asset can be used with the [Edit](#tocs_edit) API or downloaded. **Base URL:** <a href=\"#\">https://api.shotstack.io/create/{version}</a> # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.post_generate_asset(generated_asset, async_req=True)
>>> result = thread.get()

Args:
generated_asset (GeneratedAsset): Generate an asset using the specified provider, type and options.

Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously

Returns:
GeneratedAssetResponse
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['generated_asset'] = \
generated_asset
return self.post_generate_asset_endpoint.call_with_http_info(**kwargs)

Loading