# -*- coding: utf-8 -*-

"""
pqapiv2

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""

import json
import dateutil.parser

from tests.controllers.controller_test_base import ControllerTestBase
from tests.test_helper import TestHelper
from pqapiv2.api_helper import APIHelper


class DocumentsControllerTests(ControllerTestBase):

    @classmethod
    def setUpClass(cls):
        super(DocumentsControllerTests, cls).setUpClass()
        cls.controller = cls.client.documents
        cls.response_catcher = cls.controller.http_call_back

    # Retrieve a list of user documents that supports filtering, sorting, and pagination through existing mechanisms.
    def test_list_user_documents(self):
        # Parameters for the API call
        user_token = 'user-f012bc86-4d42-415b-a8b2-be5e0b90e59a'
        x_my_pay_quicker_version = '2020.02.24'
        page = None
        page_size = 20
        filter = '\'name\'*\'Fra\'||*\'Ger\',\'numericCode\'>\'5\''
        sort = '-name'
        language = 'en-US'

        # Perform the API call through the SDK function
        self.controller.list_user_documents(user_token, x_my_pay_quicker_version, page, page_size, filter, sort, language)

        # Test response code
        self.assertEquals(self.response_catcher.response.status_code, 200)

    # Create a quote for a user document.
    def test_create_user_document(self):
        # Parameters for the API call
        user_token = 'user-f012bc86-4d42-415b-a8b2-be5e0b90e59a'
        x_my_pay_quicker_version = '2020.02.24'

        # Perform the API call through the SDK function
        self.controller.create_user_document(user_token, x_my_pay_quicker_version)

        # Test response code
        self.assertEquals(self.response_catcher.response.status_code, 200)

    # Retrieve an individual user document by its document token.
    def test_retrieve_user_document(self):
        # Parameters for the API call
        user_token = 'user-f012bc86-4d42-415b-a8b2-be5e0b90e59a'
        docu_token = 'docu-6260c132-5cb1-4e30-8b08-9ce559893acb'
        x_my_pay_quicker_version = '2020.02.24'
        page = None
        page_size = 20
        filter = '\'name\'*\'Fra\'||*\'Ger\',\'numericCode\'>\'5\''
        sort = '-name'
        language = 'en-US'

        # Perform the API call through the SDK function
        self.controller.retrieve_user_document(user_token, docu_token, x_my_pay_quicker_version, page, page_size, filter, sort, language)

        # Test response code
        self.assertEquals(self.response_catcher.response.status_code, 200)

    # Replace the user document at the given document token.
    def test_replace_user_document(self):
        # Parameters for the API call
        user_token = 'user-f012bc86-4d42-415b-a8b2-be5e0b90e59a'
        docu_token = 'docu-6260c132-5cb1-4e30-8b08-9ce559893acb'
        x_my_pay_quicker_version = '2020.02.24'

        # Perform the API call through the SDK function
        self.controller.replace_user_document(user_token, docu_token, x_my_pay_quicker_version)

        # Test response code
        self.assertEquals(self.response_catcher.response.status_code, 200)

