saasus-sdk-csharp 1.0.0-test.2

This is a prerelease version of saasus-sdk-csharp.
dotnet add package saasus-sdk-csharp --version 1.0.0-test.2
                    
NuGet\Install-Package saasus-sdk-csharp -Version 1.0.0-test.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="saasus-sdk-csharp" Version="1.0.0-test.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="saasus-sdk-csharp" Version="1.0.0-test.2" />
                    
Directory.Packages.props
<PackageReference Include="saasus-sdk-csharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add saasus-sdk-csharp --version 1.0.0-test.2
                    
#r "nuget: saasus-sdk-csharp, 1.0.0-test.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package saasus-sdk-csharp@1.0.0-test.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=saasus-sdk-csharp&version=1.0.0-test.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=saasus-sdk-csharp&version=1.0.0-test.2&prerelease
                    
Install as a Cake Tool

SDK 使用手順

このガイドでは、saasus-sdk-csharp.NET 8 および .NET Framework 4.8 アプリケーションに導入する手順を説明します。


.NET 8 アプリケーションで SDK を使用する手順

1. SDK をプロジェクトに追加し、ビルド&実行する

Visual Studio を使用する場合
  1. ソリューションに SDK を追加

    • Visual Studioソリューション (.sln) を開く
    • ソリューションエクスプローラー でアプリケーションプロジェクトを右クリックし、[参照の追加] を選択
    • [プロジェクト] タブから saasus-sdk-csharp を選択し、[OK] をクリック
  2. ビルド

    • メニューから [ビルド] → [ソリューションのビルド] を選択
    • ビルドが完了し、エラーがないことを確認
  3. 実行

    • F5 キー または [デバッグ] → [デバッグの開始] でアプリケーションを実行
    • Ctrl + F5 または [デバッグなしで開始] でデバッグなし実行

コマンドラインを使用する場合
  1. アプリケーションプロジェクトのディレクトリに移動MyApp がアプリケーションプロジェクトのフォルダと仮定)

    cd path/to/MyApp
    
  2. SDK をプロジェクト参照 & ソリューションに追加

    • アプリケーションプロジェクトの .csproj があるディレクトリで実行
    dotnet add reference ../saasus-sdk-csharp/saasus-sdk-csharp.csproj
    
    • ソリューションの .sln があるディレクトリで実行
    dotnet sln add ../saasus-sdk-csharp/saasus-sdk-csharp.csproj
    

    注意: 上記の ../saasus-sdk-csharp/saasus-sdk-csharp.csproj は、SDK の csproj への相対パスです。
    ユーザーのプロジェクト構成によって適宜パスを変更してください。

  3. ビルド & 実行(アプリケーションプロジェクトのディレクトリまたはソリューションのディレクトリで実行)

    dotnet build
    dotnet run
    

3. 動作確認

アプリケーションコード内で saasus-sdk-csharp を参照し、期待する機能が正しく動作するか確認してください。


JSONライブラリについての注意点

SDKではデフォルトでNewtonsoft.Jsonライブラリを使用しています。そのため、アプリケーションのJSONライブラリがSystem.Text.Jsonなど他のライブラリに設定されている場合、以下の点に注意が必要です。

Newtonsoft.Jsonを使用する場合

モデルをそのままレスポンスとして返却できます。

var userInfo = await userInfoApi.GetUserInfoAsync(token);

// モデルをそのままレスポンスに返却
return Ok(userInfo);
異なるJSONライブラリを使用する場合

シリアライズ処理を明示的に行う必要があります。

var userInfo = await userInfoApi.GetUserInfoAsync(token);

// JSON形式でレスポンスを返す(SDKのToJsonメソッドを利用)
var jsonResponse = userInfo.ToJson();
return Results.Text(jsonResponse, "application/json");

// Newtonsoft.Jsonを使用して明示的にシリアライズ
var jsonResponse = JsonConvert.SerializeObject(users.VarUsers);
return Results.Text(jsonResponse, "application/json");

JSONライブラリの設定に応じて、必要なシリアライズ処理を追加してください。


.NET Framework 4.8(packages.config)アプリケーションで SDK を使用する手順

1. SDK プロジェクトのビルド

  1. SDK のソースコードがあるディレクトリに移動します:

    cd <SDKのソースコードディレクトリ>
    
  2. 以下のコマンドを実行してプロジェクトをビルドします:

    dotnet build -c Release
    
  3. ビルドが成功したことを確認してください。


2. NuGet パッケージの生成

  1. 以下のコマンドを実行して NuGet パッケージを生成します:

    dotnet pack -c Release
    
  2. コマンドを実行すると、bin/Release フォルダに .nupkg ファイルが生成されます。 例:

    bin/Release/saasus-sdk-csharp.1.0.0.nupkg
    

3. ローカルフィードの設定

3.1 ローカルフィード用ディレクトリを作成

ローカルフィードとして利用するディレクトリを作成します:

mkdir C:\LocalNuGetFeed
3.2 パッケージをコピー

生成した .nupkg ファイルをローカルフィードディレクトリにコピーします:

cp bin/Release/saasus-sdk-csharp.1.0.0.nupkg C:\LocalNuGetFeed
3.3 Visual Studio でローカルフィードを設定
  1. Visual Studio を開きます。
  2. メニューから [ツール][オプション] を選択します。
  3. [NuGet パッケージ マネージャー][パッケージ ソース] を選択します。
  4. [追加] ボタンをクリックし、以下を設定します:
    • 名前: LocalFeed(任意の名前)
    • ソース: C:\LocalNuGetFeed
  5. [OK] をクリックして保存します。

4. アプリケーションに SDK をインストール

  1. 対象プロジェクトを開く

    • Visual Studio で .NET Framework プロジェクト(例: MyApp.sln)を開きます。
  2. NuGet パッケージをインストール

    1. ソリューションエクスプローラーでプロジェクトを右クリックし、[NuGet パッケージの管理] を選択します。
    2. 「パッケージソース」から、追加した LocalFeed を選択します。
    3. 一覧に表示された saasus-sdk-csharp を選択し、[インストール] をクリックします。

環境変数の設定

SDKを正しく動作させるには、以下の環境変数の設定が必要です。

環境変数名 説明
SAASUS_SAAS_ID SaaSの識別子(SaaS ID)
SAASUS_API_KEY APIアクセス用のAPIキー
SAASUS_SECRET_KEY クライアントシークレットキー

環境変数の設定方法は、実行環境やアプリケーションの要件に応じて適切に行ってください。 例えば、appsettings.jsonに定義した値を読み込んで環境変数に設定することもできます。


Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-test.2 456 7/25/2025