chengkun
2025-09-12 26c5c0296e7c094f9a7ae4a4bb3c975796992eaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* This class is autogenerated by the Spapi class generator
* Date of generation: 2022-05-26
* Specification: https://github.com/amzn/selling-partner-api-models/blob/main/models/uploads-api-model/uploads_2020-11-01.json
* Source MD5 signature: 2b7f103a2ad1cccd96fef5a83f3bf3c0
*
*
* Selling Partner API for Uploads
* The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API.
*/
namespace DoubleBreak\Spapi\Api;
use DoubleBreak\Spapi\Client;
 
class Uploads extends Client {
 
  /**
  * Operation createUploadDestinationForResource
  *
  * @param string $resource The resource for the upload destination that you are creating. For example, if you are creating an upload destination for the createLegalDisclosure operation of the Messaging API, the {resource} would be /messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure, and the entire path would be /uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure.
  *
  * @param array $queryParams
  *    - *marketplaceIds* array - A list of marketplace identifiers. This specifies the marketplaces where the upload will be available. Only one marketplace can be specified.
  *    - *contentMD5* string - An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit.
  *    - *contentType* string - The content type of the file to be uploaded.
  *
  */
  public function createUploadDestinationForResource($resource, $queryParams = [])
  {
    return $this->send("/uploads/2020-11-01/uploadDestinations/{$resource}", [
      'method' => 'POST',
      'query' => $queryParams,
    ]);
  }
 
  public function createUploadDestinationForResourceAsync($resource, $queryParams = [])
  {
    return $this->sendAsync("/uploads/2020-11-01/uploadDestinations/{$resource}", [
      'method' => 'POST',
      'query' => $queryParams,
    ]);
  }
}