from ..base import AdyenServiceBase


class TerminalOrdersCompanyLevelApi(AdyenServiceBase):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, client=None):
        super(TerminalOrdersCompanyLevelApi, self).__init__(client=client)
        self.service = "management"
        self.baseUrl = "https://management-test.adyen.com/v3"

    def cancel_order(self, companyId, orderId, idempotency_key=None, **kwargs):
        """
        Cancel an order
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders/{orderId}/cancel"
        method = "POST"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def create_order(self, request, companyId, idempotency_key=None, **kwargs):
        """
        Create an order
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def create_shipping_location(self, request, companyId, idempotency_key=None, **kwargs):
        """
        Create a shipping location
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/shippingLocations"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def get_order(self, companyId, orderId, idempotency_key=None, **kwargs):
        """
        Get an order
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders/{orderId}"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def list_billing_entities(self, companyId, idempotency_key=None, **kwargs):
        """
        Get a list of billing entities
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/billingEntities"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def list_orders(self, companyId, idempotency_key=None, **kwargs):
        """
        Get a list of orders
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def list_shipping_locations(self, companyId, idempotency_key=None, **kwargs):
        """
        Get a list of shipping locations
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/shippingLocations"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def list_terminal_models(self, companyId, idempotency_key=None, **kwargs):
        """
        Get a list of terminal models
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/terminalModels"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def list_terminal_products(self, companyId, idempotency_key=None, **kwargs):
        """
        Get a list of terminal products
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/terminalProducts"
        method = "GET"
        return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

    def update_order(self, request, companyId, orderId, idempotency_key=None, **kwargs):
        """
        Update an order
        """
        endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders/{orderId}"
        method = "PATCH"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

