Skip to content

Commit

Permalink
Merge pull request #8 from saasus-platform/feature/integration-api
Browse files Browse the repository at this point in the history
Add client for Integration API
  • Loading branch information
yaggytter authored Feb 12, 2023
2 parents 07607fb + 8880e20 commit c51bb0d
Show file tree
Hide file tree
Showing 117 changed files with 723 additions and 543 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ composer require saasus-platform/saasus-sdk-php
SAASUS_SAAS_ID="(画面のSaaS ID)"
SAASUS_API_KEY="(画面のAPI KEY)"
SAASUS_SECRET_KEY="(画面のクライアントシークレット)"
SAASUS_LOGIN_URL="https://auth.sample.saasus.jp/ (ログイン画面のURL)"
SAASUS_LOGIN_URL="https://auth.sample.saasus.jp/(ログイン画面のURL)"
```

SAASUS_SAAS_ID, SAASUS_API_KEY, SAASUS_SECRET_KEY は SaaS 開発コンソール画面に表示されている SaaS ID、 API キー  と クライアントシークレットを、
Expand Down Expand Up @@ -60,6 +60,10 @@ Route::middleware(\AntiPatternInc\Saasus\Laravel\Middleware\Auth::class)->group(

請求業務で使う外部 SaaS との連携情報の参照・更新に利用します。

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

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

---

## ユースケースサンプル
Expand Down
110 changes: 63 additions & 47 deletions generated/Auth/Client.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/CreateAuthCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CreateAuthCredentials extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Clie
* 引数のIDトークン・アクセストークン・リフレッシュトークンを一時保存し取得用の一時コードを返却する。
一時コードの有効期間は発行から10秒です。
Temporarily save the argument ID token, access token, and refresh token and return the temporary code for acquisition.
Temporarily save the parameter for the ID token, access token, and refresh token and return a temporary code for obtaining.
Temporary codes are valid for 10 seconds from issuance.
*
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/CreateSaasUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CreateSaasUser extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Base
/**
* SaaSにユーザーを作成します。
Create a user to SaaS.
Create SaaS User.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\CreateSaasUserParam $requestBody
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/CreateSecretCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CreateSecretCode extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Ba
/**
* 認証アプリケーション登録用のシークレットコードを作成します。
Create a secret code for authenticator application registration.
Create a secret code for authentication application registration.
*
* @param string $userId ユーザーID(User ID)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/CreateTenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CreateTenant extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEn
/**
* SaaSus Platform で管理する、テナント情報を作成します。
Create tenant information in the SaaSus Platform.
Create a tenant managed by the SaaSus Platform.
*
* @param null|\stdClass $requestBody
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/CreateTenantAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CreateTenantAttribute extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Clie
例えばテナントの呼び名やメモなどをを持たせることができ、SaaSからSaaSus SDK/APIを利用して取得することができます。
Register additional tenant attributes to be managed by SaaSus Platform.
For example, you can have a tenant name, memo, etc., and you can get it from SaaS using the SaaSus SDK/API.
For example, tenant name, memo, etc., then get the attributes from SaaS using the SaaSus SDK/API.
*
* @param null|\stdClass $requestBody
Expand Down
4 changes: 2 additions & 2 deletions generated/Auth/Endpoint/CreateTenantUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class CreateTenantUser extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Ba
* テナントにユーザーを作成します。
attributesを空のオブジェクトにした場合、追加属性は空で作成されます。
Create a user in your tenant.
If attributes is an empty object, the additional attributes will be created empty.
Create a tenant user.
If attributes is empty, the additional attributes will be created empty.
*
* @param string $tenantId テナントID(Tenant ID)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/CreateTenantUserRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CreateTenantUserRoles extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Clie
/**
* テナントのユーザーに役割(ロール)を作成します。
Create roles for tenant users.
Create roles on tenant users.
*
* @param string $tenantId テナントID(Tenant ID)
Expand Down
6 changes: 3 additions & 3 deletions generated/Auth/Endpoint/CreateUserAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class CreateUserAttribute extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client
例えば、ユーザー名を持たせる、誕生日を持たせるなど、ユーザーに紐付いた項目の定義を行うことができます。
一方で、個人情報を SaaSus Platform 側に持たせたくない場合は、このユーザー属性定義を行わずに SaaS 側で個人情報を持つことを検討してください。
Register additional user attributes to be retained in the SaaSus Platform.
For example, you can define items associated with a user, such as having a user name, having a birthday, etc.
On the other hand, if you don't want to have personal information on the SaaS Platform side, consider having personal information on the SaaS side without this user attribute definition.
Create additional user attributes to be kept on the SaaSus Platform.
For example, you can define items associated with a user, such as user name, birthday, etc.
If you don't want personal information on the SaaS Platform side, personal information can be kept on the SaaS side without user attribute definition.
*
* @param null|\stdClass $requestBody
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/DeleteApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DeleteApiKey extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEn
/**
* サーバサイド用の API キーを削除します。
Delete API Keys.
Delete API Key.
*
* @param string $apiKey APIキー(API key)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/DeleteRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DeleteRole extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndp
/**
* 役割(ロール)を削除します。
Delete a role.
Delete role.
*
* @param string $roleName 役割(ロール)名(role name)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/DeleteSaasUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DeleteSaasUser extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Base
/**
* ユーザーIDを元に一致するユーザーをテナントからすべて削除し、SaaSからも削除します。
Deletes all matching users based on the user ID from the tenant and also deletes them from SaaS.
Delete all users with matching user ID from the tenant and SaaS.
*
* @param string $userId ユーザーID(User ID)
Expand Down
44 changes: 44 additions & 0 deletions generated/Auth/Endpoint/DeleteStripeTenantAndPricing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace AntiPatternInc\Saasus\Sdk\Auth\Endpoint;

class DeleteStripeTenantAndPricing extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndpoint implements \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Endpoint
{
use \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\EndpointTrait;
public function getMethod() : string
{
return 'DELETE';
}
public function getUri() : string
{
return '/stripe';
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
{
return array(array(), null);
}
public function getExtraHeaders() : array
{
return array('Accept' => array('application/json'));
}
/**
* {@inheritdoc}
*
* @throws \AntiPatternInc\Saasus\Sdk\Auth\Exception\DeleteStripeTenantAndPricingInternalServerErrorException
*
* @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\DeleteStripeTenantAndPricingInternalServerErrorException($serializer->deserialize($body, 'AntiPatternInc\\Saasus\\Sdk\\Auth\\Model\\Error', 'json'));
}
}
public function getAuthenticationScopes() : array
{
return array('Bearer');
}
}
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/DeleteTenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DeleteTenant extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEn
/**
* SaaSus Platform で管理する、テナントの詳細情報を削除します。
Delete tenant information managed by SaaSus Platform.
Delete SaaSus Platform tenant.
*
* @param string $tenantId テナントID(Tenant ID)
Expand Down
4 changes: 2 additions & 2 deletions generated/Auth/Endpoint/DeleteTenantAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class DeleteTenantAttribute extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Clie
/**
* SaaSus Platform で管理する、テナントの追加属性の削除を行います。
Deletes additional attributes of tenants managed by SaaSus Platform.
Deletes tenant attributes managed by SaaSus Platform.
*
* @param string $attributeName 属性名(attribute name)
* @param string $attributeName 属性名(Attribute Name)
*/
public function __construct(string $attributeName)
{
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/DeleteTenantUserRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DeleteTenantUserRole extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Clien
/**
* テナントのユーザーから役割(ロール)を削除します。
Delete a role (role) from a tenant user.
Remove a role from a tenant user.
*
* @param string $tenantId テナントID(Tenant ID)
Expand Down
4 changes: 2 additions & 2 deletions generated/Auth/Endpoint/DeleteUserAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class DeleteUserAttribute extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client
/**
* SaaSus Platform にて保持するユーザーの追加属性を削除します。
Delete the additional attributes of the user retained by the SaaSus Platform.
Delete user attributes kept on the SaaSus Platform.
*
* @param string $attributeName 属性名(attribute name)
* @param string $attributeName 属性名(Attribute Name)
*/
public function __construct(string $attributeName)
{
Expand Down
4 changes: 2 additions & 2 deletions generated/Auth/Endpoint/GetAllTenantUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class GetAllTenantUser extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Ba
* ユーザーIDからテナントに所属しているユーザー情報を取得します。
複数テナントに所属している場合は別のオブジェクトとして返却されます。
Get the user information belonging to the tenant from the user ID.
If it belongs to multiple tenants, it will be returned as another object.
Get information on user belonging to the tenant from the user ID.
If the user belongs to multiple tenants, it will be returned as another object.
*
* @param string $userId ユーザーID(User ID)
Expand Down
18 changes: 13 additions & 5 deletions generated/Auth/Endpoint/GetAuthCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
class GetAuthCredentials extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndpoint implements \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Endpoint
{
/**
* 一時コードを利用してIDトークン・アクセストークン・リフレッシュトークンを取得する。
* 一時コードまたはリフレッシュトークンを利用してIDトークン・アクセストークン・リフレッシュトークンを取得する。
Get an ID token, access token, and refresh token using a temporary code.
Get ID token, access token, and refresh token using a temporary code or a refresh token.
*
* @param array $queryParameters {
* @var string $code 一時コード(temp code)
* @var string $code 一時コード(Temp Code)
* @var string $auth-flow 認証フロー(Authentication Flow)
tempCodeAuth: 一時コードを利用した認証情報の取得
refreshTokenAuth: リフレッシュトークンを利用した認証情報の取得
指定されていない場合は tempCodeAuth になります
* @var string $refresh-token リフレッシュトークン(Refresh Token)
* }
*/
public function __construct(array $queryParameters = array())
Expand All @@ -38,10 +44,12 @@ public function getExtraHeaders() : array
protected function getQueryOptionsResolver() : \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getQueryOptionsResolver();
$optionsResolver->setDefined(array('code'));
$optionsResolver->setRequired(array('code'));
$optionsResolver->setDefined(array('code', 'auth-flow', 'refresh-token'));
$optionsResolver->setRequired(array());
$optionsResolver->setDefaults(array());
$optionsResolver->addAllowedTypes('code', array('string'));
$optionsResolver->addAllowedTypes('auth-flow', array('string'));
$optionsResolver->addAllowedTypes('refresh-token', array('string'));
return $optionsResolver;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/GetEnv.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GetEnv extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndpoint
/**
* 環境情報の詳細を取得します。
Get environment information details.
Get environment details.
*
* @param int $envId 環境ID(Env ID)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/GetSaasUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GetSaasUser extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEnd
/**
* ユーザーIDからユーザー情報を取得します。
Get user information from user ID.
Get user information based on user ID.
*
* @param string $userId ユーザーID(User ID)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/GetTenant.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GetTenant extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEndpo
/**
* SaaSus Platform で管理する、テナントの詳細情報を取得します。
Get detailed information about a tenant registered with the SaaSus Platform.
Get the details of tenant managed on the SaaSus Platform.
*
* @param string $tenantId テナントID(Tenant ID)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/GetTenantUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GetTenantUser extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseE
/**
* テナントのユーザーをIDから一件取得します。
Acquires one tenant user by specifying the ID.
Get one tenant user by specific ID.
*
* @param string $tenantId テナントID(Tenant ID)
Expand Down
4 changes: 2 additions & 2 deletions generated/Auth/Endpoint/GetTenantUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class GetTenantUsers extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Base
/**
* テナントに所属するユーザーを全件取得します。 idは一意です。
Get all users belonging to the tenant.
id is unique.
Get all the users belonging to the tenant.
Id is unique.
*
* @param string $tenantId テナントID(Tenant ID)
Expand Down
4 changes: 2 additions & 2 deletions generated/Auth/Endpoint/GetUserInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class GetUserInfo extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\BaseEnd
User information is obtained based on the ID token of the SaaS user (registered user).
The ID token is passed to the Callback URL during login from the SaaSus Platform generated login screen.
By getting the ID token from the URL on the server side and calling this API, you can get the information of the user.
User information can be obtained from calling this API with an ID token from the URL on the server side.
Since the acquired tenant, role (role), price plan, etc. are included, it is possible to implement authorization based on it.
*
* @param array $queryParameters {
* @var string $token IDトークン(ID token)
* @var string $token IDトークン(ID Token)
* }
*/
public function __construct(array $queryParameters = array())
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/UpdateAuthInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UpdateAuthInfo extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Base
* ログイン後に認証情報を渡す SaaS の URL を登録します。
ここで登録した URL に認証情報を渡し、SaaSus SDK を利用してこの Callback の実装をすることが可能となります。
Register a SaaS URL to pass authentication after login.
Register post-login SaaS URL for authentication information.
It is possible to pass authentication information to the URL registered here and implement this Callback using the SaaSus SDK.
*
Expand Down
6 changes: 3 additions & 3 deletions generated/Auth/Endpoint/UpdateBasicInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class UpdateBasicInfo extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client\Bas
CNAME レコードが生成されますので、 DNS に設定して下さい。
既に稼働中の SaaS アプリケーションに設定している場合には、動作に影響があります。
Update the domain name set as a parameter based on the SaaS ID.
A CNAME record will be generated, so set it in your DNS.
If you set it on a SaaS application that is already running, it will affect your behavior.
Update the domain name that was set as a parameter based on the SaaS ID.
After the CNAME record is generated, set it in your DNS.
If it is set on a SaaS application that is already running, it will affect the behavior.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\UpdateBasicInfoParam $requestBody
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/UpdateCustomizePages.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class UpdateCustomizePages extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Clien
/**
* 認証系画面設定情報(新規登録・ログイン・パスワードリセット等)を更新します。
Update the authentication screen setting information (new registration, login, password reset, etc.).
Update the authentication page setting information (new registration, login, password reset, etc.).
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\UpdateCustomizePagesParam $requestBody
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/UpdateNotificationMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class UpdateNotificationMessages extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime
/**
* 各種通知メールテンプレート更新します。
Update the registered notification email template.
Update notification email template.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\UpdateNotificationMessagesParam $requestBody
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/UpdateSaasUserEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UpdateSaasUserEmail extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Client
/**
* ユーザーのメールアドレスを変更します。
Change a user's email.
Change user's email.
*
* @param string $userId ユーザーID(User ID)
Expand Down
2 changes: 1 addition & 1 deletion generated/Auth/Endpoint/UpdateSaasUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UpdateSaasUserPassword extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Cli
/**
* ユーザーのログインパスワードを変更します。
Change a user's login password.
Change user's login password.
*
* @param string $userId ユーザーID(User ID)
Expand Down
4 changes: 2 additions & 2 deletions generated/Auth/Endpoint/UpdateSignInSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class UpdateSignInSettings extends \AntiPatternInc\Saasus\Sdk\Auth\Runtime\Clien
* ユーザーパスワードの要件設定を更新します。
アルファベット、数字、記号の組み合わせで、桁数を長くすれば解読されづらい安全なパスワードを設定することが可能となります。
Update user password requirement settings.
It is possible to set a secure password that is difficult to decipher by increasing the number of digits by combining alphabets, numbers, and symbols.
Update user password requirements.
Set a secure password that is difficult to decipher by increasing the number of digits by combining alphabets, numbers, and symbols.
*
* @param null|\AntiPatternInc\Saasus\Sdk\Auth\Model\UpdateSignInSettingsParam $requestBody
Expand Down
Loading

0 comments on commit c51bb0d

Please sign in to comment.