-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
2,340 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
968 changes: 968 additions & 0 deletions
968
resources/models/raw/seller/app-integrations/v2024-04-01.json
Large diffs are not rendered by default.
Oops, something went wrong.
968 changes: 968 additions & 0 deletions
968
resources/models/seller/app-integrations/v2024-04-01.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401; | ||
|
||
use Saloon\Http\Response; | ||
use SellingPartnerApi\BaseResource; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\CreateNotificationRequest; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\DeleteNotificationsRequest; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\RecordActionFeedbackRequest; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests\CreateNotification; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests\DeleteNotifications; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests\RecordActionFeedback; | ||
|
||
class Api extends BaseResource | ||
{ | ||
/** | ||
* @param CreateNotificationRequest $createNotificationRequest The request for the `createNotification` operation. | ||
*/ | ||
public function createNotification(CreateNotificationRequest $createNotificationRequest): Response | ||
{ | ||
$request = new CreateNotification($createNotificationRequest); | ||
|
||
return $this->connector->send($request); | ||
} | ||
|
||
/** | ||
* @param DeleteNotificationsRequest $deleteNotificationsRequest The request for the `deleteNotifications` operation. | ||
*/ | ||
public function deleteNotifications(DeleteNotificationsRequest $deleteNotificationsRequest): Response | ||
{ | ||
$request = new DeleteNotifications($deleteNotificationsRequest); | ||
|
||
return $this->connector->send($request); | ||
} | ||
|
||
/** | ||
* @param string $notificationId A `notificationId` uniquely identifies a notification. | ||
* @param RecordActionFeedbackRequest $recordActionFeedbackRequest The request for the `recordActionFeedback` operation. | ||
*/ | ||
public function recordActionFeedback( | ||
string $notificationId, | ||
RecordActionFeedbackRequest $recordActionFeedbackRequest, | ||
): Response { | ||
$request = new RecordActionFeedback($notificationId, $recordActionFeedbackRequest); | ||
|
||
return $this->connector->send($request); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/Seller/AppIntegrationsV20240401/Dto/CreateNotificationRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto; | ||
|
||
use SellingPartnerApi\Dto; | ||
|
||
final class CreateNotificationRequest extends Dto | ||
{ | ||
/** | ||
* @param string $templateId The unique identifier of the notification template you used to onboard your application. | ||
* @param array[] $notificationParameters The dynamic parameters required by the notification templated specified by `templateId`. | ||
* @param ?string $marketplaceId An encrypted marketplace identifier for the posted notification. | ||
*/ | ||
public function __construct( | ||
public string $templateId, | ||
public array $notificationParameters, | ||
public ?string $marketplaceId = null, | ||
) {} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Seller/AppIntegrationsV20240401/Dto/DeleteNotificationsRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto; | ||
|
||
use SellingPartnerApi\Dto; | ||
|
||
final class DeleteNotificationsRequest extends Dto | ||
{ | ||
/** | ||
* @param string $templateId The unique identifier of the notification template you used to onboard your application. | ||
* @param string $deletionReason The unique identifier that maps each notification status to a reason code. | ||
*/ | ||
public function __construct( | ||
public string $templateId, | ||
public string $deletionReason, | ||
) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto; | ||
|
||
use SellingPartnerApi\Dto; | ||
|
||
final class Error extends Dto | ||
{ | ||
/** | ||
* @param string $code An error code that identifies the type of error that occurred. | ||
* @param string $message A message that describes the error condition. | ||
* @param ?string $details Additional details that can help the caller understand or fix the issue. | ||
*/ | ||
public function __construct( | ||
public string $code, | ||
public string $message, | ||
public ?string $details = null, | ||
) {} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Seller/AppIntegrationsV20240401/Dto/RecordActionFeedbackRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto; | ||
|
||
use SellingPartnerApi\Dto; | ||
|
||
final class RecordActionFeedbackRequest extends Dto | ||
{ | ||
/** | ||
* @param string $feedbackActionCode The unique identifier for each notification status. | ||
*/ | ||
public function __construct( | ||
public string $feedbackActionCode, | ||
) {} | ||
} |
60 changes: 60 additions & 0 deletions
60
src/Seller/AppIntegrationsV20240401/Requests/CreateNotification.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: SellingPartnerApi\Generator\Generators\RequestGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests; | ||
|
||
use Exception; | ||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Response; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
use SellingPartnerApi\Request; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\CreateNotificationRequest; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\CreateNotificationResponse; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\ErrorList; | ||
|
||
/** | ||
* createNotification | ||
*/ | ||
class CreateNotification extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
protected Method $method = Method::POST; | ||
|
||
/** | ||
* @param CreateNotificationRequest $createNotificationRequest The request for the `createNotification` operation. | ||
*/ | ||
public function __construct( | ||
public CreateNotificationRequest $createNotificationRequest, | ||
) {} | ||
|
||
public function resolveEndpoint(): string | ||
{ | ||
return '/appIntegrations/2024-04-01/notifications'; | ||
} | ||
|
||
public function createDtoFromResponse(Response $response): CreateNotificationResponse|ErrorList | ||
{ | ||
$status = $response->status(); | ||
$responseCls = match ($status) { | ||
200 => CreateNotificationResponse::class, | ||
400, 401, 403, 404, 413, 415, 429, 500, 503 => ErrorList::class, | ||
default => throw new Exception("Unhandled response status: {$status}") | ||
}; | ||
|
||
return $responseCls::deserialize($response->json()); | ||
} | ||
|
||
public function defaultBody(): array | ||
{ | ||
return $this->createNotificationRequest->toArray(); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
src/Seller/AppIntegrationsV20240401/Requests/DeleteNotifications.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: SellingPartnerApi\Generator\Generators\RequestGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests; | ||
|
||
use Exception; | ||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Response; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
use SellingPartnerApi\EmptyResponse; | ||
use SellingPartnerApi\Request; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\DeleteNotificationsRequest; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\ErrorList; | ||
|
||
/** | ||
* deleteNotifications | ||
*/ | ||
class DeleteNotifications extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
protected Method $method = Method::POST; | ||
|
||
/** | ||
* @param DeleteNotificationsRequest $deleteNotificationsRequest The request for the `deleteNotifications` operation. | ||
*/ | ||
public function __construct( | ||
public DeleteNotificationsRequest $deleteNotificationsRequest, | ||
) {} | ||
|
||
public function resolveEndpoint(): string | ||
{ | ||
return '/appIntegrations/2024-04-01/notifications/deletion'; | ||
} | ||
|
||
public function createDtoFromResponse(Response $response): EmptyResponse|ErrorList | ||
{ | ||
$status = $response->status(); | ||
$responseCls = match ($status) { | ||
204 => EmptyResponse::class, | ||
400, 413, 403, 404, 415, 429, 500, 503 => ErrorList::class, | ||
default => throw new Exception("Unhandled response status: {$status}") | ||
}; | ||
|
||
return $responseCls::deserialize($response->json()); | ||
} | ||
|
||
public function defaultBody(): array | ||
{ | ||
return $this->deleteNotificationsRequest->toArray(); | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
src/Seller/AppIntegrationsV20240401/Requests/RecordActionFeedback.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: SellingPartnerApi\Generator\Generators\RequestGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Requests; | ||
|
||
use Exception; | ||
use Saloon\Contracts\Body\HasBody; | ||
use Saloon\Enums\Method; | ||
use Saloon\Http\Response; | ||
use Saloon\Traits\Body\HasJsonBody; | ||
use SellingPartnerApi\EmptyResponse; | ||
use SellingPartnerApi\Request; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Dto\RecordActionFeedbackRequest; | ||
use SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses\ErrorList; | ||
|
||
/** | ||
* recordActionFeedback | ||
*/ | ||
class RecordActionFeedback extends Request implements HasBody | ||
{ | ||
use HasJsonBody; | ||
|
||
protected Method $method = Method::POST; | ||
|
||
/** | ||
* @param string $notificationId A `notificationId` uniquely identifies a notification. | ||
* @param RecordActionFeedbackRequest $recordActionFeedbackRequest The request for the `recordActionFeedback` operation. | ||
*/ | ||
public function __construct( | ||
protected string $notificationId, | ||
public RecordActionFeedbackRequest $recordActionFeedbackRequest, | ||
) {} | ||
|
||
public function resolveEndpoint(): string | ||
{ | ||
return "/appIntegrations/2024-04-01/notifications/{$this->notificationId}/feedback"; | ||
} | ||
|
||
public function createDtoFromResponse(Response $response): EmptyResponse|ErrorList | ||
{ | ||
$status = $response->status(); | ||
$responseCls = match ($status) { | ||
204 => EmptyResponse::class, | ||
400, 413, 401, 403, 404, 415, 429, 500, 503 => ErrorList::class, | ||
default => throw new Exception("Unhandled response status: {$status}") | ||
}; | ||
|
||
return $responseCls::deserialize($response->json()); | ||
} | ||
|
||
public function defaultBody(): array | ||
{ | ||
return $this->recordActionFeedbackRequest->toArray(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Seller/AppIntegrationsV20240401/Responses/CreateNotificationResponse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* This file is auto-generated by Saloon SDK Generator | ||
* Generator: SellingPartnerApi\Generator\Generators\ResponseGenerator | ||
* Do not modify it directly. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SellingPartnerApi\Seller\AppIntegrationsV20240401\Responses; | ||
|
||
use SellingPartnerApi\Response; | ||
|
||
final class CreateNotificationResponse extends Response | ||
{ | ||
/** | ||
* @param ?string $notificationId The unique identifier assigned to each notification. | ||
*/ | ||
public function __construct( | ||
public readonly ?string $notificationId = null, | ||
) {} | ||
} |
Oops, something went wrong.