#!/usr/bin/env python
# coding: utf-8

"""
AccountApi.py
Copyright 2015 SmartBear Software

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
"""
from __future__ import absolute_import

# python 2 and python 3 compatibility library
from six import iteritems

from . import AbstractBaseApi


class AccountApi(AbstractBaseApi):

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

    def public_api_account_list(
        self,
        content_type=None,
        **kwargs
    ):
        """
        Return a list of accounts
        The Account API  <br/>Return a list of accounts.
        :return: AccountApiSerializer
        """
        all_params = [
        ]

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

        resource_path = '/api/v1/account'.replace('{format}', 'json')
        method = 'GET'

        # path parameters
        allowed_params = [
        ]
        path_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        path_params = dict(path_param_items)
        # query parameters
        allowed_params = [
        ]
        query_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        query_params = dict(query_param_items)
        # headers
        allowed_params = [
        ]
        header_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        header_params = dict(header_param_items)
        # form parameters
        allowed_params = [
        ]
        form_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        form_params = dict(form_param_items)
        # files
        allowed_params = [
        ]
        file_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        files = dict(file_param_items)
        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        content_types = []
        if content_type is None or content_type not in content_types:
            content_type = self.api_client.select_header_content_type(content_types)
        header_params['Content-Type'] = content_type

        response = self.api_client.call_api(
            resource_path, method, path_params, query_params, header_params,
            body=body_params, post_params=form_params, files=files,
            response='AccountApiSerializer')
        return response

    def public_api_account_create(
        self,
        username,
        first_name,
        last_name,
        time_zone,
        email,
        content_type=None,
        **kwargs
    ):
        """
        Create a new account
        The Account API  <br/>Create a new account
        :param str username:(required)
        :param int superior: The id for the account&#39;s superior
        :param str first_name:(required)
        :param str last_name:(required)
        :param str time_zone:(required)
        :param bool is_manager:
        :param str email:(required)
        :param str password:
        :return: AccountApiSerializer
        """
        all_params = [
            'username',
            'superior',
            'first_name',
            'last_name',
            'time_zone',
            'is_manager',
            'email',
            'password',
        ]

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

        resource_path = '/api/v1/account'.replace('{format}', 'json')
        method = 'POST'

        # path parameters
        allowed_params = [
        ]
        path_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        path_params = dict(path_param_items)
        # query parameters
        allowed_params = [
        ]
        query_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        query_params = dict(query_param_items)
        # headers
        allowed_params = [
        ]
        header_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        header_params = dict(header_param_items)
        # form parameters
        allowed_params = [
            'username',
            'superior',
            'first_name',
            'last_name',
            'time_zone',
            'is_manager',
            'email',
            'password',
        ]
        form_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        form_params = dict(form_param_items)
        # files
        allowed_params = [
        ]
        file_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        files = dict(file_param_items)
        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        content_types = []
        if content_type is None or content_type not in content_types:
            content_type = self.api_client.select_header_content_type(content_types)
        header_params['Content-Type'] = content_type

        response = self.api_client.call_api(
            resource_path, method, path_params, query_params, header_params,
            body=body_params, post_params=form_params, files=files,
            response='AccountApiSerializer')
        return response

    def public_api_account_retrieve(
        self,
        pk,
        content_type=None,
        **kwargs
    ):
        """
        Return a single account
        The Account API  <br/>Return a single account.
        :param str pk:(required)
        :return: AccountApiSerializer
        """
        all_params = [
            'pk',
        ]

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

        resource_path = '/api/v1/account/{pk}'.replace('{format}', 'json')
        method = 'GET'

        # path parameters
        allowed_params = [
            'pk',
        ]
        path_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        path_params = dict(path_param_items)
        # query parameters
        allowed_params = [
        ]
        query_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        query_params = dict(query_param_items)
        # headers
        allowed_params = [
        ]
        header_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        header_params = dict(header_param_items)
        # form parameters
        allowed_params = [
        ]
        form_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        form_params = dict(form_param_items)
        # files
        allowed_params = [
        ]
        file_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        files = dict(file_param_items)
        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        content_types = []
        if content_type is None or content_type not in content_types:
            content_type = self.api_client.select_header_content_type(content_types)
        header_params['Content-Type'] = content_type

        response = self.api_client.call_api(
            resource_path, method, path_params, query_params, header_params,
            body=body_params, post_params=form_params, files=files,
            response='AccountApiSerializer')
        return response

    def public_api_account_update(
        self,
        pk,
        username,
        first_name,
        last_name,
        email,
        password,
        content_type=None,
        **kwargs
    ):
        """
        The Account API
        The Account API
        :param str pk:(required)
        :param str username:(required)
        :param str superior:
        :param str first_name:(required)
        :param str last_name:(required)
        :param str time_zone:
        :param bool is_manager:
        :param str email:(required)
        :param str password:(required)
        :return: AccountApiSerializer
        """
        all_params = [
            'pk',
            'username',
            'superior',
            'first_name',
            'last_name',
            'time_zone',
            'is_manager',
            'email',
            'password',
        ]

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

        resource_path = '/api/v1/account/{pk}'.replace('{format}', 'json')
        method = 'PUT'

        # path parameters
        allowed_params = [
            'pk',
        ]
        path_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        path_params = dict(path_param_items)
        # query parameters
        allowed_params = [
        ]
        query_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        query_params = dict(query_param_items)
        # headers
        allowed_params = [
        ]
        header_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        header_params = dict(header_param_items)
        # form parameters
        allowed_params = [
            'username',
            'superior',
            'first_name',
            'last_name',
            'time_zone',
            'is_manager',
            'email',
            'password',
        ]
        form_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        form_params = dict(form_param_items)
        # files
        allowed_params = [
        ]
        file_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        files = dict(file_param_items)
        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        content_types = []
        if content_type is None or content_type not in content_types:
            content_type = self.api_client.select_header_content_type(content_types)
        header_params['Content-Type'] = content_type

        response = self.api_client.call_api(
            resource_path, method, path_params, query_params, header_params,
            body=body_params, post_params=form_params, files=files,
            response='AccountApiSerializer')
        return response

    def public_api_account_destroy(
        self,
        pk,
        content_type=None,
        **kwargs
    ):
        """
        The Account API
        The Account API
        :param str pk:(required)
        :return: AccountApiSerializer
        """
        all_params = [
            'pk',
        ]

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

        resource_path = '/api/v1/account/{pk}'.replace('{format}', 'json')
        method = 'DELETE'

        # path parameters
        allowed_params = [
            'pk',
        ]
        path_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        path_params = dict(path_param_items)
        # query parameters
        allowed_params = [
        ]
        query_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        query_params = dict(query_param_items)
        # headers
        allowed_params = [
        ]
        header_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        header_params = dict(header_param_items)
        # form parameters
        allowed_params = [
        ]
        form_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        form_params = dict(form_param_items)
        # files
        allowed_params = [
        ]
        file_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        files = dict(file_param_items)
        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        content_types = []
        if content_type is None or content_type not in content_types:
            content_type = self.api_client.select_header_content_type(content_types)
        header_params['Content-Type'] = content_type

        response = self.api_client.call_api(
            resource_path, method, path_params, query_params, header_params,
            body=body_params, post_params=form_params, files=files,
            response='AccountApiSerializer')
        return response

    def public_api_account_partial_update(
        self,
        pk,
        content_type=None,
        **kwargs
    ):
        """
        The Account API
        The Account API
        :param str pk:(required)
        :param str username:
        :param str superior:
        :param str first_name:
        :param str last_name:
        :param str time_zone:
        :param bool is_manager:
        :param str email:
        :param str password:
        :return: AccountApiSerializer
        """
        all_params = [
            'pk',
            'username',
            'superior',
            'first_name',
            'last_name',
            'time_zone',
            'is_manager',
            'email',
            'password',
        ]

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

        resource_path = '/api/v1/account/{pk}'.replace('{format}', 'json')
        method = 'PATCH'

        # path parameters
        allowed_params = [
            'pk',
        ]
        path_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        path_params = dict(path_param_items)
        # query parameters
        allowed_params = [
        ]
        query_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        query_params = dict(query_param_items)
        # headers
        allowed_params = [
        ]
        header_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        header_params = dict(header_param_items)
        # form parameters
        allowed_params = [
            'username',
            'superior',
            'first_name',
            'last_name',
            'time_zone',
            'is_manager',
            'email',
            'password',
        ]
        form_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        form_params = dict(form_param_items)
        # files
        allowed_params = [
        ]
        file_param_items = [
            item
            for item in params.items() if item[0] in allowed_params
        ]
        files = dict(file_param_items)
        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept([])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        content_types = []
        if content_type is None or content_type not in content_types:
            content_type = self.api_client.select_header_content_type(content_types)
        header_params['Content-Type'] = content_type

        response = self.api_client.call_api(
            resource_path, method, path_params, query_params, header_params,
            body=body_params, post_params=form_params, files=files,
            response='AccountApiSerializer')
        return response
