# coding: utf-8

"""
    Allegro REST API

    https://developer.allegro.pl/about  # noqa: E501

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


from __future__ import absolute_import

import unittest
import datetime

import allegro_api
from allegro_api.models.checkout_form import CheckoutForm  # noqa: E501
from allegro_api.rest import ApiException

class TestCheckoutForm(unittest.TestCase):
    """CheckoutForm unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional):
        """Test CheckoutForm
            include_option is a boolean, when False only required
            params are included, when True both required and
            optional params are included """
        # model = allegro_api.models.checkout_form.CheckoutForm()  # noqa: E501
        if include_optional :
            return CheckoutForm(
                id = '29738e61-7f6a-11e8-ac45-09db60ede9d6', 
                message_to_seller = 'Please send me an item in red color', 
                buyer = allegro_api.models.checkout_form_buyer_reference.CheckoutFormBuyerReference(
                    id = '23123123', 
                    email = 'user-email@allegro.pl', 
                    login = 'User_Login', 
                    first_name = 'Jan', 
                    last_name = 'Kowalski', 
                    company_name = '0', 
                    guest = False, 
                    personal_identity = '67062589524', 
                    phone_number = '0', 
                    address = allegro_api.models.checkout_form_buyer_address_reference.CheckoutFormBuyerAddressReference(
                        street = 'Solna', 
                        city = 'Poznań', 
                        post_code = '60-166', 
                        country_code = 'PL', ), ), 
                payment = allegro_api.models.checkout_form_payment_reference.CheckoutFormPaymentReference(
                    id = '0f8f1d13-7e9e-11e8-9b00-c5b0dfb78ea6', 
                    type = 'CASH_ON_DELIVERY', 
                    provider = 'P24', 
                    finished_at = '2018-10-12T10:12:32.321Z', 
                    paid_amount = allegro_api.models.price.Price(
                        amount = '123.45', 
                        currency = 'PLN', ), ), 
                status = 'READY_FOR_PROCESSING', 
                fulfillment = allegro_api.models.checkout_form_fulfillment.CheckoutFormFulfillment(
                    status = 'SENT', 
                    shipment_summary = allegro_api.models.checkout_form_fulfillment_shipment_summary.CheckoutFormFulfillmentShipmentSummary(
                        line_items_sent = 'SOME', ), ), 
                delivery = allegro_api.models.checkout_form_delivery_reference.CheckoutFormDeliveryReference(
                    address = allegro_api.models.checkout_form_delivery_address.CheckoutFormDeliveryAddress(
                        first_name = 'Jan', 
                        last_name = 'Kowalski', 
                        street = 'Grunwaldzka 182', 
                        city = 'Poznań', 
                        zip_code = '60-166', 
                        country_code = 'PL', 
                        company_name = '0', 
                        phone_number = '0', ), 
                    method = allegro_api.models.checkout_form_delivery_method.CheckoutFormDeliveryMethod(
                        id = '1fa56f79-4b6a-4821-a6f2-ca9c16d5c925', 
                        name = 'Allegro Paczkomaty InPost', ), 
                    pickup_point = allegro_api.models.checkout_form_delivery_pickup_point.CheckoutFormDeliveryPickupPoint(
                        id = 'POZ08A', 
                        name = 'Paczkomat POZ08A', 
                        description = 'Stacja paliw BP', ), 
                    cost = allegro_api.models.price.Price(
                        amount = '123.45', 
                        currency = 'PLN', ), 
                    time = allegro_api.models.checkout_form_delivery_time.CheckoutFormDeliveryTime(
                        guaranteed = allegro_api.models.checkout_form_delivery_time_guaranteed.CheckoutFormDeliveryTimeGuaranteed(
                            from = '2018-01-01T16:00Z', 
                            to = '2018-01-01T18:00Z', ), ), 
                    smart = True, 
                    calculated_number_of_packages = 1, ), 
                invoice = allegro_api.models.checkout_form_invoice_info.CheckoutFormInvoiceInfo(
                    required = True, 
                    address = allegro_api.models.checkout_form_invoice_address.CheckoutFormInvoiceAddress(
                        street = 'Grunwaldzka 182', 
                        city = 'Poznań', 
                        zip_code = '60-166', 
                        country_code = 'PL', 
                        company = allegro_api.models.checkout_form_invoice_address_company.CheckoutFormInvoiceAddressCompany(
                            name = 'Udix Sp. z o.o.', 
                            tax_id = '0', ), 
                        natural_person = allegro_api.models.checkout_form_invoice_address_natural_person.CheckoutFormInvoiceAddressNaturalPerson(
                            first_name = 'Jan', 
                            last_name = 'Kowalski', ), ), ), 
                line_items = [
                    allegro_api.models.checkout_form_line_item.CheckoutFormLineItem(
                        id = '62ae358b-8f65-4fc4-9c77-bedf604a2e2b', 
                        offer = allegro_api.models.offer_reference.OfferReference(
                            id = '3213213', 
                            name = 'Name of purchased offer', 
                            external = allegro_api.models.external_id.ExternalId(
                                id = 'AH-129834', ), ), 
                        quantity = 1, 
                        original_price = allegro_api.models.price.Price(
                            amount = '123.45', 
                            currency = 'PLN', ), 
                        price = allegro_api.models.price.Price(
                            amount = '123.45', 
                            currency = 'PLN', ), 
                        selected_additional_services = [
                            allegro_api.models.checkout_form_additional_service.CheckoutFormAdditionalService(
                                definition_id = 'CARRY_IN', 
                                name = 'Wniesienie', 
                                quantity = 1, )
                            ], 
                        bought_at = '2018-01-01T10:23:43.123Z', )
                    ], 
                surcharges = [
                    allegro_api.models.checkout_form_payment_reference.CheckoutFormPaymentReference(
                        id = '0f8f1d13-7e9e-11e8-9b00-c5b0dfb78ea6', 
                        type = 'CASH_ON_DELIVERY', 
                        provider = 'P24', 
                        finished_at = '2018-10-12T10:12:32.321Z', 
                        paid_amount = allegro_api.models.price.Price(
                            amount = '123.45', 
                            currency = 'PLN', ), )
                    ], 
                discounts = [
                    allegro_api.models.checkout_form_discount.CheckoutFormDiscount(
                        type = 'COUPON', )
                    ], 
                summary = allegro_api.models.checkout_form_summary.CheckoutFormSummary(
                    total_to_pay = null, ), 
                updated_at = '2011-12-03T10:15:30.133Z'
            )
        else :
            return CheckoutForm(
                id = '29738e61-7f6a-11e8-ac45-09db60ede9d6',
                buyer = allegro_api.models.checkout_form_buyer_reference.CheckoutFormBuyerReference(
                    id = '23123123', 
                    email = 'user-email@allegro.pl', 
                    login = 'User_Login', 
                    first_name = 'Jan', 
                    last_name = 'Kowalski', 
                    company_name = '0', 
                    guest = False, 
                    personal_identity = '67062589524', 
                    phone_number = '0', 
                    address = allegro_api.models.checkout_form_buyer_address_reference.CheckoutFormBuyerAddressReference(
                        street = 'Solna', 
                        city = 'Poznań', 
                        post_code = '60-166', 
                        country_code = 'PL', ), ),
                status = 'READY_FOR_PROCESSING',
                line_items = [
                    allegro_api.models.checkout_form_line_item.CheckoutFormLineItem(
                        id = '62ae358b-8f65-4fc4-9c77-bedf604a2e2b', 
                        offer = allegro_api.models.offer_reference.OfferReference(
                            id = '3213213', 
                            name = 'Name of purchased offer', 
                            external = allegro_api.models.external_id.ExternalId(
                                id = 'AH-129834', ), ), 
                        quantity = 1, 
                        original_price = allegro_api.models.price.Price(
                            amount = '123.45', 
                            currency = 'PLN', ), 
                        price = allegro_api.models.price.Price(
                            amount = '123.45', 
                            currency = 'PLN', ), 
                        selected_additional_services = [
                            allegro_api.models.checkout_form_additional_service.CheckoutFormAdditionalService(
                                definition_id = 'CARRY_IN', 
                                name = 'Wniesienie', 
                                quantity = 1, )
                            ], 
                        bought_at = '2018-01-01T10:23:43.123Z', )
                    ],
                surcharges = [
                    allegro_api.models.checkout_form_payment_reference.CheckoutFormPaymentReference(
                        id = '0f8f1d13-7e9e-11e8-9b00-c5b0dfb78ea6', 
                        type = 'CASH_ON_DELIVERY', 
                        provider = 'P24', 
                        finished_at = '2018-10-12T10:12:32.321Z', 
                        paid_amount = allegro_api.models.price.Price(
                            amount = '123.45', 
                            currency = 'PLN', ), )
                    ],
                discounts = [
                    allegro_api.models.checkout_form_discount.CheckoutFormDiscount(
                        type = 'COUPON', )
                    ],
                summary = allegro_api.models.checkout_form_summary.CheckoutFormSummary(
                    total_to_pay = null, ),
        )

    def testCheckoutForm(self):
        """Test CheckoutForm"""
        inst_req_only = self.make_instance(include_optional=False)
        inst_req_and_optional = self.make_instance(include_optional=True)


if __name__ == '__main__':
    unittest.main()
