<?php

namespace Tops\AmazonSellingPartnerAPI\Api;

class MarchentFulfillmentApi extends BaseApi
{
    /**
     * Operation Get Eligible Shipment Services Old
     *
     * @param string $body Request schema. (required)
     * @param $body['ShipmentRequestDetails'] Shipment information required for requesting shipping service offers.
     * @param $body['ShippingOfferingFilter'] Filter for use when requesting eligible shipping services.
     * @return json
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref:- https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#geteligibleshipmentservicesold
     */
    public function getEligibleShipmentServicesOld($body)
    {
        if (null === $body) {
            throw new \InvalidArgumentException('Missing the required parameter $body when calling getOrderItemsBuyerInfo');
        }

        $resource_path = '/mfn/v0/eligibleServices';
        $http_body = $body;
        $query_params = [];
        $method = 'POST';
     
        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }

    /**
     * Operation Get Eligible Shipment Services
     *
     * @param string $body Request schema. (required)
     *
     * @return json
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref:- https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#geteligibleshipmentservices
     */
    public function getEligibleShipmentServices($body)
    {
        if (null === $body) {
            throw new \InvalidArgumentException('Missing the required parameter $body when calling getOrderItemsBuyerInfo');
        }
      
        $resource_path = '/mfn/v0/eligibleShippingServices';
        $http_body = $body;
        $query_params = [];
        $method = 'POST';
      
        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }
    /**
     * Operation Get Shipment
     *
     * @param string $shipment_id The Amazon-defined shipment identifier for the shipment. (required)
     *
     * @return json Returns the shipment information for an existing shipment.
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref:- https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#getshipment
     */
    public function getShipment($shipment_id)
    {
        if (null === $shipment_id) {
            throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling getOrderItemsBuyerInfo');
        }

        $resource_path = '/mfn/v0/shipments/{shipmentId}';
        $http_body = '';
        $query_params = [];
        $method = 'GET';
      
        // path params
        if (null !== $shipment_id) {
            $resource_path = str_replace(
                '{' . 'shipmentId' . '}',
                rawurlencode($shipment_id),
                $resource_path
            );
        }
        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }
    
    /**
     * Operation Cancel Shipment
     *
     * @param string $shipment_id The Amazon-defined shipment identifier for the shipment to cancel. (required)
     *
     * @return json
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref:- https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#cancelshipment
     */
    public function cancelShipment($shipment_id)
    {
        if (null === $shipment_id) {
            throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling getOrderItemsBuyerInfo');
        }

        $resource_path = '/mfn/v0/shipments/{shipmentId}';
        $http_body = '';
        $query_params = [];
        $method = 'DELETE';
      
        // path params
        if (null !== $shipment_id) {
            $resource_path = str_replace(
                '{' . 'shipmentId' . '}',
                rawurlencode($shipment_id),
                $resource_path
            );
        }

        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }
    /**
     * Operation Cancel Shipment Old
     *
     * @param string $shipment_id The Amazon-defined shipment identifier for the shipment to cancel. (required)
     *
     * @return json
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref: - https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#cancelshipmentold
     */
    public function cancelShipmentOld($shipment_id)
    {
        if (null === $shipment_id) {
            throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling getOrderItemsBuyerInfo');
        }

        $resource_path = '/mfn/v0/shipments/{shipmentId}/cancel';
        $http_body = '';
        $query_params = [];
        $method = 'PUT';
      
        // path params
        if (null !== $shipment_id) {
            $resource_path = str_replace(
                '{' . 'shipmentId' . '}',
                rawurlencode($shipment_id),
                $resource_path
            );
        }
        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }
    /**
     * Operation create Shipment
     *
     * @param string $body Request schema. (required)
     *
     * @return json
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref:- https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#createshipment
     */
    public function createShipment($body)
    {
        if (null === $body) {
            throw new \InvalidArgumentException('Missing the required parameter $body when calling getOrderItemsBuyerInfo');
        }
      
        $resource_path = '/mfn/v0/shipments';
        $http_body = $body;
        $query_params = [];
        $method = 'POST';
      
        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }

    /**
     * Operation Get Additional Seller Inputs Old
     *
     * @param string $body The request schema for the createSubscription operation. (required)
     *
     * @return json
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref:- https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#getadditionalsellerinputsold
     */
    public function getAdditionalSellerInputsOld($body)
    {
        if (null === $body) {
            throw new \InvalidArgumentException('Missing the required parameter $body when calling getOrderItemsBuyerInfo');
        }

        $resource_path = '/mfn/v0/sellerInputs';
        $http_body = $body;
        $query_params = [];
        $method = 'POST';
       
        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }

    /**
     * Operation Get Additional Seller Inputs
     *
     * @param string $body Request schema. (required)
     *
     * @return json
     *
     * @author Chetan Meena <chetan@topsinfosolutions.com>
     *
     * About more Ref:- https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md#getadditionalsellerinputs
     */
    public function getAdditionalSellerInputs($body)
    {
        if (null === $body) {
            throw new \InvalidArgumentException('Missing the required parameter $body when calling getOrderItemsBuyerInfo');
        }

        $resource_path = '/mfn/v0/additionalSellerInputs';
        $http_body = $body;
        $query_params = [];
        $method = 'POST';
       
        $curl_headers = $this->generateRequest($resource_path, $query_params, $http_body, $this->config, $method);
        
        $url = $this->config->getHost() . $resource_path;

        return $this->sendRequest($url, $query_params, $http_body, $curl_headers, $method);
    }
}
