# coding: utf-8

"""
    Idomoo API



    OpenAPI spec version: 2.0
    Contact: dev.support@idomoo.com

"""


from __future__ import absolute_import

# python 2 and python 3 compatibility library
import six

from idomoo.api_client import ApiClient


class StoryboardApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def generate(self, body, **kwargs):
        """Generate Video From Storyboard

        A dynamic storyboard, created in [Storybuilding Suite](http://pv.idomoo.com) already holds all the scene
        logic and placeholder formatting. Only thing left to do to generate a video is define what output you want,
        and fill in the data itself. This method makes a synchronous HTTP request by default. To make an asynchronous
        HTTP request, please pass async=True >>> thread = client.generate(body, async=True) >>> result = thread.get()

        :param async bool
        :param StoryboardAPIRequest body: (required)
        :return: GenerationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.generate_with_http_info(body, **kwargs)
        else:
            (data) = self.generate_with_http_info(body, **kwargs)
            return data

    def generate_with_http_info(self, body, **kwargs):
        """Generate Video From Storyboard

        A dynamic storyboard, created in [Storybuilding Suite](http://pv.idomoo.com) already holds all the scene
        logic and placeholder formatting. Only thing left to do to generate a video is define what output you want,
        and fill in the data itself. This method makes a synchronous HTTP request by default. To make an asynchronous
        HTTP request, please pass async=True >>> thread = client.generate_with_http_info(body, async=True) >>> result
        = thread.get()

        :param async bool
        :param StoryboardAPIRequest body: (required)
        :return: GenerationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'async', '_return_http_data_only', '_preload_content', '_request_timeout']

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method generate_storyboard" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or
                params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `generate_storyboard`")

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # Authentication setting
        auth_settings = ['Basic authentication']

        return self.api_client.call_api(
            '/storyboards/generate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GenerationResponse',
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_storyboard(self, storyborad_id, **kwargs):
        """Get Storyboard by ID

        Get Storyboard by ID
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboard(storyborad_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str storyborad_id: (required)
        :param list[str] fields: choose which fields should return
        :return: StoryboardMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_storyboard_with_http_info(storyborad_id, **kwargs)
        else:
            (data) = self.get_storyboard_with_http_info(storyborad_id, **kwargs)
            return data

    def get_storyboard_with_http_info(self, storyborad_id, **kwargs):
        """Get Storyboard by ID

        Get Storyboard by ID
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboard_with_http_info(storyborad_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str storyborad_id: (required)
        :param list[str] fields: choose which fields should return
        :return: StoryboardMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['storyborad_id', 'fields', 'async', '_return_http_data_only', '_preload_content',
                      '_request_timeout']

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_storyboard" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'storyborad_id' is set
        if ('storyborad_id' not in params or
                params['storyborad_id'] is None):
            raise ValueError("Missing the required parameter `storyborad_id` when calling `get_storyboard`")

        collection_formats = {}

        path_params = {}
        if 'storyborad_id' in params:
            path_params['storyboradId'] = params['storyborad_id']

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))
            collection_formats['fields'] = 'multi'

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(
            ['application/json'])

        # Authentication setting
        auth_settings = ['Basic authentication']

        return self.api_client.call_api(
            '/storyboards/{storyboradId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StoryboardMetadata',
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_storyboards(self, **kwargs):
        """List Of Storyboards

        List Of Storyboards
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboards(async=True)
        >>> result = thread.get()

        :param async bool :param str fields: Choose which fields should return. `GET  /storyboards/?fields=fps,
        storyboard_id,width,height` :param bool desc: Allow ascending and descending sorting. `GET /
        storyboards/?desc=true` :param int limit: Set limit of results `GET  /storyboards/?limit=5 ` :param int
        offset: To get a different set of items, you can use the offset and limit parameters in the GET request’s
        query string  `GET  /storyboards/?offset=5&limit=5 ` Returns scenes 6..10. :return: StoryboardList If the
        method is called asynchronously, returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_storyboards_with_http_info(**kwargs)
        else:
            (data) = self.get_storyboards_with_http_info(**kwargs)
            return data

    def get_storyboards_with_http_info(self, **kwargs):
        """List Of Storyboards

        List Of Storyboards
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboards_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool :param str fields: Choose which fields should return. `GET  /storyboards/?fields=fps,
        storyboard_id,width,height` :param bool desc: Allow ascending and descending sorting. `GET /
        storyboards/?desc=true` :param int limit: Set limit of results `GET  /storyboards/?limit=5 ` :param int
        offset: To get a different set of items, you can use the offset and limit parameters in the GET request’s
        query string  `GET  /storyboards/?offset=5&limit=5 ` Returns scenes 6..10. :return: StoryboardList If the
        method is called asynchronously, returns the request thread.
        """

        all_params = ['fields', 'desc', 'limit', 'offset', 'async', '_return_http_data_only', '_preload_content',
                      '_request_timeout']

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_storyboards" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))
        if 'desc' in params:
            query_params.append(('desc', params['desc']))
        if 'limit' in params:
            query_params.append(('limit', params['limit']))
        if 'offset' in params:
            query_params.append(('offset', params['offset']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(
            ['application/json'])

        # Authentication setting
        auth_settings = ['Basic authentication']

        return self.api_client.call_api(
            '/storyboards/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StoryboardList',
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

cd686a8a43dbfda438a7c2c2ad4c04d6557bc5e4
# coding: utf-8

"""
    Idomoo API



    OpenAPI spec version: 2.0
    Contact: dev.support@idomoo.com

"""


from __future__ import absolute_import

# python 2 and python 3 compatibility library
import six

from idomoo.api_client import ApiClient


class StoryboardApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def generate(self, body, **kwargs):
        """Generate Video From Storyboard

        A dynamic storyboard, created in [Storybuilding Suite](http://pv.idomoo.com) already holds all the scene
        logic and placeholder formatting. Only thing left to do to generate a video is define what output you want,
        and fill in the data itself. This method makes a synchronous HTTP request by default. To make an asynchronous
        HTTP request, please pass async=True >>> thread = client.generate(body, async=True) >>> result = thread.get()

        :param async bool
        :param StoryboardAPIRequest body: (required)
        :return: GenerationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.generate_with_http_info(body, **kwargs)
        else:
            (data) = self.generate_with_http_info(body, **kwargs)
            return data

    def generate_with_http_info(self, body, **kwargs):
        """Generate Video From Storyboard

        A dynamic storyboard, created in [Storybuilding Suite](http://pv.idomoo.com) already holds all the scene
        logic and placeholder formatting. Only thing left to do to generate a video is define what output you want,
        and fill in the data itself. This method makes a synchronous HTTP request by default. To make an asynchronous
        HTTP request, please pass async=True >>> thread = client.generate_with_http_info(body, async=True) >>> result
        = thread.get()

        :param async bool
        :param StoryboardAPIRequest body: (required)
        :return: GenerationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'async', '_return_http_data_only', '_preload_content', '_request_timeout']

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method generate_storyboard" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or
                params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `generate_storyboard`")

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # Authentication setting
        auth_settings = ['Basic authentication']

        return self.api_client.call_api(
            '/storyboards/generate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GenerationResponse',
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_storyboard(self, storyborad_id, **kwargs):
        """Get Storyboard by ID

        Get Storyboard by ID
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboard(storyborad_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str storyborad_id: (required)
        :param list[str] fields: choose which fields should return
        :return: StoryboardMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_storyboard_with_http_info(storyborad_id, **kwargs)
        else:
            (data) = self.get_storyboard_with_http_info(storyborad_id, **kwargs)
            return data

    def get_storyboard_with_http_info(self, storyborad_id, **kwargs):
        """Get Storyboard by ID

        Get Storyboard by ID
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboard_with_http_info(storyborad_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str storyborad_id: (required)
        :param list[str] fields: choose which fields should return
        :return: StoryboardMetadata
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['storyborad_id', 'fields', 'async', '_return_http_data_only', '_preload_content',
                      '_request_timeout']

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_storyboard" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'storyborad_id' is set
        if ('storyborad_id' not in params or
                params['storyborad_id'] is None):
            raise ValueError("Missing the required parameter `storyborad_id` when calling `get_storyboard`")

        collection_formats = {}

        path_params = {}
        if 'storyborad_id' in params:
            path_params['storyboradId'] = params['storyborad_id']

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))
            collection_formats['fields'] = 'multi'

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(
            ['application/json'])

        # Authentication setting
        auth_settings = ['Basic authentication']

        return self.api_client.call_api(
            '/storyboards/{storyboradId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StoryboardMetadata',
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_storyboards(self, **kwargs):
        """List Of Storyboards

        List Of Storyboards
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboards(async=True)
        >>> result = thread.get()

        :param async bool :param str fields: Choose which fields should return. `GET  /storyboards/?fields=fps,
        storyboard_id,width,height` :param bool desc: Allow ascending and descending sorting. `GET /
        storyboards/?desc=true` :param int limit: Set limit of results `GET  /storyboards/?limit=5 ` :param int
        offset: To get a different set of items, you can use the offset and limit parameters in the GET request’s
        query string  `GET  /storyboards/?offset=5&limit=5 ` Returns scenes 6..10. :return: StoryboardList If the
        method is called asynchronously, returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_storyboards_with_http_info(**kwargs)
        else:
            (data) = self.get_storyboards_with_http_info(**kwargs)
            return data

    def get_storyboards_with_http_info(self, **kwargs):
        """List Of Storyboards

        List Of Storyboards
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = client.get_storyboards_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool :param str fields: Choose which fields should return. `GET  /storyboards/?fields=fps,
        storyboard_id,width,height` :param bool desc: Allow ascending and descending sorting. `GET /
        storyboards/?desc=true` :param int limit: Set limit of results `GET  /storyboards/?limit=5 ` :param int
        offset: To get a different set of items, you can use the offset and limit parameters in the GET request’s
        query string  `GET  /storyboards/?offset=5&limit=5 ` Returns scenes 6..10. :return: StoryboardList If the
        method is called asynchronously, returns the request thread.
        """

        all_params = ['fields', 'desc', 'limit', 'offset', 'async', '_return_http_data_only', '_preload_content',
                      '_request_timeout']

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_storyboards" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))
        if 'desc' in params:
            query_params.append(('desc', params['desc']))
        if 'limit' in params:
            query_params.append(('limit', params['limit']))
        if 'offset' in params:
            query_params.append(('offset', params['offset']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(
            ['application/json'])

        # Authentication setting
        auth_settings = ['Basic authentication']

        return self.api_client.call_api(
            '/storyboards/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StoryboardList',
            auth_settings=auth_settings,
            async=params.get('async'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
