from ..base import AdyenServiceBase


class TerminalOrdersMerchantLevelApi(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(TerminalOrdersMerchantLevelApi, self).__init__(client=client)
        self.service = "management"
        self.baseUrl = "https://management-test.adyen.com/v3"

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

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

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

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

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

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

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

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

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

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

