Skip to content

Commit 1c58a9b

Browse files
committed
Add App Integrations API
1 parent b0c2501 commit 1c58a9b

15 files changed

+2340
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ $sellerConnector = SellingPartnerApi::seller(/* ... */);
225225
```php
226226
$amazonWarehousingAndDistributionApi = $sellerConnector->amazonWarehousingAndDistributionV20240509();
227227
```
228+
* **App Integrations API (v2024-04-01)** ([docs](https://developer-docs.amazon.com/sp-api/docs/app-integrations-api-v2024-04-01-reference))
229+
```php
230+
$appIntegrationsApi = $sellerConnector->appIntegrationsV20240401();
231+
```
228232
* **Application Management API (v2023-11-30)** ([docs](https://developer-docs.amazon.com/sp-api/docs/application-management-api-v2023-11-30-reference))
229233
```php
230234
$applicationManagementApi = $sellerConnector->applicationManagementV20231130();

resources/apis.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
}
1010
]
1111
},
12+
"app-integrations": {
13+
"name": "App Integrations",
14+
"versions": [
15+
{
16+
"version": "2024-04-01",
17+
"url": "https://raw.githubusercontent.com/amzn/selling-partner-api-models/refs/heads/main/models/application-integrations-api-model/appIntegrations-2024-04-01.json"
18+
}
19+
]
20+
},
1221
"application-management": {
1322
"name": "Application Management",
1423
"versions": [

resources/models/raw/seller/app-integrations/v2024-04-01.json

Lines changed: 968 additions & 0 deletions
Large diffs are not rendered by default.

resources/models/seller/app-integrations/v2024-04-01.json

Lines changed: 968 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401;
4+
5+
use Saloon\Http\Response;
6+
use SellingPartnerApi\BaseResource;
7+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\CreateNotificationRequest;
8+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\DeleteNotificationsRequest;
9+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\RecordActionFeedbackRequest;
10+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests\CreateNotification;
11+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests\DeleteNotifications;
12+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests\RecordActionFeedback;
13+
14+
class Api extends BaseResource
15+
{
16+
/**
17+
* @param CreateNotificationRequest $createNotificationRequest The request for the `createNotification` operation.
18+
*/
19+
public function createNotification(CreateNotificationRequest $createNotificationRequest): Response
20+
{
21+
$request = new CreateNotification($createNotificationRequest);
22+
23+
return $this->connector->send($request);
24+
}
25+
26+
/**
27+
* @param DeleteNotificationsRequest $deleteNotificationsRequest The request for the `deleteNotifications` operation.
28+
*/
29+
public function deleteNotifications(DeleteNotificationsRequest $deleteNotificationsRequest): Response
30+
{
31+
$request = new DeleteNotifications($deleteNotificationsRequest);
32+
33+
return $this->connector->send($request);
34+
}
35+
36+
/**
37+
* @param string $notificationId A `notificationId` uniquely identifies a notification.
38+
* @param RecordActionFeedbackRequest $recordActionFeedbackRequest The request for the `recordActionFeedback` operation.
39+
*/
40+
public function recordActionFeedback(
41+
string $notificationId,
42+
RecordActionFeedbackRequest $recordActionFeedbackRequest,
43+
): Response {
44+
$request = new RecordActionFeedback($notificationId, $recordActionFeedbackRequest);
45+
46+
return $this->connector->send($request);
47+
}
48+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto;
12+
13+
use SellingPartnerApi\Dto;
14+
15+
final class CreateNotificationRequest extends Dto
16+
{
17+
/**
18+
* @param string $templateId The unique identifier of the notification template you used to onboard your application.
19+
* @param array[] $notificationParameters The dynamic parameters required by the notification templated specified by `templateId`.
20+
* @param ?string $marketplaceId An encrypted marketplace identifier for the posted notification.
21+
*/
22+
public function __construct(
23+
public string $templateId,
24+
public array $notificationParameters,
25+
public ?string $marketplaceId = null,
26+
) {}
27+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto;
12+
13+
use SellingPartnerApi\Dto;
14+
15+
final class DeleteNotificationsRequest extends Dto
16+
{
17+
/**
18+
* @param string $templateId The unique identifier of the notification template you used to onboard your application.
19+
* @param string $deletionReason The unique identifier that maps each notification status to a reason code.
20+
*/
21+
public function __construct(
22+
public string $templateId,
23+
public string $deletionReason,
24+
) {}
25+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto;
12+
13+
use SellingPartnerApi\Dto;
14+
15+
final class Error extends Dto
16+
{
17+
/**
18+
* @param string $code An error code that identifies the type of error that occurred.
19+
* @param string $message A message that describes the error condition.
20+
* @param ?string $details Additional details that can help the caller understand or fix the issue.
21+
*/
22+
public function __construct(
23+
public string $code,
24+
public string $message,
25+
public ?string $details = null,
26+
) {}
27+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto;
12+
13+
use SellingPartnerApi\Dto;
14+
15+
final class RecordActionFeedbackRequest extends Dto
16+
{
17+
/**
18+
* @param string $feedbackActionCode The unique identifier for each notification status.
19+
*/
20+
public function __construct(
21+
public string $feedbackActionCode,
22+
) {}
23+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: SellingPartnerApi\Generator\Generators\RequestGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests;
12+
13+
use Exception;
14+
use Saloon\Contracts\Body\HasBody;
15+
use Saloon\Enums\Method;
16+
use Saloon\Http\Response;
17+
use Saloon\Traits\Body\HasJsonBody;
18+
use SellingPartnerApi\Request;
19+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\CreateNotificationRequest;
20+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\CreateNotificationResponse;
21+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\ErrorList;
22+
23+
/**
24+
* createNotification
25+
*/
26+
class CreateNotification extends Request implements HasBody
27+
{
28+
use HasJsonBody;
29+
30+
protected Method $method = Method::POST;
31+
32+
/**
33+
* @param CreateNotificationRequest $createNotificationRequest The request for the `createNotification` operation.
34+
*/
35+
public function __construct(
36+
public CreateNotificationRequest $createNotificationRequest,
37+
) {}
38+
39+
public function resolveEndpoint(): string
40+
{
41+
return '/appIntegrations/2024-04-01/notifications';
42+
}
43+
44+
public function createDtoFromResponse(Response $response): CreateNotificationResponse|ErrorList
45+
{
46+
$status = $response->status();
47+
$responseCls = match ($status) {
48+
200 => CreateNotificationResponse::class,
49+
400, 401, 403, 404, 413, 415, 429, 500, 503 => ErrorList::class,
50+
default => throw new Exception("Unhandled response status: {$status}")
51+
};
52+
53+
return $responseCls::deserialize($response->json());
54+
}
55+
56+
public function defaultBody(): array
57+
{
58+
return $this->createNotificationRequest->toArray();
59+
}
60+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: SellingPartnerApi\Generator\Generators\RequestGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests;
12+
13+
use Exception;
14+
use Saloon\Contracts\Body\HasBody;
15+
use Saloon\Enums\Method;
16+
use Saloon\Http\Response;
17+
use Saloon\Traits\Body\HasJsonBody;
18+
use SellingPartnerApi\EmptyResponse;
19+
use SellingPartnerApi\Request;
20+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\DeleteNotificationsRequest;
21+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\ErrorList;
22+
23+
/**
24+
* deleteNotifications
25+
*/
26+
class DeleteNotifications extends Request implements HasBody
27+
{
28+
use HasJsonBody;
29+
30+
protected Method $method = Method::POST;
31+
32+
/**
33+
* @param DeleteNotificationsRequest $deleteNotificationsRequest The request for the `deleteNotifications` operation.
34+
*/
35+
public function __construct(
36+
public DeleteNotificationsRequest $deleteNotificationsRequest,
37+
) {}
38+
39+
public function resolveEndpoint(): string
40+
{
41+
return '/appIntegrations/2024-04-01/notifications/deletion';
42+
}
43+
44+
public function createDtoFromResponse(Response $response): EmptyResponse|ErrorList
45+
{
46+
$status = $response->status();
47+
$responseCls = match ($status) {
48+
204 => EmptyResponse::class,
49+
400, 413, 403, 404, 415, 429, 500, 503 => ErrorList::class,
50+
default => throw new Exception("Unhandled response status: {$status}")
51+
};
52+
53+
return $responseCls::deserialize($response->json());
54+
}
55+
56+
public function defaultBody(): array
57+
{
58+
return $this->deleteNotificationsRequest->toArray();
59+
}
60+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: SellingPartnerApi\Generator\Generators\RequestGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests;
12+
13+
use Exception;
14+
use Saloon\Contracts\Body\HasBody;
15+
use Saloon\Enums\Method;
16+
use Saloon\Http\Response;
17+
use Saloon\Traits\Body\HasJsonBody;
18+
use SellingPartnerApi\EmptyResponse;
19+
use SellingPartnerApi\Request;
20+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\RecordActionFeedbackRequest;
21+
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\ErrorList;
22+
23+
/**
24+
* recordActionFeedback
25+
*/
26+
class RecordActionFeedback extends Request implements HasBody
27+
{
28+
use HasJsonBody;
29+
30+
protected Method $method = Method::POST;
31+
32+
/**
33+
* @param string $notificationId A `notificationId` uniquely identifies a notification.
34+
* @param RecordActionFeedbackRequest $recordActionFeedbackRequest The request for the `recordActionFeedback` operation.
35+
*/
36+
public function __construct(
37+
protected string $notificationId,
38+
public RecordActionFeedbackRequest $recordActionFeedbackRequest,
39+
) {}
40+
41+
public function resolveEndpoint(): string
42+
{
43+
return "/appIntegrations/2024-04-01/notifications/{$this->notificationId}/feedback";
44+
}
45+
46+
public function createDtoFromResponse(Response $response): EmptyResponse|ErrorList
47+
{
48+
$status = $response->status();
49+
$responseCls = match ($status) {
50+
204 => EmptyResponse::class,
51+
400, 413, 401, 403, 404, 415, 429, 500, 503 => ErrorList::class,
52+
default => throw new Exception("Unhandled response status: {$status}")
53+
};
54+
55+
return $responseCls::deserialize($response->json());
56+
}
57+
58+
public function defaultBody(): array
59+
{
60+
return $this->recordActionFeedbackRequest->toArray();
61+
}
62+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: SellingPartnerApi\Generator\Generators\ResponseGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses;
12+
13+
use SellingPartnerApi\Response;
14+
15+
final class CreateNotificationResponse extends Response
16+
{
17+
/**
18+
* @param ?string $notificationId The unique identifier assigned to each notification.
19+
*/
20+
public function __construct(
21+
public readonly ?string $notificationId = null,
22+
) {}
23+
}

0 commit comments

Comments
 (0)