"""
    Sample metadata API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 7.14.0
    Generated by: https://openapi-generator.tech
"""


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

from metamist.api_client import ApiClient, Endpoint as _Endpoint
from metamist.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types,
    async_wrap
)
from metamist.model.analysis_runner import AnalysisRunner
from metamist.model.http_validation_error import HTTPValidationError


class AnalysisRunnerApi(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.create_analysis_runner_log_async = async_wrap(self.create_analysis_runner_log)
        self.create_analysis_runner_log_endpoint = _Endpoint(
            settings={
                'response_type': (str,),
                'auth': [
                    'HTTPBearer'
                ],
                'endpoint_path': '/api/v1/analysis-runner/{project}/',
                'operation_id': 'create_analysis_runner_log',
                'http_method': 'PUT',
                'servers': None,
            },
            params_map={
                'all': [
                    'project',
                    'ar_guid',
                    'access_level',
                    'repository',
                    'commit',
                    'script',
                    'description',
                    'driver_image',
                    'config_path',
                    'environment',
                    'batch_url',
                    'submitting_user',
                    'output_path',
                    'request_body',
                    'hail_version',
                    'cwd',
                ],
                'required': [
                    'project',
                    'ar_guid',
                    'access_level',
                    'repository',
                    'commit',
                    'script',
                    'description',
                    'driver_image',
                    'config_path',
                    'environment',
                    'batch_url',
                    'submitting_user',
                    'output_path',
                    'request_body',
                ],
                'nullable': [
                    'hail_version',
                    'cwd',
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'project':
                        (str,),
                    'ar_guid':
                        (str,),
                    'access_level':
                        (str,),
                    'repository':
                        (str,),
                    'commit':
                        (str,),
                    'script':
                        (str,),
                    'description':
                        (str,),
                    'driver_image':
                        (str,),
                    'config_path':
                        (str,),
                    'environment':
                        (str,),
                    'batch_url':
                        (str,),
                    'submitting_user':
                        (str,),
                    'output_path':
                        (str,),
                    'request_body':
                        ({str: (str,)},),
                    'hail_version':
                        (bool, date, datetime, dict, float, int, list, str, none_type,),
                    'cwd':
                        (bool, date, datetime, dict, float, int, list, str, none_type,),
                },
                'attribute_map': {
                    'project': 'project',
                    'ar_guid': 'ar_guid',
                    'access_level': 'access_level',
                    'repository': 'repository',
                    'commit': 'commit',
                    'script': 'script',
                    'description': 'description',
                    'driver_image': 'driver_image',
                    'config_path': 'config_path',
                    'environment': 'environment',
                    'batch_url': 'batch_url',
                    'submitting_user': 'submitting_user',
                    'output_path': 'output_path',
                    'hail_version': 'hail_version',
                    'cwd': 'cwd',
                },
                'location_map': {
                    'project': 'path',
                    'ar_guid': 'query',
                    'access_level': 'query',
                    'repository': 'query',
                    'commit': 'query',
                    'script': 'query',
                    'description': 'query',
                    'driver_image': 'query',
                    'config_path': 'query',
                    'environment': 'query',
                    'batch_url': 'query',
                    'submitting_user': 'query',
                    'output_path': 'query',
                    'request_body': 'body',
                    'hail_version': 'query',
                    'cwd': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )

        self.get_analysis_runner_logs_async = async_wrap(self.get_analysis_runner_logs)
        self.get_analysis_runner_logs_endpoint = _Endpoint(
            settings={
                'response_type': ([AnalysisRunner],),
                'auth': [
                    'HTTPBearer'
                ],
                'endpoint_path': '/api/v1/analysis-runner/{project}/',
                'operation_id': 'get_analysis_runner_logs',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'project',
                    'ar_guid',
                    'submitting_user',
                    'repository',
                    'access_level',
                    'environment',
                ],
                'required': [
                    'project',
                ],
                'nullable': [
                    'ar_guid',
                    'submitting_user',
                    'repository',
                    'access_level',
                    'environment',
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'project':
                        (str,),
                    'ar_guid':
                        (bool, date, datetime, dict, float, int, list, str, none_type,),
                    'submitting_user':
                        (bool, date, datetime, dict, float, int, list, str, none_type,),
                    'repository':
                        (bool, date, datetime, dict, float, int, list, str, none_type,),
                    'access_level':
                        (bool, date, datetime, dict, float, int, list, str, none_type,),
                    'environment':
                        (bool, date, datetime, dict, float, int, list, str, none_type,),
                },
                'attribute_map': {
                    'project': 'project',
                    'ar_guid': 'ar_guid',
                    'submitting_user': 'submitting_user',
                    'repository': 'repository',
                    'access_level': 'access_level',
                    'environment': 'environment',
                },
                'location_map': {
                    'project': 'path',
                    'ar_guid': 'query',
                    'submitting_user': 'query',
                    'repository': 'query',
                    'access_level': 'query',
                    'environment': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )

    def create_analysis_runner_log(
        self,
        project,
        ar_guid,
        access_level,
        repository,
        commit,
        script,
        description,
        driver_image,
        config_path,
        environment,
        batch_url,
        submitting_user,
        output_path,
        request_body,
        **kwargs
    ):
        """Create Analysis Runner Log  # noqa: E501

        Create a new analysis runner log  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.create_analysis_runner_log(project, ar_guid, access_level, repository, commit, script, description, driver_image, config_path, environment, batch_url, submitting_user, output_path, request_body, async_req=True)
        >>> result = thread.get()

        Args:
            project (str):
            ar_guid (str):
            access_level (str):
            repository (str):
            commit (str):
            script (str):
            description (str):
            driver_image (str):
            config_path (str):
            environment (str):
            batch_url (str):
            submitting_user (str):
            output_path (str):
            request_body ({str: (str,)}):

        Keyword Args:
            hail_version (bool, date, datetime, dict, float, int, list, str, none_type): [optional]
            cwd (bool, date, datetime, dict, float, int, list, str, none_type): [optional]
            _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.
            _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:
            str
                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['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['project'] = \
            project
        kwargs['ar_guid'] = \
            ar_guid
        kwargs['access_level'] = \
            access_level
        kwargs['repository'] = \
            repository
        kwargs['commit'] = \
            commit
        kwargs['script'] = \
            script
        kwargs['description'] = \
            description
        kwargs['driver_image'] = \
            driver_image
        kwargs['config_path'] = \
            config_path
        kwargs['environment'] = \
            environment
        kwargs['batch_url'] = \
            batch_url
        kwargs['submitting_user'] = \
            submitting_user
        kwargs['output_path'] = \
            output_path
        kwargs['request_body'] = \
            request_body
        return self.create_analysis_runner_log_endpoint.call_with_http_info(**kwargs)

    def get_analysis_runner_logs(
        self,
        project,
        **kwargs
    ):
        """Get Analysis Runner Logs  # noqa: E501

        Get analysis runner logs  # 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_analysis_runner_logs(project, async_req=True)
        >>> result = thread.get()

        Args:
            project (str):

        Keyword Args:
            ar_guid (bool, date, datetime, dict, float, int, list, str, none_type): [optional]
            submitting_user (bool, date, datetime, dict, float, int, list, str, none_type): [optional]
            repository (bool, date, datetime, dict, float, int, list, str, none_type): [optional]
            access_level (bool, date, datetime, dict, float, int, list, str, none_type): [optional]
            environment (bool, date, datetime, dict, float, int, list, str, none_type): [optional]
            _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.
            _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:
            [AnalysisRunner]
                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['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['project'] = \
            project
        return self.get_analysis_runner_logs_endpoint.call_with_http_info(**kwargs)

