Skip to content

Commit

Permalink
Merge pull request #16 from saasus-platform/feature/generate-AwsMarke…
Browse files Browse the repository at this point in the history
…tplaceClient

Generate Client for AWS Marketplace Integration API
  • Loading branch information
silent-bayline authored Jun 29, 2023
2 parents 1506c06 + 28c2278 commit 934435f
Show file tree
Hide file tree
Showing 130 changed files with 6,042 additions and 54 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Route::middleware(\AntiPatternInc\Saasus\Laravel\Middleware\Auth::class)->group(

EventBridge 連携設定の参照・更新に利用します。

- [AwsMarketplace](./generated/AwsMarketplace/README.md)

AWS Marketplace 連携設定の参照・更新に利用します。

---

## ユースケースサンプル
Expand Down
8 changes: 8 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ Route::middleware(\AntiPatternInc\Saasus\Laravel\Middleware\Auth::class)->group(

It is used for referencing/updating information related to external SaaS used in billing operations.

- [Integration](./generated/Integration/README_en.md)

It is used for referencing/updating information related to Amazon EventBridge.

- [AwsMarketplace](./generated/AwsMarketplace/README_en.md)

It is used for referencing/updating information related to AWS Marketplace.

---

## Use Case Sample
Expand Down
55 changes: 55 additions & 0 deletions generated/Auth/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ public function createRole(?\stdClass $requestBody = null, string $fetch = self:
*
* @param string $roleName 役割(ロール)名(role name)
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleBadRequestException
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleNotFoundException
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleInternalServerErrorException
*
Expand Down Expand Up @@ -1061,6 +1062,60 @@ public function resendSignUpConfirmationEmail(?\AntiPatternInc\Saasus\Sdk\Auth\M
{
return $this->executeEndpoint(new \AntiPatternInc\Saasus\Sdk\Auth\Endpoint\ResendSignUpConfirmationEmail($requestBody), $fetch);
}
/**
* AWS Marketplaceと連携したユーザーを新規登録します。登録されたメールアドレスに対して仮パスワードを送信します。
Registration Tokenが有効でない場合はエラーを返却します。
Register a new user linked to AWS Marketplace. A temporary password will be sent to the registered email.
If the Registration Token is not valid, an error is returned.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\SignUpWithAwsMarketplaceParam $requestBody
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\SignUpWithAwsMarketplaceInternalServerErrorException
*
* @return null|\AntiPatternInc\Saasus\Sdk\Auth\Model\SaasUser|\Psr\Http\Message\ResponseInterface
*/
public function signUpWithAwsMarketplace(?\AntiPatternInc\Saasus\Sdk\Auth\Model\SignUpWithAwsMarketplaceParam $requestBody = null, string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new \AntiPatternInc\Saasus\Sdk\Auth\Endpoint\SignUpWithAwsMarketplace($requestBody), $fetch);
}
/**
* AWS Marketplaceと連携したユーザー新規登録を確定します。AWS Marketplaceと連携したテナントを新規作成します。
Registration Tokenが有効でない場合はエラーを返却します。
Confirm a new use registeration linked to AWS Marketplace. Create a new tenant linked to AWS Marketplace.
If the Registration Token is not valid, an error is returned.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\ConfirmSignUpWithAwsMarketplaceParam $requestBody
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\ConfirmSignUpWithAwsMarketplaceInternalServerErrorException
*
* @return null|\AntiPatternInc\Saasus\Sdk\Auth\Model\Tenant|\Psr\Http\Message\ResponseInterface
*/
public function confirmSignUpWithAwsMarketplace(?\AntiPatternInc\Saasus\Sdk\Auth\Model\ConfirmSignUpWithAwsMarketplaceParam $requestBody = null, string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new \AntiPatternInc\Saasus\Sdk\Auth\Endpoint\ConfirmSignUpWithAwsMarketplace($requestBody), $fetch);
}
/**
* AWS Marketplaceと既存のテナントを連携します。
Registration Tokenが有効でない場合はエラーを返却します。
Link an existing tenant with AWS Marketplace.
If the Registration Token is not valid, an error is returned.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\LinkAwsMarketplaceParam $requestBody
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\LinkAwsMarketplaceInternalServerErrorException
*
* @return null|\Psr\Http\Message\ResponseInterface
*/
public function linkAwsMarketplace(?\AntiPatternInc\Saasus\Sdk\Auth\Model\LinkAwsMarketplaceParam $requestBody = null, string $fetch = self::FETCH_OBJECT)
{
return $this->executeEndpoint(new \AntiPatternInc\Saasus\Sdk\Auth\Endpoint\LinkAwsMarketplace($requestBody), $fetch);
}
/**
* @param string $fetch Fetch mode to use (can be OBJECT or RESPONSE)
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\ReturnInternalServerErrorInternalServerErrorException
Expand Down
61 changes: 61 additions & 0 deletions generated/Auth/Endpoint/ConfirmSignUpWithAwsMarketplace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Endpoint;

class ConfirmSignUpWithAwsMarketplace extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndpoint implements \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Endpoint
{
/**
* AWS Marketplaceと連携したユーザー新規登録を確定します。AWS Marketplaceと連携したテナントを新規作成します。
Registration Tokenが有効でない場合はエラーを返却します。
Confirm a new use registeration linked to AWS Marketplace. Create a new tenant linked to AWS Marketplace.
If the Registration Token is not valid, an error is returned.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\ConfirmSignUpWithAwsMarketplaceParam $requestBody
*/
public function __construct(?\AntiPatternInc\Saasus\Sdk\Auth\Model\ConfirmSignUpWithAwsMarketplaceParam $requestBody = null)
{
$this->body = $requestBody;
}
use \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\EndpointTrait;
public function getMethod() : string
{
return 'POST';
}
public function getUri() : string
{
return '/aws-marketplace/sign-up-confirm';
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
{
if ($this->body instanceof \AntiPatternInc\Saasus\Sdk\Auth\Model\ConfirmSignUpWithAwsMarketplaceParam) {
return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json'));
}
return array(array(), null);
}
public function getExtraHeaders() : array
{
return array('Accept' => array('application/json'));
}
/**
* {@inheritdoc}
*
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\ConfirmSignUpWithAwsMarketplaceInternalServerErrorException
*
* @return null|\AntiPatternInc\Saasus\Sdk\Auth\Model\Tenant
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) {
return $serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\Tenant', 'json');
}
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
throw new \AntiPatternInc\Saasus\Sdk\Auth\Exception\ConfirmSignUpWithAwsMarketplaceInternalServerErrorException($serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\Error', 'json'));
}
}
public function getAuthenticationScopes() : array
{
return array('Bearer');
}
}
4 changes: 4 additions & 0 deletions generated/Auth/Endpoint/DeleteRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function getExtraHeaders() : array
/**
* {@inheritdoc}
*
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleBadRequestException
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleNotFoundException
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleInternalServerErrorException
*
Expand All @@ -47,6 +48,9 @@ protected function transformResponseBody(string $body, int $status, \Symfony\Com
if (200 === $status) {
return null;
}
if (is_null($contentType) === false && (400 === $status && mb_strpos($contentType, 'application/json') !== false)) {
throw new \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleBadRequestException($serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\Error', 'json'));
}
if (is_null($contentType) === false && (404 === $status && mb_strpos($contentType, 'application/json') !== false)) {
throw new \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteRoleNotFoundException($serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\Error', 'json'));
}
Expand Down
61 changes: 61 additions & 0 deletions generated/Auth/Endpoint/LinkAwsMarketplace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Endpoint;

class LinkAwsMarketplace extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndpoint implements \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Endpoint
{
/**
* AWS Marketplaceと既存のテナントを連携します。
Registration Tokenが有効でない場合はエラーを返却します。
Link an existing tenant with AWS Marketplace.
If the Registration Token is not valid, an error is returned.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\LinkAwsMarketplaceParam $requestBody
*/
public function __construct(?\AntiPatternInc\Saasus\Sdk\Auth\Model\LinkAwsMarketplaceParam $requestBody = null)
{
$this->body = $requestBody;
}
use \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\EndpointTrait;
public function getMethod() : string
{
return 'PATCH';
}
public function getUri() : string
{
return '/aws-marketplace/link';
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
{
if ($this->body instanceof \AntiPatternInc\Saasus\Sdk\Auth\Model\LinkAwsMarketplaceParam) {
return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json'));
}
return array(array(), null);
}
public function getExtraHeaders() : array
{
return array('Accept' => array('application/json'));
}
/**
* {@inheritdoc}
*
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\LinkAwsMarketplaceInternalServerErrorException
*
* @return null
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
if (200 === $status) {
return null;
}
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
throw new \AntiPatternInc\Saasus\Sdk\Auth\Exception\LinkAwsMarketplaceInternalServerErrorException($serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\Error', 'json'));
}
}
public function getAuthenticationScopes() : array
{
return array('Bearer');
}
}
61 changes: 61 additions & 0 deletions generated/Auth/Endpoint/SignUpWithAwsMarketplace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Endpoint;

class SignUpWithAwsMarketplace extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndpoint implements \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Endpoint
{
/**
* AWS Marketplaceと連携したユーザーを新規登録します。登録されたメールアドレスに対して仮パスワードを送信します。
Registration Tokenが有効でない場合はエラーを返却します。
Register a new user linked to AWS Marketplace. A temporary password will be sent to the registered email.
If the Registration Token is not valid, an error is returned.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\SignUpWithAwsMarketplaceParam $requestBody
*/
public function __construct(?\AntiPatternInc\Saasus\Sdk\Auth\Model\SignUpWithAwsMarketplaceParam $requestBody = null)
{
$this->body = $requestBody;
}
use \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\EndpointTrait;
public function getMethod() : string
{
return 'POST';
}
public function getUri() : string
{
return '/aws-marketplace/sign-up';
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
{
if ($this->body instanceof \AntiPatternInc\Saasus\Sdk\Auth\Model\SignUpWithAwsMarketplaceParam) {
return array(array('Content-Type' => array('application/json')), $serializer->serialize($this->body, 'json'));
}
return array(array(), null);
}
public function getExtraHeaders() : array
{
return array('Accept' => array('application/json'));
}
/**
* {@inheritdoc}
*
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\SignUpWithAwsMarketplaceInternalServerErrorException
*
* @return null|\AntiPatternInc\Saasus\Sdk\Auth\Model\SaasUser
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
if (is_null($contentType) === false && (201 === $status && mb_strpos($contentType, 'application/json') !== false)) {
return $serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\SaasUser', 'json');
}
if (is_null($contentType) === false && (500 === $status && mb_strpos($contentType, 'application/json') !== false)) {
throw new \AntiPatternInc\Saasus\Sdk\Auth\Exception\SignUpWithAwsMarketplaceInternalServerErrorException($serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\Error', 'json'));
}
}
public function getAuthenticationScopes() : array
{
return array('Bearer');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Exception;

class ConfirmSignUpWithAwsMarketplaceInternalServerErrorException extends InternalServerErrorException
{
/**
* @var \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
*/
private $error;
public function __construct(\AntiPatternInc\Saasus\Sdk\Auth\Model\Error $error)
{
parent::__construct('Internal Server Error');
$this->error = $error;
}
public function getError() : \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
{
return $this->error;
}
}
20 changes: 20 additions & 0 deletions generated/Auth/Exception/DeleteRoleBadRequestException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Exception;

class DeleteRoleBadRequestException extends BadRequestException
{
/**
* @var \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
*/
private $error;
public function __construct(\AntiPatternInc\Saasus\Sdk\Auth\Model\Error $error)
{
parent::__construct('Bad Request');
$this->error = $error;
}
public function getError() : \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
{
return $this->error;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Exception;

class LinkAwsMarketplaceInternalServerErrorException extends InternalServerErrorException
{
/**
* @var \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
*/
private $error;
public function __construct(\AntiPatternInc\Saasus\Sdk\Auth\Model\Error $error)
{
parent::__construct('Internal Server Error');
$this->error = $error;
}
public function getError() : \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
{
return $this->error;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Exception;

class SignUpWithAwsMarketplaceInternalServerErrorException extends InternalServerErrorException
{
/**
* @var \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
*/
private $error;
public function __construct(\AntiPatternInc\Saasus\Sdk\Auth\Model\Error $error)
{
parent::__construct('Internal Server Error');
$this->error = $error;
}
public function getError() : \AntiPatternInc\Saasus\Sdk\Auth\Model\Error
{
return $this->error;
}
}
Loading

0 comments on commit 934435f

Please sign in to comment.