# coding: utf-8

"""
    face_recognition

    face_recognition  # noqa: E501

    OpenAPI spec version: 1.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

# python 2 and python 3 compatibility library
import requests
import six



class VideoApi(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, url=None):
        if url is None:
            url = "face-recognition:9999/v1/face-recognition/recognition"
        self.url = url

    def add_url(self, body, **kwargs):  # noqa: E501
        """video face recognition  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        :param async_req bool
        :param Body body: video url (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        all_params = ['url']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_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 upload_post" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'url' in params:
            local_var_files['url'] = params['url']  # noqa: E501
        print(local_var_files['url'])

        r = requests.post(self.url, files=local_var_files['url'])

        return r.text

    def add_url_with_http_info(self, body, **kwargs):  # noqa: E501
        """video face recognition  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_url_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param Body body: video url (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['url']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_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 upload_post" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'url' in params:
            local_var_files['url'] = params['url']  # noqa: E501
        print(local_var_files['url'])

        r = requests.post(self.url, url=local_var_files['url'])
