openapi: 3.0.0
info:
  title: CWS APIリファレンス
  version: '1.0'
  description: >
    CWS APIのAPI外形を定義します。



    ## 非推奨機能について


    CWS APIでは、機能追加・変更・改善に伴い非推奨となった機能を、原則として最低6ヶ月の移行期間を経て廃止します。


    非推奨機能は、APIリファレンスにて<span style="display:inline-block;padding:2px
    8px;margin:0;background-color:#ffa500;color:#ffffff;font-size:12px;vertical-align:middle;line-height:1.6;border-radius:4px;font-weight:600;">Deprecated</span>と表記しています。


    非推奨機能となる場合や非推奨機能の廃止は、[お知らせ](/information)にてご案内します。


    廃止を予定している非推奨機能は、次の通りです。


    ### 2026年9月のリリースで廃止となる非推奨機能


    -
    [ソフトウェアの配信状態を取得する](/apis/v1/cws_api#tag/Update/operation/get-v1-applications-packages-versions-distributions-status)
      - レスポンスの`exist`キーは2026年9月のリリースで廃止します。
      - 代わりに`distributable`をご利用ください。

    ### 2026年10月のリリースで廃止となる非推奨機能


    [通知・アクセス設定内容取得](/apis/v1/cws_api#tag/Config/operation/get-v1-applications)と[通知・アクセス設定](/apis/v1/cws_api#tag/Config/operation/patch-v1-applications)で使用している`remoteSupportEvent`は、

    Webhook通知の送信先URLを指定するための項目として提供していましたが、対応する通知イベントはこれまで実装されておらず、実際に利用されることはありませんでした。<br/>

    今後も本項目を利用した通知機能を提供する予定はないため、2026年10月のリリースで廃止します。


    - [通知・アクセス設定内容取得](/apis/v1/cws_api#tag/Config/operation/get-v1-applications)
      - レスポンスの`remoteSupportEvent`キー
    - [通知・アクセス設定](/apis/v1/cws_api#tag/Config/operation/patch-v1-applications)
      - リクエストの`remoteSupportEvent`キー

    ### 2026年11月のリリースで廃止となる非推奨機能


    -
    [録画データ通知](/apis/v1/cws_notification#tag/Sora-Recorded-Event/operation/post-sora-save-event)
      - リクエストボディの`connections[].webmFile`キーは2026年11月のリリースで廃止します。
      - 代わりに`connections[].movieFile`をご利用ください。

    ### 廃止された機能


    これまでに廃止された機能については、[廃止機能](/docs/development/deprecated)を参照してください。


    ## エラーレスポンスについて


    - CWS API では、HTTP ステータスコードのみではエラー内容を十分に表現できない場合に、エラーレスポンスボディを返却します。

    - エラーレスポンスボディを返却する場合、`message`もしくは`reason`に、発生したエラーの概要を示します。

    - 発生したエラーに詳細情報がある場合は、`details`にエラー内容の詳細を示します。



    ## 利用者様THINKLETアプリからのファイルアップロードについて

    THINKLETにインストールされた利用者様アプリのデータを、利用者様指定の保存先にアップロードするために、Amazon
    S3の署名付きURL取得URL、及びイベント通知先URLを利用者様でご用意ください。


    利用者様で用意いただいた各URLを利用して、CWS APIでは次の処理を行います。


    #### データをアップロードするため、下記で設定されたURLに対して署名付きURL発行を依頼します


    - `fileUploadGetUrl`（ファイルアップロード用署名付きURL取得URL)


    #### アップロードの成功/失敗は、下記で設定されたURLに対して通知します


    - `fileUploadEvent` (ファイルアップロード用イベント通知先URL)


    ファイルアップロード利用の詳細に関しては、[ファイルアップロード用署名付きURL取得](/apis/v1/cws_presigned_url#tag/FileUpload)を参照ください。


    ## 通知・アクセス設定、authenticationKeyを発行する で登録・更新できる設定値について

    [通知・アクセス設定](#tag/Config/operation/patch-v1-applications)、[authenticationKeyを発行する](#tag/Config/operation/post-v1-applications-auth)で必要な設定が行われていない場合、一部機能が利用できなくなります。<br/>

    それぞれの設定値と制限がかかる機能は以下となります。


    - `authenticationKey`
      - この設定は、多くの機能で使用しています。<br/>
        未設定の場合、殆どの機能が利用できないため、必ず[authenticationKeyを発行する](#tag/Config/operation/post-v1-applications-auth)を行ってください。<br/>
        この設定は、CWS APIを安全にご利用いただくために、Webhookによる通知の検証に使用します。詳しくは[authenticationKeyの利用方法](/apis/v1/cws_notification#section/authenticationKey)を参照してください。
    - `deviceEvent`
      - この設定は、端末で発生したイベントを送信、トランザクションの端末側実行結果の通知に使用しています。<br/>
        未設定の場合、トランザクションを発行するAPIと端末で発生したイベントの通知は利用できません。
    - `remoteSupportEvent`
      - 現在使用していない設定です。<br/>未設定の場合に使えなくなる機能はありません。
      - **この設定は非推奨です。2026年10月のリリースで廃止します。**
    - `soraEvent`
      - この設定は、通話で発生したイベントの送信に使用しています。<br/>
        未設定の場合、通話は行うことができますが、通話で発生したイベントが通知されません。
    - `soraFileSendEvent`
      - この設定は、録画データ保存結果の通知に使用しています。<br/>
        未設定の場合、録画データがアップロードされません。
    - `soraRecGetMultiPresignedUrl`
      - この設定は、録画データ保存時の署名付きURL取得に使用しています。<br/>
        未設定の場合、録画データがアップロードされません。
    - `fileUploadEvent`
      - この設定は、ファイルアップロードイベントの通知に使用しています。<br/>
        未設定の場合、ファイルアップロード機能は利用できません。
    - `fileUploadGetUrl`
      - この設定は、ファイルアップロード機能の署名付きURL取得に使用しています。<br/>
        未設定の場合、ファイルアップロード機能は利用できません。

    ## Connectivityの各APIの利用について


    Connectivity の各APIは、下記バージョン以降の`mdmclient`に対応しています。

    - mdmclient versionName : 2.3.1以上（Fw 9.001.0以上）
      
    THINKLETの`mdmclient`が上記のバージョン未満の場合、正常に動作しません。  

    上記バージョン未満の`mdmclient`がインストールされているTHINKLETに対して、Connectivityの各APIを実行した場合は、トランザクションが未処理のままとなってしまうため、[トランザクションをキャンセルする](#tag/Transaction/operation/delete-v1-applications-devices-transactions)を実行して、トランザクションをキャンセルしてください。


    ### THINKLETとBluetoothデバイスとのペアリング方法
      - [Bluetooth/ネットワークのON/OFF状態を取得する](/apis/v1/cws_api#tag/Connectivity/operation/get-v1-applications-connectivity-state) を使用し、 Bluetooth の状態を確認します。
        - 状態の取得結果は [トランザクション結果通知(Bluetooth/ネットワークのON/OFF状態を取得、変更する)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-connectivity-onoff) に通知されます。
        - 無効になっている場合は、 [Bluetooth/ネットワークON/OFF設定を変更する](/apis/v1/cws_api#tag/Connectivity/operation/put-v1-applications-connectivity-state) を使用し、 Bluetooth を有効化します。
      - ペアリングしたいBluetooth デバイスを用意し、 [Bluetoothデバイス/ネットワークの一覧を取得する](/apis/v1/cws_api#tag/Connectivity/operation/get-v1-applications-connectivity-list) を使用し、Bluetoothデバイス名とMACアドレスを確認します。
        - 一覧の取得結果は [トランザクション結果通知(Bluetoothデバイス/ネットワークの一覧を取得)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-connectivity-list) に通知されます。
      - 上記で取得したMACアドレスを指定して [Bluetoothデバイスのペアリングを行う](/apis/v1/cws_api#tag/Connectivity/operation/post-v1-applications-bluetooth-device) を使用して、Bluetoothデバイスのペアリングを行います。
        - Bluetoothデバイスのペアリング結果は [トランザクション結果通知(Bluetoothペアリング)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-Bluetooth-pairing) に通知されます。
      - Bluetoothデバイスに接続されると [デバイス状態変更通知(Bluetoothデバイス接続/切断)](/apis/v1/cws_notification/#tag/Device-Event(notify-device-state)/operation/post-result-bluetooth) に通知されます。

    ### Bluetooth/ネットワークの種別(type)を指定する各API について
      - 現在は Bluetooth のみ対応しています。
      - 当面は Bluetooth/ネットワークの種別 に wifi, mobile が指定された場合、400エラーを返却します。
servers:
  - url: https://apis.thinklet.fd.ai
    description: CWS API
paths:
  /v1/applications/{applicationId}:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: 通知・アクセス設定内容取得
      tags:
        - Config
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemSettingGet'
              examples:
                example:
                  value:
                    authenticationKey: >-
                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    deviceEvent: https://xxxxx
                    soraEvent: https://xxxxx
                    soraFileSendEvent: https://xxxxx
                    soraRecGetMultiPresignedUrl: https://xxxxx
                    fileUploadEvent: https://xxxxx
                    fileUploadGetUrl: https://xxxxx
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - URL誤りなど
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      operationId: get-v1-applications
      description: |-
        自身のアプリケーションIDに紐づくシステム連携設定を取得します。

        ### 特記事項
        - `authenticationKey` は、本APIでは新規発行、更新されません。
          - 新規発行、更新する場合は、[authenticationKeyを発行する](#tag/Config/operation/post-v1-applications-auth)を利用してください。
          - 新規発行されていない場合は、`authenticationKey`の要素自体がレスポンスに含まれません。
        - ファイルアップロードに関連する設定値は下記リンク先を参照ください。
          - `fileUploadGetUrl` ([ファイルアップロード用署名付きURL取得](/apis/v1/cws_presigned_url#tag/FileUpload))
          - `fileUploadEvent` ([ファイルアップロードイベント通知](/apis/v1/cws_notification#tag/File-Upload-Event/operation/post-file-upload-event))
    patch:
      summary: 通知・アクセス設定
      operationId: patch-v1-applications
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      responses:
        '200':
          description: OK - 正常時
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - URL誤りなど
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: |-
        自身のアプリケーションに対するシステム連携情報を登録・更新します。

        ### 特記事項
        - ファイルアップロードに関連する設定値は下記リンク先を参照ください。
          - `fileUploadGetUrl` ([ファイルアップロード用署名付きURL取得](/apis/v1/cws_presigned_url#tag/FileUpload))
          - `fileUploadEvent` ([ファイルアップロードイベント通知](/apis/v1/cws_notification#tag/File-Upload-Event/operation/post-file-upload-event))
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemSetting'
            examples:
              example-1:
                value:
                  deviceEvent: https://xxxxx
                  soraEvent: https://xxxxx
                  soraFileSendEvent: https://xxxxx
                  soraRecGetMultiPresignedUrl: https://xxxxx
                  fileUploadEvent: https://xxxxx
                  fileUploadGetUrl: https://xxxxx
        description: ''
      tags:
        - Config
  /v1/applications/{applicationId}/refresh_authkey:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    post:
      summary: authenticationKeyを発行する
      tags:
        - Config
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      responses:
        '201':
          description: Created - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationKeyResponse'
              examples:
                example:
                  value:
                    authenticationKey: >-
                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - URL誤りなど
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      operationId: post-v1-applications-auth
      description: >-
        自身のアプリケーションIDに紐づくauthenticationKeyを発行する


        ### 特記事項

        - 本APIを実行することで、`authenticationKey` が発行されます。
          - `authenticationKey`を未発行である場合、新規発行されます。
          - `authenticationKey`を発行済である場合、既存Keyは無効となり、新規発行Keyが有効となります。
        -
        発行済みのauthenticationKeyを取得する場合は、[通知・アクセス設定内容取得](#tag/Config/operation/get-v1-applications)を利用してください
  /v1/applications/{applicationId}/devices:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
  /v1/applications/{applicationId}/devices/{deviceId}:
    parameters:
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI番号
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: デバイスのアクティベート状態を取得する
      operationId: get-v1-applications-devices
      security:
        - cwsAuth:
            - cws:device:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.r
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceActivateStatus'
              examples:
                activated:
                  value:
                    status: activated
                    clientId: 123e8f0fd2c044ef9074ef0b84d1cf88
                deactivated:
                  value:
                    status: deactivated
        '400':
          description: Bad Request - 入力値誤り
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - デバイス情報が取得できない、アプリケーション未登録、URL誤り、他のアプリケーションでアクティベート済み
        '404':
          description: Not Found - パスパラメータ不正
        '405':
          description: Method Not Arrowed - GET以外のメソッドが指定された場合
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        本APIはデバイスのアクティベート・ディアクティベート状態を取得するAPIです。`Path Parameters`
        で指定されたアプリケーションに対し、デバイスがアクティベートされていた場合 `status` は`activated`
        、`clientId`はmimiのクライアントIDとなります。デバイスがデベロッパーに紐づいているかつ、デベロッパー内のどのアプリケーションにも紐づいていない場合、`deactivated`
        となります。他のapplicationでactivateされている場合はHTTP 403を返却します。
      tags:
        - Device
    post:
      summary: デバイスをアクティベートする
      operationId: post-v1-applications-devices
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
                format: uri
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: >-
            Forbidden -
            アクティベート済みの端末を操作した場合、アプリケーション未登録、利用申込みを実施していない場合、アクティベート数が申し込みTHINKLETデバイス数を超える場合、URL誤りなど
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                利用申込みなし/THINKLET台数超過:
                  value:
                    message: not contracted or activation limit exceeded.
                使用されているmimiClientIdを指定した場合:
                  value:
                    message: ClientId is already in use.
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        デバイスをアクティベートします。


        CWS
        APIの利用申込みを実施していない場合や、本API実行時のアクティベート数が、申込みしたTHINKLETの台数に達していた場合、本APIでエラーを返却します。
      parameters: []
      tags:
        - Device
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Activate'
    delete:
      summary: デバイスをディアクティベートする
      operationId: delete-v1-applications-devices
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末(ディアクティベート済みの端末含む)を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: デバイスをディアクティベートします。
      tags:
        - Device
  /v1/applications/{applicationId}/devices/{deviceId}/status:
    parameters:
      - schema:
          type: string
        name: deviceId
        in: path
        description: THINKLETのIMEI
        required: true
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: デバイス状態取得
      operationId: get-v1-applications-devices-status
      security:
        - cwsAuth:
            - cws:device:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.r
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceStatus'
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: |-
        デバイスの状態を取得します。

        ### 補足
        - `lang`
          - 端末に設定されている言語設定を返却します。形式の詳細は[言語設定をする](#tag/Operation/operation/put-v1-applications-devices-settings-lang)を参照してください。
      tags:
        - Device
  /v1/applications/{applicationId}/devices/status:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: デバイス状態の一覧を取得
      operationId: get-v1-applications-devices-status-list
      security:
        - cwsAuth:
            - cws:device:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.r
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceStatusList'
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: |-
        指定したアプリケーションIDに属するデバイスの状態の一覧を取得します。

        ### 補足
        - `lang`
          - 端末に設定されている言語設定を返却します。形式の詳細は[言語設定をする](#tag/Operation/operation/put-v1-applications-devices-settings-lang)を参照してください。
      tags:
        - Device
  /v1/devices/{deviceId}/hardware-properties:
    parameters:
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: デバイスのハードウェアプロパティを取得する
      operationId: get-v1-applications-devices-hardware-properties
      security:
        - cwsAuth:
            - cws:device:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.r
      description: |-
        ### 概要
        本APIは、指定したdeviceIdのハードウェアプロパティを取得するAPIです。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HardwarePropertiesInfo'
              examples:
                ハードウェアプロパティが登録済みの場合:
                  value:
                    deviceId: '123456789012345'
                    model:
                      name: LC-01
                      identifier: lc01-neckmount-8mp-portrait
                      description: >-
                        THINKLET (1st generation) neck mounted Vertical wide
                        angle 8MP
                      shape: neck-mounted
                    camera:
                      - direction: portrait
                        mountedPosition: rigth arm
                        resolution:
                          maxWidth: 2448
                          maxHeight: 3264
                    macAddressWifi: 0a:1b:2c:3d:4e:5f
                    macAddressBluetooth: 9a:8b:7c:6d:5e:4f
                ハードウェアプロパティが未登録の場合:
                  value:
                    deviceId: '123456789012345'
                    model: null
                    camera: null
        '400':
          description: Bad Request - 入力値誤り
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - デバイスIDが未登録、URL誤り
        '404':
          description: Not Found - パスパラメータ不正
        '405':
          description: Method Not Arrowed - GET以外のメソッドが指定された場合
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      tags:
        - Device
  /v1/applications/{applicationId}/devices/{deviceId}/settings/apn:
    parameters:
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: APNの設定をする
      operationId: put-v1-applications-devices-settings-apn
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: 指定したデバイスのAPN設定情報を更新します。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApnList'
            examples:
              example:
                value:
                  - name: string
                    apn: string
                    proxy: string
                    port: string
                    user: string
                    server: string
                    password: string
                    mmsc: string
                    mcc: string
                    mnc: string
                    mmsproxy: string
                    mmsport: string
                    authType: 0
                    type: string
                    protocol: string
                    carrierEnabled: string
                    bearer: 0
                    bearerBitmask: 0
                    roamingProtocol: string
                    mvnoType: string
                    mvnoMatchData: string
      tags:
        - Network
  /v1/applications/{applicationId}/devices/{deviceId}/settings/wifi:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: Wi-Fiを設定する
      operationId: put-v1-applications-devices-settings-wifi
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: 指定したデバイスのWi-Fi情報を更新します。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WifiList'
            examples:
              example:
                value:
                  - ssid: ssid-123
                    password: pass123
                    security: WEP
      parameters: []
      tags:
        - Network
  /v1/applications/{applicationId}/packages:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: 登録したソフトウェア（パッケージ）の一覧を取得する
      tags:
        - Update
      operationId: get-v1-applications-packages-list
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: |-
        登録したすべてのソフトウェアの`package`を一覧で取得します。

        ### 注意事項
        本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアの`package`を取得します。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PackageList'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    post:
      summary: ソフトウェア（パッケージ）を登録する
      tags:
        - Update
      operationId: post-v1-applications-packages
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: |-
        デバイスに配信するソフトウェアの`package`を登録します。

        ### 注意事項
        - `package`は、CWS API全体で一意である必要があります。
        - `ai.fd`で始まる`package`は使用できません。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PackageRegistrationRequest'
        required: true
        description: 登録するソフトウェアの`package`
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: 作成されたリソースのURI
              example: /v1/applications/{applicationId}/packages/com.example.myapp
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PackageRegistrationResponse'
        '400':
          description: Bad Request - 入力値誤り、ai.fdで始まる`package`を指定した場合
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
              example:
                reason: invalid request.
                details:
                  - loc:
                      - body
                      - package
                    msg: field required
                    type: value_error.missing
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '409':
          description: Conflict - `package`が既に登録されている(同一または異なるデベロッパー)
        '500':
          description: Internal Server Error - 内部エラー(DB接続時エラー、デベロッパー未登録など)
  /v1/applications/{applicationId}/packages/{package}:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: package
        in: path
        required: true
        description: ソフトウェアのパッケージ名
      - schema:
          type: string
        name: Authorization
        in: header
    patch:
      summary: ソフトウェア（パッケージ）の表示名を更新する
      tags:
        - Update
      operationId: patch-v1-applications-packages
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: >-
        登録したソフトウェアの`package`の表示名を更新します。


        ### 注意事項

        -
        本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアの`package`の表示名を更新します。

        - 表示名を削除する場合は、`displayName`に`null`を指定してください。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PackageDisplayNameUpdateRequest'
        required: true
        description: 更新する表示名
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PackageUpdateResponse'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    delete:
      summary: 登録したソフトウェア（パッケージ）の情報を削除する
      tags:
        - Update
      operationId: delete-v1-applications-packages
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: |-
        登録したソフトウェアの`package`を削除します。

        ### 注意事項
        本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアの`package`を削除します。

        ソフトウェアの`package`を削除するには、ソフトウェアの`package`に登録されている情報が、全て削除されている必要があります。
        以下を全て削除してから、実行してください。
        - ソフトウェアに登録されているバージョンの配信
          - [配信可能なソフトウェアとバージョンの一覧を取得する](#tag/Update/operation/get-v1-applications-available-sota-list)で、配信が開始されているバージョンが参照できます。
          - [ソフトウェアの配信を停止する](#tag/Update/operation/delete-v1-applications-packages-versions-distributions)で削除できます。
        - ソフトウェアに登録されているバージョンに対応するバイナリ
          - [ソフトウェアのバイナリアップロード状態を取得する](#tag/Update/operation/get-v1-applications-packages-versions-binaries-status)で、バイナリが登録されているか参照できます。
          - [ソフトウェアのバイナリを削除する](#tag/Update/operation/delete-v1-applications-packages-versions-binaries)で削除できます。
        - ソフトウェアに登録されているバージョン情報
          - [指定したソフトウェアの`package`のバージョンの一覧を取得する](#tag/Update/operation/get-v1-applications-package-version-list)で、登録されているバージョンが参照できます。
          - [指定したソフトウェアの`package`のバージョンを削除する](#tag/Update/operation/delete-v1-applications-package-version)で削除できます。
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '409':
          description: Conflict - ソフトウェアに紐づいているバージョンが存在している
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/packages/{package}/versions:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: package
        in: path
        required: true
        description: ソフトウェアのパッケージ名
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: 指定したソフトウェア（パッケージ）のバージョンの一覧を取得する
      tags:
        - Update
      operationId: get-v1-applications-package-version-list
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: |-
        指定したソフトウェアのバージョンを一覧で取得します。
        存在しないソフトウェアの`package`を指定した場合は、エラーとなります。

        ### 注意事項
        本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアのバージョンを取得します。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionList'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    post:
      summary: 指定したソフトウェア（パッケージ）のバージョンを登録する
      tags:
        - Update
      operationId: post-v1-applications-package-version
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: |-
        デバイスに配信するためのソフトウェアに、バージョンを登録します。

        ### 注意事項
        - バージョンは、セマンティックバージョニングに基づく名称を使用することを推奨します。
        - 同一のソフトウェアに対して、同じバージョンを重複して登録することはできません。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VersionRegistrationRequest'
        required: true
        description: 登録するバージョン
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: 作成されたリソースのURI
              example: >-
                /v1/applications/{applicationId}/packages/{package}/versions/1.0.0
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionRegistrationResponse'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
              examples:
                validation-error:
                  summary: 必須フィールドの欠落
                  description: 必須パラメータが不足している場合
                  value:
                    reason: invalid request.
                    details:
                      - loc:
                          - body
                          - version
                        msg: field required
                        type: value_error.missing
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない
        '409':
          description: Conflict - 指定したバージョンが既に登録されている
        '500':
          description: Internal Server Error - 内部エラー(DB接続時エラー、デベロッパー未登録など)
  /v1/applications/{applicationId}/packages/{package}/versions/{version}:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: package
        in: path
        required: true
        description: ソフトウェアのパッケージ名
      - schema:
          type: string
        name: version
        in: path
        required: true
        description: ソフトウェアのバージョン
      - schema:
          type: string
        name: Authorization
        in: header
    patch:
      summary: 指定したソフトウェア（パッケージ）のバージョンの説明を更新する
      tags:
        - Update
      operationId: patch-v1-applications-package-version
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: |-
        指定したバージョンの説明を更新します。

        ### 注意事項
        - 本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアのバージョンの説明を更新します。
        - 説明を削除する場合は、`description`に`null`を指定してください。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VersionDescriptionUpdateRequest'
        required: true
        description: 更新する説明
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionUpdateResponse'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない、バージョンが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    delete:
      summary: 指定したソフトウェア（パッケージ）のバージョンを削除する
      tags:
        - Update
      operationId: delete-v1-applications-package-version
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: |-
        指定したソフトウェアから、指定したバージョンを削除します。

        ### 注意事項
        - 本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアのバージョンを削除します。
        - バージョンを削除するには、バージョンに登録されている情報が、全て削除されている必要があります。
        以下を全て削除してから、実行してください。
          - ソフトウェアに登録されているバージョンの配信
            - [配信可能なソフトウェアとバージョンの一覧を取得する](#tag/Update/operation/get-v1-applications-available-sota-list)で、配信が開始されているバージョンが参照できます。
            - [ソフトウェアの配信を停止する](#tag/Update/operation/delete-v1-applications-packages-versions-distributions)で削除できます。
          - ソフトウェアに登録されているバージョンに対応するバイナリ
            - [ソフトウェアのバイナリアップロード状態を取得する](#tag/Update/operation/get-v1-applications-packages-versions-binaries-status)で、バイナリが登録されているか参照できます。
            - [ソフトウェアのバイナリを削除する](#tag/Update/operation/delete-v1-applications-packages-versions-binaries)で削除できます。
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない
        '409':
          description: Conflict - バイナリが存在する、配信が開始されている
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/packages/{package}/versions/{version}/binaries:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: package
        in: path
        required: true
        description: ソフトウェアのパッケージ名
      - schema:
          type: string
        name: version
        in: path
        required: true
        description: ソフトウェアのバージョン
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: ソフトウェアのバイナリアップロード状態を取得する
      tags:
        - Update
      operationId: get-v1-applications-packages-versions-binaries-status
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: |-
        指定したソフトウェアのバージョンのバイナリの状態を取得します。

        ### 注意事項
        本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアのバイナリの状態を取得します。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BinaryStatus'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない、バージョンが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    delete:
      summary: ソフトウェアのバイナリを削除する
      tags:
        - Update
      operationId: delete-v1-applications-packages-versions-binaries
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: >-
        指定したソフトウェアのバージョンのバイナリを削除します。


        ### 注意事項

        - 本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアのバイナリを削除します。

        -
        配信が開始されている状態で、バイナリを削除すると[ソフトウェアをすぐにアップデートさせる](#tag/Update/operation/put-v1-applications-devices-apps)
        で400エラーとなります。
          - [ソフトウェアの配信を停止する](#tag/Update/operation/delete-v1-applications-packages-versions-distributions)を実行後、本APIを使用することを推奨します。
        - バイナリを削除後、端末で該当のソフトウェアのアップデートが行われると、アップデートが失敗します。
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - 指定したソフトウェアの`package`が存在しない、指定したバージョンが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    post:
      summary: ソフトウェアのバイナリをアップロードするためのURLを作成する
      tags:
        - Update
      operationId: post-v1-applications-packages-versions-binaries-upload-url
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: >-
        指定したソフトウェアのバージョンに対して、対応するバイナリをアップロードするためのURLを発行します。

        このURLは Amazon S3 の presigned URL
        です。このAPIではファイル自体のアップロードは行いません。返却されたURLを使用して、クライアントから直接アップロードしてください。


        ### 注意事項

        - マルチパートアップロードには対応しておりません。

        - 発行したAmazon S3 presigned URLへアップロードを行う際、Content-Typeには
        `application/vnd.android.package-archive`を指定することを推奨します。

        - アップロード可能なソフトウェアの`package`のファイルサイズは、5GBまでです。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BinaryUploadUrlResult'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
              examples:
                validation-error:
                  summary: 必須フィールドの欠落
                  description: 必須パラメータが不足している場合
                  value:
                    reason: invalid request.
                    details:
                      - loc:
                          - pathParameters
                          - package
                        msg: field required
                        type: value_error.missing
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない、バージョンが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
              example:
                reason: package not found.
        '500':
          description: Internal Server Error - 内部エラー(DB接続時エラー、デベロッパー未登録など)
  /v1/applications/{applicationId}/apps:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    post:
      summary: ソフトウェアをアップロードするためのURLを作成する
      tags:
        - Update
      operationId: post-v1-applications-software-upload-url
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: >-
        指定した内容でソフトウェアをアップロードするためのURL（Amazon S3 presigned URL）を作成して返却します。


        指定したpackageとversionが未登録の場合、登録処理を行います。


        指定のapplicationに対して、指定のpackageとversionの配信を許可します。


        ただし、packageが、以下に当てはまる場合は、受け付けません。

        - `ai.fd`で始まる

        - 異なるデベロッパーで利用されている


        現状はmulti part に対応しておりません。


        発行したAmazon S3 presigned URLへアップロードを行う際、Content-Typeには
        `application/vnd.android.package-archive`を指定することを推奨します。


        [配信可能なソフトウェアとバージョンの一覧を取得するAPI](#tag/Update/operation/get-v1-applications-available-sota-list)のソート機能は、セマンティック・バージョニングを前提としています。そのため、パッケージのバージョニングにはセマンティック・バージョニングの利用を推奨いたします。

        アップロード可能なソフトウェアの`package`のファイルサイズは、5GBまでです。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SoftwareUploadRequest'
            examples:
              example:
                value:
                  package: ai.fd.thinklet.app.launcher
                  version: 1.0.0
                  fileSize: 123456789
        required: true
        description: >-
          - package と version は
          [ソフトウェアをすぐにアップデートさせる](#tag/Update/operation/put-v1-applications-devices-apps)
          で指定するものと同じ値を指定してください。

          - fileSize はuploadする予定のバイナリのサイズを設定してください。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SoftwareUploadUrlResult'
              example:
                appFileExists: true
                chunkPartSize: 10485760
                uploadId: null
                urlList:
                  - uploadUrl: https://s3.console.aws.amazon.com/s3/upload/xxxxxxxx
                    startTimestamp: 1633014000
                    endTimestamp: 1633017600
                    expireIn: 3600
        '400':
          description: Bad Request - 入力値誤り、package指定違反など
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              example:
                message: Invalid request body
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    get:
      summary: 配信可能なソフトウェアとバージョンの一覧を取得する
      tags:
        - Update
      operationId: get-v1-applications-available-sota-list
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: >-
        ### 概要

        配信可能なソフトウェアとバージョンの一覧を取得します。


        一覧のソート順は、ソフトウェアの`package`が昇順、バージョンは降順となります。

        セマンティック・バージョニングで付与されたバージョン以外は、意図しないソート結果となる場合があります。


        systemPackagesは、CWS
        からデフォルトで配信されているソフトウェアの`package`の一覧となります。この一覧はページネーション（offset,
        limit）の対象外です。

        systemPackagesでは、各ソフトウェアの`package`について、最大で3つの最新バージョンを取得します。
      parameters:
        - schema:
            type: string
          name: package
          in: query
          description: 一覧を取得したいソフトウェアのパッケージ名。未指定の場合、全てのソフトウェアの`package`を取得する。
        - schema:
            type: string
          name: mode
          in: query
          description: >-
            取得する一覧のモード。latestを指定した場合、各ソフトウェアの`package`の最新バージョンのみを取得する。未指定の場合は、対象のバージョンを全件取得する。
        - schema:
            type: integer
          name: offset
          in: query
          description: userPackagesの開始位置。未指定の場合は、0番目から取得する。
        - schema:
            type: integer
          name: limit
          in: query
          description: userPackagesの1ページあたりの取得件数。未指定の場合、100件取得する。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AvailableSotaPackages'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              example:
                message: Invalid request
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/packages/{package}/versions/{version}/distributions:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: package
        in: path
        required: true
        description: ソフトウェアのパッケージ名
      - schema:
          type: string
        name: version
        in: path
        required: true
        description: ソフトウェアのバージョン
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: ソフトウェアの配信状態を取得する
      tags:
        - Update
      operationId: get-v1-applications-packages-versions-distributions-status
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: |-
        指定したソフトウェアのバージョンの配信状態を取得します。

        ### 注意事項
        - 本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアの配信状態を取得します。
        - 2026年3月26日以前に配信を開始したバージョンの`distributionDate`は、2026年3月26日となっています。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DistributionStatus'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - 指定したソフトウェアの`package`が存在しない、指定したバージョンが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
              example:
                reason: package not found.
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
    post:
      summary: ソフトウェアの配信を開始する
      tags:
        - Update
      operationId: post-v1-applications-packages-versions-distributions
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: >-
        指定したソフトウェアのバージョンの配信を開始します。配信を開始したバージョンのみ、デバイスへのソフトウェアアップデートを実行できます。この設定は、配信の開始（POST）／配信の停止（DELETE）で操作します。


        ### 注意事項

        - バイナリをアップロード後に配信を開始することを推奨します。
          - バイナリが存在しない状態で、[ソフトウェアをすぐにアップデートさせる](#tag/Update/operation/put-v1-applications-devices-apps)を実行すると、エラーとなります。
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: 作成されたリソースのURI
              example: >-
                /v1/applications/{applicationId}/packages/{package}/versions/{version}/distributions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DistributionRegistrationResponse'
              example:
                package: com.example.myapp
                version: 1.0.0
                distributable: true
                distributionDate: '2026-02-12T10:30:45.123456'
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - ソフトウェアの`package`が存在しない、バージョンが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
              example:
                reason: package not found.
        '409':
          description: Conflict - 配信が既に開始されている
        '500':
          description: Internal Server Error - 内部エラー(DB接続時エラー、デベロッパー未登録など)
    delete:
      summary: ソフトウェアの配信を停止する
      tags:
        - Update
      operationId: delete-v1-applications-packages-versions-distributions
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: >-
        指定したソフトウェアのバージョンの配信を停止します。

        この操作は、すでに端末にインストールされているソフトウェアには影響しません。


        ### 注意事項

        本APIは、実行元のアプリケーションだけでなく、同一デベロッパーに属する全アプリケーションのソフトウェアの`package`を対象に、配信を停止します。
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '404':
          description: Not Found - 指定したソフトウェアの`package`が存在しない、指定したバージョンが存在しない
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageInfo'
              example:
                reason: package not found.
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/devices/{deviceId}/apps:
    parameters:
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: applicationId
        in: path
        description: アプリケーションID
        required: true
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: ソフトウェアをすぐにアップデートさせる
      operationId: put-v1-applications-devices-apps
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: 指定したアプリケーションを指定したデバイスにインストールします。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/App'
            examples:
              example:
                value:
                  package: ai.fd.thinklet.app.launcher
                  version: 0.2.2
        description: ''
      parameters: []
      tags:
        - Update
  /v1/applications/{applicationId}/firmware:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: 配信可能なファームウェアとバージョンの一覧を取得する
      tags:
        - Update
      operationId: get-v1-applications-available-fota-list
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: |-
        ### 概要
        配信可能なファームウェアとバージョンの一覧を取得します。

        一覧のソート順は、ファームウェアが昇順、バージョンは降順となります。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AvailableFotaPackages'
              example:
                firmwareVersions:
                  - package: firmware
                    version: 1.1.0
                  - package: firmware
                    version: 1.0.0
                  - package: firmware-box
                    version: 1.0.0
        '400':
          description: Bad Request - 入力値誤り
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              example:
                message: Invalid request
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション登録無し、URL誤り
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/devices/{deviceId}/firmware:
    parameters:
      - schema:
          type: string
        name: deviceId
        in: path
        description: THINKLETのIMEI
        required: true
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: ファームウェアをすぐにアップデートさせる
      operationId: put-v1-applications-devices-firmware
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
        '400':
          description: Bad Request - 入力値誤り、指定したバージョンがダウングレードの場合など
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: 指定したデバイスのファームウェアを更新させます。
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Firmware'
            examples:
              example:
                value:
                  version: 1.0.0
      tags:
        - Update
  /v1/applications/{applicationId}/transactions:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: query
        required: false
        description: THINKLETのIMEI番号
      - schema:
          type: string
          enum:
            - uncompleted
            - completed
            - canceled
        name: completionStatus
        in: query
        required: false
        description: |-
          トランザクションの完了状態、以下いずれかの値を指定できる。
          - uncompleted : 未完了
          - completed: 処理済み
          - canceled : キャンセル済み
      - schema:
          type: string
          enum:
            - success
            - failure
        name: transactionResult
        in: query
        required: false
        description: |-
          トランザクション結果での絞り込み。未指定の場合は絞り込みを行わない。
          - success : 正常に完了したトランザクションを取得する
          - failure : 失敗またはキャンセルされたトランザクションを取得する

            次の組み合わせは指定できない。
            - completionStatus=uncompleted とtransactionResultの組み合わせ（処理中のトランザクションには結果が存在しない）
            - completionStatus=canceled かつ transactionResult=success の組み合わせ（キャンセルされたトランザクションは failure となる）
      - schema:
          type: string
          enum:
            - asc
            - desc
        name: order
        in: query
        required: false
        description: ソート順。未指定の場合は、昇順(asc)となる。
      - schema:
          type: string
          enum:
            - transactionId
            - deviceId
            - transactionStatus
            - operationId
        name: sortBy
        in: query
        required: false
        description: ソート順を決める要素。未指定の場合は、transactionId順となる。
      - schema:
          type: number
          minimum: 1
          maximum: 100
        name: perPage
        in: query
        required: false
        description: >-
          取得するトランザクションの件数。未指定の場合は、該当のトランザクションを全て取得する。perPage 指定時に page
          が指定されていない場合エラーとなる。
      - schema:
          type: number
          minimum: 1
        name: page
        in: query
        required: false
        description: 取得するトランザクションのページ数。page 指定時に perPage が指定されていない場合エラーとなる。
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: トランザクションの一覧を取得する
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      tags:
        - Transaction
      operationId: get-v1-applications-transactions
      description: >-
        ### 概要

        アプリケーションIDに属するトランザクションを全て取得します。


        クエリパラメータで、取得するトランザクションの条件を指定することができます。


        ### 注意事項

        2026年5月リリースより前に発行されたトランザクションは、`requestBody`・`transactionResult` が null
        となります。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alltransactions'
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - access token無し、認証エラー
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/devices/{deviceId}/transactions:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: Authorization
        in: header
    delete:
      summary: トランザクションをキャンセルする
      tags:
        - Transaction
      operationId: delete-v1-applications-devices-transactions
      security:
        - cwsAuth:
            - cws:application:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.w
      description: |-
        ### 概要
        deviceIdに紐づく未処理のトランザクションをキャンセルします。

        ### トランザクションステータスのキャンセル可能範囲について

        #### キャンセル可能範囲一覧

        キャンセル可能な条件に合致したトランザクションが複数あった場合、全てキャンセルされます。

        | トランザクションステータス | THINKLET端末の通信状態 | キャンセル可能/不可能 |
        | --- | ----------- | ------- |
        | created    | - | 可能 |
        | published  | 不可能 | 可能 |
        |            | 可能 | 不可能 |
        | accepted   | - | 不可能 |
        | processed  | - | 不可能 |

        #### publishedの場合について
        トランザクションステータスがpublishedの場合は、THINKLET端末の通信状態により状態が変わります。

        - THINKLET端末が通信不可の場合（キャンセル可能）
          - THINKLET端末の接続を待ち、配信待機状態となる。
            - トランザクションステータスは、publishedのままとなる。
          - APIは配信待機しているトランザクションを**キャンセル可能です**。

        - THINKLET端末が通信可能の場合（キャンセル不可能）
          - THINKLET端末へ即時配信され、処理が開始される。
            - 処理が開始された段階で、トランザクションステータスはpublished->acceptedへ更新される。
          - APIはTHINKLET端末にトランザクションが配信されてしまっているので、**キャンセル不可能です**。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteTransactions'
              examples:
                example:
                  value:
                    canceledTransactions:
                      - 1
                      - 2
                      - 3
                      - 4
                      - 5
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/transactions/{transactionId}:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: transactionId
        in: path
        required: true
        description: トランザクションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: トランザクションの情報を取得する
      tags:
        - Transaction
      operationId: get-v1-applications-transaction
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: >-
        ### 概要

        アプリケーションIDに紐づくトランザクションの情報を取得します。


        2024年5月以降にキャンセルしたトランザクションは、transactionStatusが`canceled`となります。</br>

        2024年5月より前にキャンセルしたトランザクションのtransactionStatusは`processed`となります。


        ### 注意事項

        2026年5月リリースより前に発行されたトランザクションは、`requestBody`・`transactionResult`・`transactionResultEvent`
        が null となります。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTransaction'
              examples:
                通常操作（アクティベート）:
                  summary: >-
                    アクティベートなど通常操作の完了例。transactionResultEvent の result フィールドから
                    transactionResult が導出される
                  value:
                    transactionId: 1
                    transactionStatus: processed
                    transactionResult: success
                    transactionResultEvent:
                      result: success
                      message: ''
                      timestamp: '2024-06-01T09:00:05.000000'
                    operationId: post-v1-applications-devices
                    deviceId: '123456789023421'
                    requestBody:
                      mimiClientId: your-mimi-client-id
                      mimiClientSecret: '****************'
                    createdAt: '2024-06-01T09:00:00.000000'
                    updatedAt: '2024-06-01T09:00:05.000000'
                コマンド実行（PUT /commands）:
                  summary: >-
                    コマンド実行の完了例。transactionResultEvent の success（boolean）フィールドから
                    transactionResult が導出される
                  value:
                    transactionId: 2
                    transactionStatus: processed
                    transactionResult: success
                    transactionResultEvent:
                      success: true
                      process: processed
                      message: notify `processed` from called app.
                      customData: message you want to send
                      timestamp: '2024-06-01T10:00:03.000000'
                    operationId: put-v1-applications-devices-commands
                    deviceId: '123456789023421'
                    requestBody:
                      extras:
                        action: start
                    createdAt: '2024-06-01T10:00:00.000000'
                    updatedAt: '2024-06-01T10:00:03.000000'
                FOTA（ファームウェア更新）:
                  summary: ファームウェア・アプリ更新の完了例。処理中は progress が 1.0 未満の値となる
                  value:
                    transactionId: 3
                    transactionStatus: processed
                    transactionResult: success
                    transactionResultEvent:
                      result: success
                      progress: 1
                      message: install / update finished.
                      timestamp: '2024-06-01T11:05:00.000000'
                    operationId: put-v1-applications-devices-firmware
                    deviceId: '123456789023421'
                    requestBody:
                      version: 1.0.0
                    createdAt: '2024-06-01T11:00:00.000000'
                    updatedAt: '2024-06-01T11:05:00.000000'
                Bluetooth ペアリング（POST /bluetooth/device）:
                  summary: >-
                    Bluetooth ペアリングの完了例。transactionResultEvent の
                    statusCode（2xx）から transactionResult が導出される
                  value:
                    transactionId: 4
                    transactionStatus: processed
                    transactionResult: success
                    transactionResultEvent:
                      networkType: bluetooth
                      statusCode: 200
                      message: ''
                      devices:
                        - status:
                            mode: connected
                            registered: true
                          name: bluetooth name
                          alias: bluetooth alias name
                          address: AA:11:22:BB:2A:3A
                      timestamp: '2024-06-01T12:00:05.000000'
                    operationId: post-v1-applications-bluetooth-device
                    deviceId: '123456789023421'
                    requestBody:
                      address: AA:11:22:BB:2A:3A
                    createdAt: '2024-06-01T12:00:00.000000'
                    updatedAt: '2024-06-01T12:00:05.000000'
                Connectivity ON/OFF状態変更（PUT /connectivity/state）:
                  summary: >-
                    Bluetooth の ON/OFF 状態変更の完了例。transactionResultEvent に state
                    フィールドが含まれ、変更後の状態がわかる
                  value:
                    transactionId: 7
                    transactionStatus: processed
                    transactionResult: success
                    transactionResultEvent:
                      networkType: bluetooth
                      statusCode: 200
                      state: enabled
                      message: ''
                      timestamp: '2024-06-01T15:00:03.000000'
                    operationId: put-v1-applications-connectivity-state
                    deviceId: '123456789023421'
                    requestBody:
                      state: enabled
                    createdAt: '2024-06-01T15:00:00.000000'
                    updatedAt: '2024-06-01T15:00:03.000000'
                Connectivity 一覧取得（GET /connectivity/list）:
                  summary: >-
                    Bluetooth デバイスおよびネットワーク一覧取得の完了例。transactionResultEvent に
                    devices・networks・target フィールドが含まれる
                  value:
                    transactionId: 8
                    transactionStatus: processed
                    transactionResult: success
                    transactionResultEvent:
                      networkType: bluetooth
                      statusCode: 200
                      target: all
                      devices:
                        - status:
                            mode: connected
                            registered: true
                          name: bluetooth name
                          alias: bluetooth alias name
                          address: AA:11:22:BB:2A:3A
                      networks: []
                      message: ''
                      timestamp: '2024-06-01T16:00:03.000000'
                    operationId: get-v1-applications-connectivity-list
                    deviceId: '123456789023421'
                    requestBody: null
                    createdAt: '2024-06-01T16:00:00.000000'
                    updatedAt: '2024-06-01T16:00:03.000000'
                ソフトウェアアンインストール（DELETE /devices/{deviceId}/package/{package}）:
                  summary: >-
                    アンインストール操作の完了例。transactionResultEvent の result フィールドから
                    transactionResult が導出される。transactionResultEvent に package
                    フィールドが含まれる
                  value:
                    transactionId: 9
                    transactionStatus: processed
                    transactionResult: success
                    transactionResultEvent:
                      result: success
                      message: any message
                      package: ai.fd.example
                      timestamp: '2024-06-01T17:00:03.000000'
                    operationId: delete-v1-applications-devices-package
                    deviceId: '123456789023421'
                    requestBody: null
                    createdAt: '2024-06-01T17:00:00.000000'
                    updatedAt: '2024-06-01T17:00:03.000000'
                処理中（デバイス応答待ち）:
                  summary: >-
                    トランザクションがデバイスに送信済みで応答待ちの例。transactionResult・transactionResultEvent
                    は null
                  value:
                    transactionId: 5
                    transactionStatus: accepted
                    transactionResult: null
                    transactionResultEvent: null
                    operationId: put-v1-applications-devices-commands
                    deviceId: '123456789023421'
                    requestBody:
                      extras:
                        action: start
                    createdAt: '2024-06-01T13:00:00.000000'
                    updatedAt: '2024-06-01T13:00:01.000000'
                キャンセル済み:
                  summary: >-
                    トランザクションがキャンセルされた例。transactionResult は
                    failure、transactionResultEvent は null
                  value:
                    transactionId: 6
                    transactionStatus: canceled
                    transactionResult: failure
                    transactionResultEvent: null
                    operationId: put-v1-applications-devices-commands
                    deviceId: '123456789023421'
                    requestBody:
                      extras:
                        action: start
                    createdAt: '2024-06-01T14:00:00.000000'
                    updatedAt: '2024-06-01T14:00:10.000000'
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - トランザクション指定誤り
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/channels:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    post:
      summary: WebRTCエンドポイント取得
      operationId: post-v1-applications-channels
      security:
        - cwsAuth:
            - cws:communication-service
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/communication-service
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebRTCEndpoint'
              examples:
                example:
                  value:
                    endpointUrl: wss://sora01.sample.co.jp/signaling
                    channelId: sgQj8vstE6_202012251632000
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アプリケーション未登録
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
        '503':
          description: Service Unavailable - 全エンドポイントの接続数が上限に達している場合
      description: >-
        WebRTC接続用のエンドポイントとチャネルIDを取得します。

        バージョンを指定しなかった場合、[利用可能なSoraのバージョンを取得](/apis/v1/cws_api#tag/CommunicationService/operation/get-v1-applications-sora-versions)で
        isDefault = True となっているバージョンのSoraを利用するものとしてエンドポイント・チャネルIDが返却されます。
      tags:
        - CommunicationService
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebRTCRequest'
  /v1/applications/{applicationId}/sora/versions:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: 利用可能なSoraのバージョンを取得
      operationId: get-v1-applications-sora-versions
      security:
        - cwsAuth:
            - cws:communication-service
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/communication-service
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAvailableSoraVersions'
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アプリケーション未登録
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: |-
        現在稼働中のWebRTCサーバーのSoraバージョン一覧を取得します。
        バージョンは降順でソートされます。

        稼働中のWebRTCサーバーにおいては、isDefault = True のものがデフォルトとして利用されます。
      tags:
        - CommunicationService
  /v1/applications/{applicationId}/devices/{deviceId}/reset:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: デバイスの初期化
      operationId: put-v1-applications-devices-reset
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created
          headers:
            Location:
              schema:
                type: string
                format: uri
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        指定したデバイスを初期化します。


        **このAPIを実行するとデバイスのデータが全て消え、出荷時の状態となります。**


        初期化されたデバイスは
        [ソフトウェアをすぐにアップデートさせる](#tag/Update/operation/put-v1-applications-devices-apps)
        でインストールされたアプリも削除されているため、再度APIを呼び出してインストールしてください。
      tags:
        - Operation
      parameters: []
  /v1/applications/{applicationId}/devices/{deviceId}/settings/lang:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: 言語設定をする
      operationId: put-v1-applications-devices-settings-lang
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        指定したデバイスの言語設定情報を変更します。

        ### 概要

        本APIはデバイスのOS言語設定を変更することが可能です。


        本APIでは `Request Body` に指定された言語コードが `schemas`
        の指定に基づいているかどうかのバリデーションのみを行っているため、リクエストされた言語コードが実際にデバイスに設定されるかどうかは[トランザクション結果通知](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-transaction)の通知内容を確認するようにしてください。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LangList'
            examples:
              example:
                value:
                  - ja
                  - en
        required: true
        description: |-
          #### 言語設定
          - 言語は配列で複数指定可能です。また複数指定の場合、先頭に指定された言語が端末に設定されます。
          - 言語コード ISO 639-1(2byteコード) 相当が指定可能です。IFについては以下を参考にしてください。
            - ISO 639-1(2byteコード)
              - https://ja.wikipedia.org/wiki/ISO_639-1%E3%82%B3%E3%83%BC%E3%83%89%E4%B8%80%E8%A6%A7
            - 準拠するIF
              - https://docs.oracle.com/javase/jp/7/api/java/util/Locale.html#Locale(java.lang.String)
      tags:
        - Operation
  /v1/applications/{applicationId}/devices/{deviceId}/apps/launcher/keys:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: LauncherAppへのKey設定
      tags:
        - Operation
      operationId: put-v1-applications-devices-apps-launcher-keys
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      description: >-
        ### 概要

        THINKLETの物理キー（left、center、right）の動作設定を変更します。各キーに対して、短押し、長押し、ダブルクリックなどのイベントごとに、アプリの起動などのアクションを指定することができます。


        本APIは、THINKLETに備わっている3つの物理キー（left, center,
        right）の動作設定をリモートから変更するためのものです。


        各キーへの「短押し、長押し、ダブルクリック」といった操作に対して、アプリ起動などのアクションを自由に割り当てることができます。


        設定には、[THINKLET開発者ポータルのキーコンフィグ](https://fairydevicesrd.github.io/thinklet.app.developer/docs/keyConfig/)で解説されている、key_config.json
        と同様の記述ルールを使用します。通常、デバイス側で設定を行う際はファイルを直接配置しますが、本APIを利用することで、ネットワーク経由で同等の設定をデバイスへ送信・適用することが可能です。


        Launcher規定のkey_configとフォーマットが異なる場合は本APIでエラーを返却します。


        Launcherへの適用が完了した際に、[トランザクション結果通知](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-transaction)として通知します。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KeyConfigs'
            examples:
              example:
                value:
                  key-config:
                    - key-name: left
                      key-event: single-released
                      key-action:
                        action-type: launch-app
                        action-param:
                          package-name: ai.fd.xxx
                          class-name: ai.fd.xxx.MainActivity
                          action-name: ai.fd.xxx.action
                          extras:
                            - key-name: aStringParam
                              key-type: String
                              key-value: a String param value
                            - key-name: aIntParam
                              key-type: int
                              key-value: 123456
                          flags:
                            - FLAG_ACTIVITY_NEW_TASK
                            - FLAG_ACTIVITY_CLEAR_TASK
                    - key-name: center
                      key-event: single-released
                      key-action:
                        action-type: launch-app
                        action-param:
                          package-name: ai.fd.xxx
                          class-name: ai.fd.xxx.MainActivity
                          action-name: ai.fd.xxx.action
                    - key-name: right
                      key-event: single-released
                      key-action:
                        action-type: none
        required: true
        description: '- Key設定の検査内容はLauncher規定の形式・必須Keyが存在するチェックまでとします。'
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              example:
                message: Invalid request body
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/devices/{deviceId}/commands:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: Authorization
        in: header
    put:
      summary: デバイスでコマンドを実行させる
      tags:
        - Operation
      operationId: put-v1-applications-devices-commands
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      description: >-
        ### 概要

        THINKLETデバイス(以下、デバイス）にインストールされたご利用者様のアプリに対して、PackageやActivityを指定し、任意のコマンドを送る
        API です。

        本APIを利用することで、CWS API経由でのアプリ起動などが実現可能です。


        本APIは、例えばadbコマンド経由でForegroundServiceを起動する下記コマンドをRemote経由で、実行するイメージとなります。

        ```

        adb shell am start-foreground-service -n
        com.example.myapp/.services.MyService

        ```


        デバイスにご利用者様アプリをインストールする方法は、下記 API を参照ください。

        -
        [ソフトウェアをアップロードするためのURLを作成する](#tag/Update/operation/post-v1-applications-software-upload-url)

        -
        [ソフトウェアをすぐにアップデートさせる](#tag/Update/operation/put-v1-applications-devices-apps)


        ### コマンド実行結果の通知について

        本APIのリクエスト body
        で指定した内容をデバイスで実行し、Webhook（[トランザクション結果通知(コマンド実行)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-command)）
        で実行結果を通知します。


        通知タイミングは下記となり、通知時のトランザクションステータスは `processed` となります。


        - ご利用者様アプリの呼び出し後

        - ご利用者様アプリからの応答受信後


        デバイス向けIF仕様に沿ってご利用者様アプリで対応を行うことで、通知に任意のメッセージを追加することも可能です。


        デバイス向けIF仕様については、ご利用者様に個別に提供しております。</br>

        ご希望の方は当社にお問い合わせください。


        ### 特記事項

        - 本APIでは、下記のような Activity や Service を指定しない Android独自のコマンド各種はサポートしていません。
          - 例えば以下のようなコマンドはサポート外となりますのでご注意ください。
            ```
            adb shell am start -a android.intent.action.CALL tel:00000000
            ```
          - 仮に上記を実現したい場合は、ご利用者様アプリで上記コマンド内容を実行できるよう開発を行い、本APIを経由して、ご利用者様アプリにコマンドを送信することで実現可能です。


        - 本APIでは、最低限のパラメータチェックのみを実行します.
          - action、package、classpathのいずれも指定されない場合は、連携時にエラー通知を送信します。

        ### requiredパラメータの変更


        - 本APIで、下記パラメータが`required`指定を解除しております。
          - action
          - package
          - classpath
        - 上記`required`指定解除に伴い、`mdmclient`の`versionName`によって動作が異なります。


        #### mdmclient versionName : 2.1.1以上（Fw 9系以上）の場合

        - action、package、classpathのいずれも指定されていない場合は、アプリ連携時に[CWS API
        Notifications](/apis/v1/cws_notification)記載の[トランザクション結果通知(コマンド実行)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-command)を利用して、エラー通知を送信します。


        #### mdmclient versionName : 2.1.1未満（Fw 8系以下）の場合

        - action、package、classpathの全てが指定されている場合は、正常動作し、アプリ連携時に[CWS API
        Notifications](/apis/v1/cws_notification)記載の[トランザクション結果通知(コマンド実行)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-command)を利用して、実行結果を送信します。

        -
        action、package、classpathの1つでも指定されていない場合は、`mdmclient`が本変更に対応しておらず、正常に処理できません。
          - 正常に処理できなかった場合、CWS APIの発行したトランザクションが、ステータス`published`のまま、未完了状態となり、端末の再起動時などに再度処理を実行してしまいます。
          - この場合、下記CWS APIを利用して、トランザクションキャンセル処理を実行してください。
            - [トランザクションをキャンセルする](#tag/Transaction/operation/delete-v1-applications-devices-transactions)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Commands'
            examples:
              example:
                value:
                  package: packagename
                  classpath: packagename.MainActivity
                  action: packagename.action
                  launchType: activity
                  extras:
                    exString: example string
                    exIntger: 12345678901
                    exLong: 9223372036854776000
                    exDouble: 1.234
                    exObject:
                      exDouble: 1234
                      exArray:
                        - string
                        - 123
                        - null
                        - true
                    exBoolean: true
        required: true
        description: >-
          - extras を利用することでご利用者様アプリに対して任意の情報を通知することが可能です。
            - ご利用者様アプリの仕様範疇となるため、内容の正当性をチェックしません。
            - ご利用者様アプリへ送信するIntentに設定する`extra`のKeyは、本APIで指定するJsonのKeyと対応します。
              - 例えば本APIで、 `{"e1":"test"}` として指定する場合、デバイスでは、`Intent.getString("e1")` としてアクセスします。
          - extras で対応する型は以下のとおりです。
            - String
            - Boolean
            - Intger (32ビット符号付き整数データ型)
            - Long (64ビット符号付き整数データ型)
            - Double (64ビット倍精度浮動小数点数データ型)
            - Array
            - Object（Json）
          - extras に指定するJsonの `String` または `Boolean`
          型については、Json記載通りに解釈し、ご利用者様アプリへ通知します。
              - 文字列としてJsonや、Arrayを指定する場合、取得した`String`を`JSONObject`、`JSONArray`を利用してアクセスしてください。
          - extras に指定するJsonの数値型については、取り扱いにご注意下さい。
            - `Integer` または `Long` 型については、`Integer` 型として収まる範囲であれば、`Integer`型 として取り扱い、収まらない場合は `Long`型 として取り扱います。
            - それ以外の小数点を持つ数値型は、`Double` 型として取り扱います。
            - なお、**上記のルールは第一階層にのみ適応され、第二階層以降では、数値型は`Double` 型** として取り扱います。
          - extras に指定するJsonの `Array` 及び
          `Object`型については、`Intent.putSerializable(Key, Value)`を行い、ご利用者様アプリへ通知します。
            - 例えば `{"exArray": ["string", 123, null, true]}`として指定する場合
              デバイスでは、下記のようにアクセスします。
              ```
              val exArray: List<Any> = intent.getSerializableExtra("exArray") as List<Any>
              ```
            - 例えば `{"exObject": {"key1":"data1","key2":"data2"}}`として指定する場合
              デバイスでは、下記のようにアクセスします。
              ```
              val exObject: Map<String, Any> = intent.getSerializableExtra("exObject") as Map<String, Any>
              ```
      responses:
        '201':
          description: Created - 正常時
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              example:
                message: Invalid request body
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション未登録、URL誤りなど
        '404':
          description: Not Found - 該当リソースなし
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/devices/{deviceId}/package/{package}:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        required: true
        description: THINKLETのIMEI
      - schema:
          type: string
        name: package
        in: path
        required: true
        description: パッケージ名
      - schema:
          type: string
        name: Authorization
        in: header
    delete:
      summary: ソフトウェアをアンインストールする
      operationId: delete-v1-applications-devices-package
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: Created
          headers:
            Location:
              schema:
                type: string
                format: uri
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseTransaction'
                    examples:
                      example:
                        value:
                          transactionId: 1
                  - type: object
                    required:
                      - transactionId
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        指定したソフトウェアをデバイスからアンインストールします。


        パッケージ名は下記のAPIから確認してください。

        -
        [デバイス状態取得](/apis/v1/cws_api#tag/Device/operation/get-v1-applications-devices-status)

        -
        [デバイス状態の一覧を取得](/apis/v1/cws_api#tag/Device/operation/get-v1-applications-devices-status-list)


        本APIは、下記バージョン以降に対応しています。

        - mdmclient 3.4.0以上, deviceowner 1.4.0以上 (Fw 13.000.0以上)
      tags:
        - Operation
      parameters: []
  /v1/applications/{applicationId}/billing:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: number
          minimum: 1
          maximum: 12
        name: month
        in: query
        required: true
        description: 利用実績を取得したい月
      - schema:
          type: number
          minimum: 2022
        name: year
        in: query
        required: true
        description: 利用実績を取得したい年
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: プラン情報と映像通信の利用実績を取得する
      tags:
        - Billing
      operationId: get-v1-applications-billing
      security:
        - cwsAuth:
            - cws:application:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/applications.r
      description: >-
        ### 概要

        アプリケーションIDに紐づくプラン情報・デバイスの映像通信の利用実績を取得します。


        利用実績は、固定プラン・従量プラン問わず、映像通信の利用実績のあるデバイスを対象に集計した結果となります。


        利用時間の総計を計算した後に、1時間未満の端数を切り上げて返します。(e.g. 利用時間の総計が14時間1ミリ秒の場合、15時間になります)


        指定した年月の月初から月末までのプラン情報及び、利用実績を返却します。

        - 未来の年月を指定した場合、適用予定のプラン情報が取得できます。

        （固定プランの申込みのないデバイスのプラン情報は取得できません。）

        - 過去の年月を指定した場合、その年月に適用されていたプランと利用実績が取得できます。

        - 現在の年月を指定した場合、最新のプラン情報・利用実績・アクティベート数が取得できます。

        - アクティベート数には transactionStatus が
        processed(トランザクション処理済み)に至っていないデバイスも含みます。


        固定プランの申込みのないデバイスで、指定した年月に利用実績がない場合は、プラン情報と利用実績の取得はできません。
      responses:
        '200':
          description: OK - 正常時
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllPlans'
              examples:
                当月を指定した場合:
                  value:
                    numberOfDevices: 3
                    activateDevices: 2
                    devices:
                      - deviceId: '123456789023421'
                        plans:
                          videoMeeting: lite
                          speechRecognition: ja
                        amountVideoMeeting: 11
                        amountSpeechRecognition: 5
                      - deviceId: '123456789023423'
                        plans:
                          videoMeeting: basic200
                          speechRecognition: null
                        amountVideoMeeting: 159
                        amountSpeechRecognition: 0
                      - deviceId: '123456789023425'
                        plans:
                          videoMeeting: null
                          speechRecognition: null
                        amountVideoMeeting: 3
                        amountSpeechRecognition: 0
                    others:
                      amountVideoMeeting: 12
                      amountSpeechRecognition: 0
                当月以外を指定した場合:
                  value:
                    numberOfDevices: 3
                    devices:
                      - deviceId: '123456789023421'
                        plans:
                          videoMeeting: lite
                          speechRecognition: ja
                        amountVideoMeeting: 11
                        amountSpeechRecognition: 5
                      - deviceId: '123456789023423'
                        plans:
                          videoMeeting: basic200
                          speechRecognition: null
                        amountVideoMeeting: 159
                        amountSpeechRecognition: 0
                      - deviceId: '123456789023425'
                        plans:
                          videoMeeting: null
                          speechRecognition: null
                        amountVideoMeeting: 3
                        amountSpeechRecognition: 0
                    others:
                      amountVideoMeeting: 12
                      amountSpeechRecognition: 0
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - access token無し、認証エラー
        '403':
          description: Forbidden - アプリケーション未登録、URL誤りなど
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
  /v1/applications/{applicationId}/devices/{deviceId}/connectivity/{type}:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        description: THINKLETのIMEI
        required: true
      - schema:
          type: string
          enum:
            - bluetooth
            - wifi
            - mobile
        name: type
        in: path
        required: true
        description: Bluetooth/ネットワークの種別
      - schema:
          type: string
          enum:
            - all
            - connected
            - available
        name: target
        in: query
        description: Bluetoothデバイス/ネットワークの取得対象
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: Bluetoothデバイス/ネットワークの一覧を取得する
      operationId: get-v1-applications-connectivity-list
      security:
        - cwsAuth:
            - cws:device:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.r
      responses:
        '201':
          description: OK
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        Bluetoothデバイス/ネットワーク一覧を取得します。  

        - 当面は Bluetooth のみの対応となるため type に wifi, mobile が指定された場合、400エラーを返却します。

        -
        当APIの利用にあたっての留意事項は、[Connectivityの各APIの利用について](/apis/v1/cws_api/#section/ConnectivityAPI)を参照してください。


        ### 取得結果について


        本APIの取得結果は、[トランザクション結果通知(Bluetoothデバイス/ネットワークの一覧を取得)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-connectivity-list)
        で通知します。


        本APIで取得できる一覧は以下で、`target` によって取得対象を指定します。

        `target` の指定がない場合、取得対象は `available` になります。

        - all: 本APIの要求を受け付けた時点で、THINKLETに登録済み(接続中含む) および
        検出可能なBluetoothデバイス/ネットワーク

        - connected: 本APIの要求を受け付けた時点で、THINKLETに接続中のBluetoothデバイス/ネットワーク

        - available: 本APIの要求を受け付けた時点で、THINKLETに登録済み(接続中含む)のBluetoothデバイス/ネットワーク
      tags:
        - Connectivity
  /v1/applications/{applicationId}/devices/{deviceId}/connectivity/{type}/state:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        description: THINKLETのIMEI
        required: true
      - schema:
          type: string
          enum:
            - bluetooth
            - wifi
            - mobile
        name: type
        in: path
        required: true
        description: Bluetooth/ネットワークの種別
      - schema:
          type: string
        name: Authorization
        in: header
    get:
      summary: Bluetooth/ネットワークのON/OFF状態を取得する
      operationId: get-v1-applications-connectivity-state
      security:
        - cwsAuth:
            - cws:device:read
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.r
      responses:
        '201':
          description: OK
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        Bluetooth/ネットワークのON/OFF状態を取得します。

        - 当面は Bluetooth のみの対応となるため type に wifi, mobile が指定された場合、400エラーを返却します。

        -
        当APIの利用にあたっての留意事項は、[Connectivityの各APIの利用について](/apis/v1/cws_api/#section/ConnectivityAPI)を参照してください。


        ### 取得結果について


        本APIの取得結果は、[トランザクション結果通知(Bluetooth/ネットワークのON/OFF状態を取得、変更する)](/apis/v1/cws_notification/#tag/Device-Event(transaction)/operation/post-result-connectivity-onoff)
        で通知します。
      tags:
        - Connectivity
    put:
      summary: Bluetooth/ネットワークのON/OFF状態を変更する
      operationId: put-v1-applications-connectivity-state
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: OK
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        Bluetooth/ネットワークのON/OFF状態を変更します。

        - 当面は Bluetooth のみの対応となるため type に wifi, mobile が指定された場合、400エラーを返却します。

        -
        当APIの利用にあたっての留意事項は、[Connectivityの各APIの利用について](/apis/v1/cws_api/#section/ConnectivityAPI)を参照してください。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutConnectivityState'
            examples:
              example:
                value:
                  state: enabled
      parameters: []
      tags:
        - Connectivity
  /v1/applications/{applicationId}/devices/{deviceId}/connectivity/{type}/reset:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        description: THINKLETのIMEI
        required: true
      - schema:
          type: string
          enum:
            - bluetooth
            - wifi
            - mobile
        name: type
        in: path
        required: true
        description: Bluetooth/ネットワークの種別
      - schema:
          type: string
        name: Authorization
        in: header
    delete:
      summary: Bluetooth/ネットワークの設定を初期化する
      operationId: delete-v1-applications-connectivity-reset
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: OK
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        Bluetooth/ネットワークの設定を初期化します。

        - 当面は Bluetooth のみの対応となるため type に wifi, mobile が指定された場合、400エラーを返却します。

        -
        当APIの利用にあたっての留意事項は、[Connectivityの各APIの利用について](/apis/v1/cws_api/#section/ConnectivityAPI)を参照してください。
      parameters: []
      tags:
        - Connectivity
  /v1/applications/{applicationId}/devices/{deviceId}/connectivity/bluetooth:
    parameters:
      - schema:
          type: string
        name: applicationId
        in: path
        required: true
        description: アプリケーションID
      - schema:
          type: string
        name: deviceId
        in: path
        description: THINKLETのIMEI
        required: true
      - schema:
          type: string
        name: Authorization
        in: header
    post:
      summary: Bluetoothデバイスのペアリングを行う
      operationId: post-v1-applications-bluetooth-device
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: OK
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        Bluetoothデバイスをペアリングします。

        -
        当APIの利用にあたっての留意事項は、[Connectivityの各APIの利用について](/apis/v1/cws_api/#section/ConnectivityAPI)を参照してください。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BluetoothDeviceInfo'
      parameters: []
      tags:
        - Connectivity
    put:
      summary: ペアリング済みBluetoothデバイスを接続/切断する
      operationId: put-v1-applications-bluetooth-device
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: OK
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        Bluetoothペアリング済みのデバイスを接続/切断します。

        -
        当APIの利用にあたっての留意事項は、[Connectivityの各APIの利用について](/apis/v1/cws_api/#section/ConnectivityAPI)を参照してください。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BluetoothDeviceStateInfo'
            examples:
              example:
                value:
                  macAddress: 9a:8b:7c:6d:5e:4f
                  state: connect
      parameters: []
      tags:
        - Connectivity
    delete:
      summary: Bluetoothデバイスのペアリングを解除する
      operationId: delete-v1-applications-bluetooth-device
      security:
        - cwsAuth:
            - cws:device:write
        - mimiAuth:
            - https://apis.mimi.fd.ai/auth/thinklet/devices.w
      responses:
        '201':
          description: OK
          headers:
            Location:
              schema:
                type: string
              description: トランザクションURL
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTransaction'
              examples:
                example:
                  value:
                    transactionId: 1
        '400':
          description: Bad Request - 入力値誤りなど
        '401':
          description: Unauthorized - 認証エラーなど
        '403':
          description: Forbidden - アクティベートされていない端末を操作した場合、URL誤りなど
        '404':
          description: Not Found - システム連携通知先未設定など
        '500':
          description: Internal Server Error - 内部エラー（DB接続時エラー、デベロッパー未登録など）
      description: >-
        ### 概要

        Bluetoothデバイスのペアリングを解除します。

        -
        当APIの利用にあたっての留意事項は、[Connectivityの各APIの利用について](/apis/v1/cws_api/#section/ConnectivityAPI)を参照してください。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BluetoothDeviceInfo'
      parameters: []
      tags:
        - Connectivity
components:
  securitySchemes:
    cwsAuth:
      type: http
      scheme: bearer
      description: |
        [CWS認証のアクセストークン](/docs/introduction/authentication#cws認証でのアクセストークンの発行)
    mimiAuth:
      type: http
      scheme: bearer
      description: |
        [mimi認証のアクセストークン](/docs/introduction/authentication#mimi認証でのアクセストークン発行)
  schemas:
    SystemSettingGet:
      title: SystemSettingGet
      type: object
      description: システム連携設定データ取得用のモデル
      example:
        authenticationKey: xxxxxxxxxxxx
        deviceEvent: https://xxxxx
        soraEvent: https://xxxxx
        soraFileSendEvent: https://xxxxx
        soraRecGetMultiPresignedUrl: https://xxxxx
        fileUploadEvent: https://xxxxx
        fileUploadGetUrl: https://xxxxx
      properties:
        authenticationKey:
          type: string
          description: 認証キー
        deviceEvent:
          type: string
          description: デバイスイベント通知先URL
        remoteSupportEvent:
          type: string
          description: 遠隔支援イベント通知先URL
          deprecated: true
        soraEvent:
          type: string
          description: Soraイベント通知先URL
        soraFileSendEvent:
          type: string
          description: Sora録画データ通知先URL
        soraRecGetMultiPresignedUrl:
          type: string
          description: 録画データ（Sora）用署名付きURL取得URL（マルチパート対応）
        fileUploadEvent:
          type: string
          description: ファイルアップロードイベント通知先URL
        fileUploadGetUrl:
          type: string
          description: ファイルアップロード先URL取得URL
    SystemSetting:
      title: SystemSetting
      additionalProperties: false
      type: object
      description: システム連携設定用のモデル
      example:
        deviceEvent: https://xxxxx
        soraEvent: https://xxxxx
        soraFileSendEvent: https://xxxxx
        soraRecGetMultiPresignedUrl: https://xxxxx
        fileUploadEvent: https://xxxxx
        fileUploadGetUrl: https://xxxxx
      properties:
        deviceEvent:
          maxLength: 255
          pattern: https?://.*
          type: string
          description: デバイスイベント通知先URL
        remoteSupportEvent:
          maxLength: 255
          pattern: https?://.*
          type: string
          description: 遠隔支援イベント通知先URL
          deprecated: true
        soraEvent:
          maxLength: 255
          pattern: https?://.*
          type: string
          description: Soraイベント通知先URL
        soraFileSendEvent:
          maxLength: 255
          pattern: https?://.*
          type: string
          description: Sora録画データ通知先URL
        soraRecGetMultiPresignedUrl:
          maxLength: 255
          pattern: https?://.*
          type: string
          description: 録画データ（Sora）用署名付きURL取得URL（マルチパート対応）
        fileUploadEvent:
          maxLength: 255
          pattern: https?://.*
          type: string
          description: ファイルアップロードイベント通知先URL
        fileUploadGetUrl:
          maxLength: 255
          pattern: https?://.*
          type: string
          description: ファイルアップロード先URL取得URL
    AuthenticationKeyResponse:
      title: AuthenticationKeyResponse
      type: object
      description: 認証キーのレスポンスモデル
      properties:
        authenticationKey:
          type: string
          description: 認証キー
      required:
        - authenticationKey
    DeviceActivateStatus:
      title: DeviceActivateStatus
      type: object
      properties:
        status:
          type: string
          description: デバイスのアクティベート状態
        clientId:
          type: string
          description: デバイスのmimiクライアントID
      required:
        - status
    Activate:
      title: Activate
      type: object
      properties:
        mimiClientId:
          type: string
        mimiClientSecret:
          type: string
      description: アクティベート設定用のモデル
    ResponseTransaction:
      title: Transaction
      type: object
      properties:
        transactionId:
          type: integer
          example: 1
      description: トランザクションIDを返却するレスポンスのモデル
      required:
        - transactionId
    ErrorMessage:
      title: ErrorMessage
      type: object
      properties:
        message:
          type: string
          description: エラー内容の文字列
    Firmware:
      title: Firmware
      type: object
      properties:
        version:
          type: string
          description: ファームウェアのバージョン
          example: 11.002.0
      required:
        - version
      description: ファームウェアのモデル
    DeviceApp:
      title: DeviceApp
      type: object
      description: アプリケーションのモデル
      properties:
        package:
          type: string
          description: ソフトウェア（パッケージ）名
          example: ai.fd.thinklet.app.mdmclient
        version:
          type: string
          description: バージョン
          example: 2.4.2
        displayName:
          type: string
          description: >-
            ソフトウェアの表示名。一意識別子である`package`とは別に、ユーザー向けの表示・管理用途で使用する名称です。


            以下の場合は、当項目は省略される。

            - 表示名が登録されていない場合

            -
            [登録したソフトウェア（パッケージ）の情報を削除する](#tag/Update/operation/delete-v1-applications-packages)でパッケージが削除されていた場合
          example: サンプルアプリケーション
        versionDescription:
          type: string
          description: >-
            バージョンの説明


            以下の場合は、当項目は省略される。

            - バージョンの説明が登録されていない場合

            -
            [登録したソフトウェア（パッケージ）の情報を削除する](#tag/Update/operation/delete-v1-applications-packages)でパッケージが削除されていた場合

            -
            [指定したソフトウェア（パッケージ）のバージョンを削除する](#tag/Update/operation/delete-v1-applications-package-version)でバージョンが削除されていた場合
          example: 初期リリース版
      required:
        - package
        - version
    LangList:
      title: LangList
      type: array
      items:
        type: string
        maxLength: 8
        pattern: ^[a-zA-Z0-9!-/:-@\[-`{-~]+
      description: 言語設定内容
      example:
        - ja
        - en
    DeviceStatus:
      title: DeviceStatus
      type: object
      description: デバイス状態取得用のモデル
      properties:
        power:
          type: string
          enum:
            - started
            - finished
          description: デバイスの電源状態
          example: started
        powerUpdateDate:
          type: string
          description: 電源状態の更新日時
          example: '2024-10-24T14:15:22.123456'
        wearing:
          type: string
          enum:
            - device_wear
            - device_takeoff
          description: デバイスの装着状態
          example: device_wear
        wearingUpdateDate:
          type: string
          description: 装着状態の更新日時
          example: '2024-10-24T14:15:22.123456'
        network:
          type: string
          enum:
            - connectivity_online
            - connectivity_offline
          description: デバイスのネットワーク状態
          example: connectivity_online
        networkUpdateDate:
          type: string
          description: ネットワーク状態の更新日時
          example: '2024-10-24T14:15:22.123456'
        charging:
          type: string
          enum:
            - start_charging
            - stop_charging
          description: デバイスの充電状態
          example: stop_charging
        chargingUpdateDate:
          type: string
          description: 充電状態の更新日時
          example: '2024-10-24T14:15:22.123456'
        batteryPercentage:
          type: integer
          description: バッテリー状態
          example: 89
        batteryUpdateDate:
          type: string
          description: バッテリー状態の更新日時
          example: '2024-10-24T14:15:22.123456'
        latitude:
          type: number
          description: デバイスの位置情報（緯度）
          example: 35.6809591
        longitude:
          type: number
          description: デバイスの位置情報（経度）
          example: 139.7673068
        locationUpdateDate:
          type: string
          description: 位置情報の更新日時
          example: '2024-10-24T14:15:22.123456'
        firmware:
          $ref: '#/components/schemas/Firmware'
        app:
          type: array
          description: >-
            [ソフトウェアをすぐにアップデートさせる](#tag/Update/operation/put-v1-applications-devices-apps)でインストール・アップデートしたものも含まれます
          items:
            $ref: '#/components/schemas/DeviceApp'
        lang:
          $ref: '#/components/schemas/LangList'
    DeviceStatusInfo:
      title: DeviceStatusInfo
      type: object
      description: デバイスの状態
      properties:
        deviceId:
          type: string
          description: デバイスのIMEI_NO
          example: 938415078454759
        activated:
          type: boolean
          description: デバイスのアクティベート状態
        clientId:
          type: string
          nullable: true
          description: |-
            デバイスのクライアントID

            アクティベートされていない場合は`null`となる。
          example: 123e8f0fd2c044ef9074ef0b84d1cf88
        status:
          type: object
          nullable: true
          description: |-
            デバイスの状態

            デバイスの状態が取得できない場合は`null`となる。
          allOf:
            - $ref: '#/components/schemas/DeviceStatus'
      required:
        - deviceId
        - activated
        - clientId
        - status
    DeviceStatusList:
      title: DeviceStatusList
      type: array
      description: デバイス状態のリスト
      items:
        $ref: '#/components/schemas/DeviceStatusInfo'
    HardwarePropertiesModelInfo:
      title: HardwarePropertiesModelInfo
      type: object
      description: ハードウェアプロパティのモデル情報
      properties:
        name:
          type: string
          description: 型番・モデルの識別子
        identifier:
          type: string
          description: モデルの識別子
        description:
          type: string
          description: モデルの説明
        shape:
          type: string
          enum:
            - box
            - neck-mounted
          description: デバイスの形状
      required:
        - name
        - identifier
        - description
        - shape
    HardwarePropertiesResolutionInfo:
      title: HardwarePropertiesResolutionInfo
      type: object
      description: ハードウェアプロパティのカメラの解像度情報
      properties:
        maxWidth:
          type: integer
          description: 最大幅
        maxHeight:
          type: integer
          description: 最大高
      required:
        - maxWidth
        - maxHeight
    HardwarePropertiesCameraInfo:
      title: HardwarePropertiesCameraInfo
      type: object
      description: ハードウェアプロパティのカメラ情報
      properties:
        direction:
          type: string
          enum:
            - landscape
            - portrait
          description: カメラの向き
        mountedPosition:
          type: string
          description: カメラの搭載位置
        resolution:
          type: object
          description: カメラの解像度
          allOf:
            - $ref: '#/components/schemas/HardwarePropertiesResolutionInfo'
      required:
        - direction
        - mountedPosition
        - resolution
    HardwarePropertiesInfo:
      title: HardwarePropertiesInfo
      type: object
      description: ハードウェアプロパティ情報
      properties:
        deviceId:
          type: string
          description: THINKLETのIMEI_NO
        model:
          type: object
          nullable: true
          description: ハードウェアプロパティのモデル情報。ハードウェアプロパティが未登録の場合、nullとなる。
          allOf:
            - $ref: '#/components/schemas/HardwarePropertiesModelInfo'
        camera:
          type: array
          nullable: true
          description: ハードウェアプロパティのカメラ情報。ハードウェアプロパティが未登録の場合、nullとなる。
          items:
            $ref: '#/components/schemas/HardwarePropertiesCameraInfo'
        macAddressWifi:
          type: string
          description: >-
            デバイスのWifiのMACアドレス。ハードウェアプロパティが未登録、またはmacAddressWifiが未登録の場合、当項目は省略される。
        macAddressBluetooth:
          type: string
          description: >-
            デバイスのBluetoothのMACアドレス。ハードウェアプロパティが未登録、またはmacAddressBluetoothが未登録の場合、当項目は省略される。
        specificDestination:
          type: string
          description: >-
            特定仕向の場合のテキスト表現。ハードウェアプロパティが未登録、またはspecificDestinationが未登録の場合、当項目は省略される。
      required:
        - deviceId
        - model
        - camera
    Apn:
      title: Apn
      type: object
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
        apn:
          type: string
          maxLength: 100
          minLength: 1
        proxy:
          type: string
          maxLength: 100
        port:
          type: string
          maxLength: 100
        user:
          type: string
          maxLength: 100
        server:
          type: string
          maxLength: 100
        password:
          type: string
        mmsc:
          type: string
          maxLength: 100
        mcc:
          type: string
          maxLength: 100
          minLength: 1
        mnc:
          type: string
          maxLength: 100
          minLength: 1
        mmsproxy:
          type: string
          maxLength: 100
        mmsport:
          type: string
          maxLength: 100
        authType:
          type: integer
        type:
          type: string
          maxLength: 100
        protocol:
          type: string
          maxLength: 100
        carrierEnabled:
          type: string
          maxLength: 100
        bearer:
          type: integer
        bearerBitmask:
          type: integer
        roamingProtocol:
          type: string
          maxLength: 100
        mvnoType:
          type: string
          maxLength: 100
        mvnoMatchData:
          type: string
          maxLength: 100
      required:
        - name
        - apn
        - mcc
        - mnc
      description: APN設定のモデル
    ApnList:
      title: ApnList
      type: array
      items:
        $ref: '#/components/schemas/Apn'
      description: APN設定の配列
    Wifi:
      title: Wifi
      type: object
      description: Wi-fi設定のモデル
      properties:
        ssid:
          type: string
          maxLength: 32
          pattern: ^[a-zA-Z0-9!-/:-@\[-`{-~]+
        password:
          type: string
        security:
          type: string
          description: 暗号化方式
          pattern: ^[a-zA-Z0-9!-/:-@¥[-`{-~]*$
          maxLength: 100
      required:
        - ssid
    WifiList:
      title: WifiList
      type: array
      items:
        $ref: '#/components/schemas/Wifi'
      description: Wi-fi設定の配列
    PackageType:
      title: PackageType
      type: object
      properties:
        package:
          type: string
          minLength: 1
          description: ソフトウェアのパッケージ名
          example: sample.package
        displayName:
          type: string
          description: >-
            ソフトウェアの表示名。一意識別子である`package`とは別に、ユーザー向けの表示・管理用途で使用する名称です。未登録の場合、このフィールドは含まれません。
          example: サンプルアプリケーション
        registerDate:
          type: string
          description: 作成日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
        updateDate:
          type: string
          description: 更新日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
      required:
        - package
        - registerDate
        - updateDate
    PackageList:
      title: PackageList
      type: object
      properties:
        packageList:
          type: array
          minItems: 0
          description: ソフトウェアの`package`の一覧
          items:
            $ref: '#/components/schemas/PackageType'
      required:
        - packageList
    ValidateMessage:
      title: ValidateMessage
      type: object
      properties:
        loc:
          type: array
          description: エラーが発生したかを識別する文字列と整数
          example:
            - pathParameters
            - type
        msg:
          type: string
          description: エラーメッセージ
          example: 'value is not a valid enumeration member; permitted: ''bluetooth'''
        type:
          type: string
          description: 発生したエラーの種類
          example: type_error.enum
        ctx:
          type: object
          description: エラーメッセージをレンダリングするために必要な情報
          additionalProperties: true
          example:
            enum_values:
              - bluetooth
    ErrorMessageInfo:
      title: ErrorMessageInfo
      type: object
      properties:
        reason:
          type: string
          description: エラー理由の文字列
          example: invalid request
        details:
          type: array
          description: エラー内容
          items:
            $ref: '#/components/schemas/ValidateMessage'
      required:
        - reason
    PackageRegistrationRequest:
      title: PackageRegistrationRequest
      type: object
      properties:
        package:
          type: string
          minLength: 1
          pattern: ^(?!ai\.fd).*$
          description: ソフトウェアのパッケージ名。CWS API全体で一意である必要があり、ai.fdで始まるパッケージ名は使用できません。
          example: com.example.myapp
        displayName:
          type: string
          minLength: 1
          maxLength: 255
          description: ソフトウェアの表示名。一意識別子である`package`とは別に、ユーザー向けの表示・管理用途で使用する名称です。
          example: サンプルアプリケーション
      required:
        - package
      description: パッケージ登録リクエスト
    PackageRegistrationResponse:
      title: PackageRegistrationResponse
      type: object
      properties:
        package:
          type: string
          description: 登録されたソフトウェアのパッケージ名
        displayName:
          type: string
          description: >-
            ソフトウェアの表示名。一意識別子である`package`とは別に、ユーザー向けの表示・管理用途で使用する名称です。登録時に省略した場合、このフィールドは含まれません。
          example: サンプルアプリケーション
        registerDate:
          type: string
          description: ソフトウェアの`package`の登録日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
        updateDate:
          type: string
          description: ソフトウェアの`package`の更新日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
      required:
        - package
        - registerDate
        - updateDate
      description: パッケージ登録レスポンス
    PackageDisplayNameUpdateRequest:
      title: PackageDisplayNameUpdateRequest
      type: object
      properties:
        displayName:
          type: string
          nullable: true
          minLength: 1
          maxLength: 255
          description: >-
            ソフトウェアの表示名。一意識別子である`package`とは別に、ユーザー向けの表示・管理用途で使用する名称です。nullを指定した場合、表示名を削除します。
          example: 更新されたアプリケーション
      required:
        - displayName
      description: パッケージ表示名更新リクエスト
    PackageUpdateResponse:
      title: PackageUpdateResponse
      type: object
      properties:
        package:
          type: string
          description: ソフトウェアのパッケージ名
        displayName:
          type: string
          nullable: true
          description: >-
            ソフトウェアの表示名。一意識別子である`package`とは別に、ユーザー向けの表示・管理用途で使用する名称です。`null`を指定して削除した場合は`null`となります。
          example: サンプルアプリケーション
        registerDate:
          type: string
          description: ソフトウェアの`package`の登録日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
        updateDate:
          type: string
          description: ソフトウェアの`package`の更新日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
      required:
        - package
        - registerDate
        - updateDate
        - displayName
      description: パッケージ更新レスポンス
    VersionInfo:
      title: VersionInfo
      type: object
      properties:
        version:
          type: string
          minLength: 1
          description: ソフトウェアのバージョン
          example: 1.2.0
        description:
          type: string
          description: バージョンの説明。説明が登録されていない場合、このフィールドは含まれません。
          example: 初期リリース版
        registerDate:
          type: string
          description: 作成日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
        updateDate:
          type: string
          description: 更新日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
        binaryUploaded:
          type: boolean
          description: バイナリがアップロード済みの場合 `true`、未アップロードの場合 `false`。
          example: true
        distributable:
          type: boolean
          description: 配信の状態を示す。配信が開始されている場合 `true`、配信が停止されている場合 `false`。
          example: true
        distributionDate:
          type: string
          description: 配信開始日時。`distributable` が `true` の場合のみ存在する。
          format: date-time
          example: '2026-02-12T10:30:45.123456'
      required:
        - version
        - registerDate
        - updateDate
        - binaryUploaded
        - distributable
    VersionList:
      title: VersionList
      type: object
      properties:
        versionList:
          type: array
          minItems: 0
          description: バージョンの一覧
          items:
            $ref: '#/components/schemas/VersionInfo'
      required:
        - versionList
    VersionRegistrationRequest:
      title: VersionRegistrationRequest
      type: object
      properties:
        version:
          type: string
          minLength: 1
          description: ソフトウェアのバージョン。セマンティックバージョニングに基づく名称を使用することを推奨します（例:1.0.0）。
          example: 1.0.0
        description:
          type: string
          minLength: 1
          maxLength: 255
          description: バージョンの説明
          example: 初期リリース版
      required:
        - version
      description: バージョン登録リクエスト
    VersionRegistrationResponse:
      title: VersionRegistrationResponse
      type: object
      properties:
        package:
          type: string
          description: パッケージ名
        version:
          type: string
          description: 登録されたソフトウェアのバージョン
        description:
          type: string
          description: バージョンの説明。登録時に省略した場合、このフィールドは含まれません。
          example: 初期リリース版
        registerDate:
          type: string
          description: バージョンの登録日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
        updateDate:
          type: string
          description: バージョンの更新日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
      required:
        - package
        - version
        - registerDate
        - updateDate
      description: バージョン登録レスポンス
    VersionDescriptionUpdateRequest:
      title: VersionDescriptionUpdateRequest
      type: object
      properties:
        description:
          type: string
          nullable: true
          minLength: 1
          maxLength: 255
          description: バージョンの説明。nullを指定した場合、説明を削除します。
          example: バグ修正版
      required:
        - description
      description: バージョン説明更新リクエスト
    VersionUpdateResponse:
      title: VersionUpdateResponse
      type: object
      properties:
        package:
          type: string
          description: パッケージ名
        version:
          type: string
          description: ソフトウェアのバージョン
        description:
          type: string
          nullable: true
          description: バージョンの説明。`null`を指定して削除した場合は`null`となります。
          example: 初期リリース版
        registerDate:
          type: string
          description: バージョンの登録日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
        updateDate:
          type: string
          description: バージョンの更新日時
          format: date-time
          example: '2025-11-28T14:15:22.123456'
      required:
        - package
        - version
        - registerDate
        - updateDate
        - description
      description: バージョン更新レスポンス
    BinaryStatus:
      title: BinaryStatus
      type: object
      properties:
        exist:
          type: boolean
          description: バイナリの存在有無を示す。バイナリが存在している場合、`True`、バイナリが存在しない場合、`False`となる。
        size:
          type: integer
          minimum: 0
          description: ファイルサイズ[bytes]。バイナリがアップロードされている場合に存在する。
          example: 1234567
        uploadDate:
          type: string
          description: アップロード日時。バイナリがアップロードされている場合に存在する。
          format: date-time
          example: '2025-11-28T14:15:22.123456'
      required:
        - exist
    BinaryUploadUrlResult:
      title: BinaryUploadUrlResult
      type: object
      properties:
        urlList:
          type: array
          description: アップロード用のS3 presigned URLのリスト。現在は常に1つのURLが返却されます。
          items:
            type: object
            properties:
              uploadUrl:
                type: string
                description: S3 presigned URL
              startTimestamp:
                type: integer
                description: 署名URL期限開始(Unixtime)
              endTimestamp:
                type: integer
                description: 署名URL期限終了(Unixtime)
              expireIn:
                type: integer
                description: 署名URL期限(秒)
            required:
              - uploadUrl
              - startTimestamp
              - endTimestamp
              - expireIn
      required:
        - urlList
      description: バイナリアップロードURL作成結果
    PackageVersions:
      title: PackageVersions
      type: object
      properties:
        package:
          type: string
          description: パッケージ
          example: test.sound.package
        version:
          type: string
          description: ソフトウェアのバージョン
          example: 2.4.2
        displayName:
          type: string
          description: ソフトウェアの表示名。一意識別子である`package`とは別に、ユーザー向けの表示・管理用途で使用する名称です。
          example: サンプルアプリケーション
        versionDescription:
          type: string
          description: バージョンの説明
          example: 初期リリース版
      required:
        - package
        - version
    AvailableSotaPackages:
      title: AvailableSotaPackages
      type: object
      properties:
        systemPackages:
          type: array
          minItems: 0
          description: CWSがデフォルトで配信しているソフトウェア（パッケージ）とバージョンの一覧
          items:
            $ref: '#/components/schemas/PackageVersions'
          example:
            - package: ai.fd.test.package
              version: 1.0.0
              displayName: テスト用パッケージ
              versionDescription: 初期リリース版
        userPackages:
          type: array
          minItems: 0
          description: >-
            ユーザが登録した配信可能なソフトウェア（パッケージ）とバージョンの一覧

            ※CWS
            がデフォルト配信しているソフトウェア（パッケージ）であっても、システム側で有効化されていない場合はこちらに含まれることがあります。
          items:
            $ref: '#/components/schemas/PackageVersions'
        totalCount:
          type: integer
          minimum: 0
          description: ユーザが登録した配信可能なパッケージとバージョンの総数
          example: 100
        offset:
          type: integer
          minimum: 0
          description: userPackagesの開始位置。
          example: 0
        limit:
          type: integer
          minimum: 0
          description: userPackagesの1ページあたりの取得件数。
          example: 2
      required:
        - systemPackages
        - userPackages
        - totalCount
        - offset
        - limit
    SoftwareUploadRequest:
      title: SoftwareUploadRequest
      type: object
      properties:
        package:
          type: string
          description: Upload対象のapplication package
        version:
          type: string
          description: Upload対象のapplication の versionCode
        fileSize:
          type: integer
          minimum: 1
          description: Upload対象のapplication の fileSize(byte)。1以上の値を指定。
      description: 言語設定内容
    SoftwareUploadUrl:
      title: SoftwareUploadUrl
      type: object
      description: ソフトウェアをuploadするためのS3 presigned urlと期限情報
      properties:
        uploadUrl:
          type: string
          description: UploadUrl
        startTimestamp:
          type: integer
          description: 署名Url期限開始(Unixtime)
        endTimestamp:
          type: integer
          description: 署名Url期限終了(Unixtime)
        expireIn:
          type: integer
          description: 署名Url期限(秒)
      required:
        - uploadUrl
        - startTimestamp
        - endTimestamp
        - expireIn
    SoftwareUploadUrlResult:
      title: SoftwareUploadUrlResult
      type: object
      properties:
        appFileExists:
          type: boolean
          description: 指定のpackage/versionのアプリケーションが存在するか
        chunkPartSize:
          type: integer
          description: 分割サイズ（release 10時点では、リクエストのfileSizeと同じ値）
        uploadId:
          type: string
          nullable: true
          description: S3署名付きURLのuploadId（release 10時点ではnull値）
        urlList:
          type: array
          description: uploadする先のpresigned urlのリスト（release 10時点では1行のみ返却）
          items:
            $ref: '#/components/schemas/SoftwareUploadUrl'
      required:
        - appFileExists
        - chunkPartSize
        - uploadId
        - urlList
    DistributionStatus:
      title: DistributionStatus
      type: object
      properties:
        package:
          type: string
          description: パッケージ名
          example: com.example.myapp
        version:
          type: string
          description: ソフトウェアのバージョン
          example: 1.0.0
        distributable:
          type: boolean
          description: 配信の状態を示す。配信が開始されている場合、`true`、配信が停止されている場合、`false`となる。
          example: true
        distributionDate:
          type: string
          description: 配信開始日時。配信が開始されている場合に存在する。
          format: date-time
          example: '2026-02-12T10:30:45.123456'
        exist:
          type: boolean
          description: >-
            配信の状態を示す。配信が開始されている場合、`true`、配信が停止されている場合、`false`となる。非推奨です。代わりに`distributable`を使用してください。
          deprecated: true
          example: true
      required:
        - package
        - version
        - distributable
        - exist
    DistributionRegistrationResponse:
      title: DistributionRegistrationResponse
      type: object
      properties:
        package:
          type: string
          description: パッケージ名
        version:
          type: string
          description: ソフトウェアのバージョン
        distributable:
          type: boolean
          description: 配信の状態を示す。配信を開始した場合、`true`となる。
          example: true
        distributionDate:
          type: string
          description: 配信開始日時
          format: date-time
          example: '2026-02-12T10:30:45.123456'
      required:
        - package
        - version
        - distributable
        - distributionDate
      description: 配信開始レスポンス
    App:
      title: App
      type: object
      description: アプリケーションのモデル
      properties:
        package:
          type: string
          description: ソフトウェアのパッケージ名
          example: ai.fd.thinklet.app.mdmclient
        version:
          type: string
          description: ソフトウェアのバージョン
          example: 2.4.2
      required:
        - package
        - version
    FirmwareVersionInfo:
      title: FirmwareVersionInfo
      type: object
      properties:
        package:
          type: string
          description: ファームウェアのパッケージ名
          example: firmware
        version:
          type: string
          description: ファームウェアのバージョン
          example: 1.1.0
      required:
        - package
        - version
    AvailableFotaPackages:
      title: AvailableFotaPackages
      type: object
      properties:
        firmwareVersions:
          type: array
          minItems: 0
          description: 配信可能なファームウェアとバージョンの一覧
          items:
            $ref: '#/components/schemas/FirmwareVersionInfo'
      required:
        - firmwareVersions
    Commands:
      title: Commands
      type: object
      description: Commands
      properties:
        package:
          type: string
          maxLength: 128
          minLength: 1
          description: ご利用者様アプリのpackage名
        classpath:
          type: string
          maxLength: 256
          minLength: 1
          description: ご利用者様アプリのclasspath
        action:
          type: string
          maxLength: 128
          minLength: 1
          description: ご利用者様アプリのaction
        launchType:
          type: string
          description: |-
            動作のタイプ
            - activity
            - service
            - foregroundservice
            - broadcast
        extras:
          title: json
          type: object
          description: |-
            - ご利用者様アプリに対して追加でデータ連携したい情報などあればJson形式で指定
            - 最大バイト数は4096byte、超える場合はエラー
      required:
        - launchType
    KeyActionExtra:
      title: KeyActionExtra
      type: object
      properties:
        key-name:
          type: string
          description: IntentへputExtraするKey名称
        key-type:
          type: string
          description: |-
            IntentへputExtraする型
            - String
            - int
        key-value:
          oneOf:
            - type: string
            - type: integer
          description: IntentへputExtraする値
    KeyActionParam:
      title: KeyActionParam
      type: object
      properties:
        package-name:
          type: string
          description: 動作対象package
        class-name:
          type: string
          description: 動作対象classpath
        action-name:
          type: string
          description: 動作対象action名
        extras:
          type: array
          description: 動作対象へ付与するIntent Extra List
          items:
            $ref: '#/components/schemas/KeyActionExtra'
        flags:
          type: array
          description: 動作時のFlags(start activity flags)
          items:
            type: string
    KeyAction:
      title: KeyAction
      type: object
      properties:
        action-type:
          type: string
          description: |-
            動作種別。以下を定義する
            - launch-app
              - 指定アプリの呼び出しを設定
            - none
              - 動作無し（未定義は動作無しと同等）
        action-param:
          $ref: '#/components/schemas/KeyActionParam'
          description: 動作時の付与属性
      required:
        - action-type
    KeyConfig:
      title: KeyConfig
      type: object
      properties:
        key-name:
          type: string
          description: |-
            対象のkey名。以下のいずれかを指定
            - left
              - ジェスチャセンサに最も近い位置にあるキー
            - center
              - 3つ並んだキーの真ん中にある小さな突起のついたキー
            - right
              - THINKLETロゴに最も近い位置にあるキー
        key-event:
          type: string
          description: |-
            イベント発生させるKeyEvent
            - first-pressed
              - ボタンが押下された瞬間に発生するイベント
            - single-released
              - 短押し
            - double-pressed
              - 2回押しの押し始めのイベント
            - double-released
              - 2回押しの2回目に離した時のイベント
            - long-pressed
              - 長押しイベント
            - long-released
              - 長押し（long-pressed）後にボタンが離された時のイベント
        key-action:
          $ref: '#/components/schemas/KeyAction'
          description: イベント発生時の動作定義
      required:
        - key-name
        - key-event
        - key-action
    KeyConfigs:
      title: KeyConfigs
      type: object
      properties:
        key-config:
          type: array
          description: 各Key & ボタン操作の内容列挙
          items:
            $ref: '#/components/schemas/KeyConfig'
      required:
        - key-config
    PutConnectivityState:
      title: PutConnectivityState
      properties:
        state:
          type: string
          enum:
            - enabled
            - disabled
      description: Bluetooth/ネットワークのON/OFF状態
      required:
        - state
    BluetoothDeviceInfo:
      title: BluetoothDeviceInfo
      properties:
        macAddress:
          type: string
          example: 00:1A:2B:3C:4D:5E
      description: BluetoothデバイスのMACデバイス
      required:
        - macAddress
    BluetoothDeviceStateInfo:
      title: BluetoothDeviceStateInfo
      properties:
        macAddress:
          type: string
        state:
          type: string
          enum:
            - connect
            - disconnect
      description: BluetoothデバイスのMACデバイス
      required:
        - macAddress
        - state
    TransactionListItem:
      title: TransactionListItem
      type: object
      description: トランザクション一覧の各アイテム。詳細情報（transactionResultEvent）は含まない。
      properties:
        transactionId:
          type: integer
          example: 1
        transactionStatus:
          type: string
          description: |-
            - created
            - published（デバイスへトランザクション通知済み）
            - accepted（デバイスでトランザクション処理中）
            - processed（トランザクション処理済み）
            - canceled（トランザクションキャンセル済み）
          example: processed
        transactionResult:
          type: string
          enum:
            - success
            - failure
          nullable: true
          description: |-
            トランザクション結果のサマリー。
            - "success" : トランザクションが正常に完了した
            - "failure" : トランザクションが失敗またはキャンセルされた
            処理中のトランザクションは null。
        operationId:
          type: string
          description: オペレーションID。トランザクションを発行したAPIを識別する文字列。
          example: put-v1-applications-devices-commands
        deviceId:
          type: string
          description: THINKLETのIMEI
          example: '123456789023421'
        requestBody:
          description: |-
            トランザクション作成時のAPIリクエストボディ。
            リクエストボディがない操作（DELETE・GET メソッドの API）の場合は null。
            以下の機密フィールドは `"****************"` にマスクされて保存されます。
            - アクティベート（POST /devices）の `mimiClientSecret`
            - Wi-Fi設定（PUT /settings/wifi）の `password`
            - APN設定（PUT /settings/apn）の `password`
            - コマンド実行（PUT /commands）の `extras`
          nullable: true
          example:
            version: 1.0.0
          oneOf:
            - $ref: '#/components/schemas/Activate'
            - $ref: '#/components/schemas/WifiList'
            - $ref: '#/components/schemas/ApnList'
            - $ref: '#/components/schemas/Commands'
            - $ref: '#/components/schemas/LangList'
            - $ref: '#/components/schemas/KeyConfigs'
            - $ref: '#/components/schemas/App'
            - $ref: '#/components/schemas/Firmware'
            - $ref: '#/components/schemas/PutConnectivityState'
            - $ref: '#/components/schemas/BluetoothDeviceInfo'
            - $ref: '#/components/schemas/BluetoothDeviceStateInfo'
        createdAt:
          type: string
          format: ISO8601
          description: トランザクションの作成時刻
          example: '2022-04-24T14:15:22.123456'
        updatedAt:
          type: string
          format: ISO8601
          description: トランザクションの更新時刻
          example: '2022-04-24T14:15:22.123456'
      required:
        - transactionId
        - transactionStatus
        - transactionResult
        - operationId
        - deviceId
        - requestBody
        - createdAt
        - updatedAt
    GetTransactionsParameters:
      title: GetTransactionsParameters
      type: object
      description: クエリパラメータ情報
      properties:
        deviceId:
          type: string
          description: クエリパラメータで指定したTHINKLETのIMEI番号。未指定の場合は、`null`となる。
          example: '123456789023421'
          nullable: true
        completionStatus:
          type: string
          enum:
            - uncompleted
            - completed
            - canceled
          description: クエリパラメータで指定したcompletionStatus。未指定の場合は、`null`となる。
          example: uncompleted
          nullable: true
        transactionResult:
          type: string
          enum:
            - success
            - failure
          description: クエリパラメータで指定したtransactionResult。未指定の場合は、`null`となる。
          example: success
          nullable: true
        order:
          type: string
          enum:
            - asc
            - desc
          description: クエリパラメータで指定したorder。未指定の場合は、`null`となる。
          example: desc
          nullable: true
        sortBy:
          type: string
          enum:
            - transactionId
            - deviceId
            - transactionStatus
            - operationId
          example: deviceId
          description: ソート順を決める要素。未指定の場合は、transactionId順となる。
        perPage:
          type: number
          description: クエリパラメータで指定したperPage。未指定の場合は、`null`となる。
          example: 50
          nullable: true
        page:
          type: number
          description: クエリパラメータで指定したpage。未指定の場合は、`null`となる。
          example: 1
          nullable: true
        isNext:
          type: boolean
          description: perPage/pageを指定した場合に、次コンテンツが存在するか。perPage/pageを指定していない場合は、`null`となる。
          example: true
          nullable: true
      required:
        - deviceId
        - completionStatus
        - transactionResult
        - order
        - sortBy
        - perPage
        - page
        - isNext
    Alltransactions:
      title: Alltransactions
      type: object
      description: トランザクション情報の一覧
      properties:
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/TransactionListItem'
          minItems: 0
        parameters:
          type: object
          $ref: '#/components/schemas/GetTransactionsParameters'
      required:
        - transactions
        - parameters
    DeleteTransactions:
      title: DeleteTransactions
      type: object
      description: キャンセルしたトランザクションの情報
      properties:
        canceledTransactions:
          type: array
          items:
            type: integer
            format: int64
          minItems: 0
          description: キャンセルされたトランザクションIDのリスト
      required:
        - canceledTransactions
    TransactionResultEvent:
      title: TransactionResultEvent
      type: object
      description: |-
        デバイスからの結果通知イベント。操作種別によって含まれるフィールドが異なる。
        各操作種別のレスポンス例は examples を参照してください。
      properties:
        result:
          type: string
          description: >-
            トランザクション結果（success:成功,
            failure:失敗）。通常操作・SOTA（put-v1-applications-devices-apps）・FOTA（put-v1-applications-devices-firmware）・キャンセル（delete-v1-applications-devices-transactions）・アンインストール（delete-v1-applications-devices-package）で使用。
        success:
          type: boolean
          description: >-
            コマンド実行結果（true:成功,
            false:失敗）。コマンド実行（put-v1-applications-devices-commands）で使用。
        message:
          type: string
          description: 処理結果メッセージ
        timestamp:
          type: string
          description: イベント発生時のタイムスタンプ
        progress:
          type: number
          format: float
          description: アップデート用データのダウンロード進捗率（0.0〜1.0）。SOTA/FOTA のみ。
        process:
          type: string
          description: >-
            処理状態（固定値
            "processed"）。コマンド実行（put-v1-applications-devices-commands）で使用。
        customData:
          type: string
          description: >-
            端末内連携先アプリからの送信データ（任意項目）。コマンド実行（put-v1-applications-devices-commands）で使用。
        networkType:
          type: string
          enum:
            - bluetooth
            - wifi
            - apn
            - mobile
          description: 通知内容の種類。Connectivity タグの API で使用。
        statusCode:
          type: integer
          description: 実行結果コード。Connectivity タグの API で使用。
        state:
          type: string
          enum:
            - enabled
            - disabled
            - unknown
          description: >-
            ON/OFF の状態。Connectivity
            ON/OFF（get-v1-applications-connectivity-state・put-v1-applications-connectivity-state）で使用。
        target:
          type: string
          enum:
            - all
            - connected
            - available
          description: >-
            Bluetoothデバイス/ネットワークの取得対象。Connectivity
            一覧（get-v1-applications-connectivity-list）で使用。
        devices:
          type: array
          description: >-
            Bluetoothデバイス情報の一覧。Connectivity
            一覧（get-v1-applications-connectivity-list）・Bluetooth
            ペアリング（post-v1-applications-bluetooth-device・put-v1-applications-bluetooth-device・delete-v1-applications-bluetooth-device）で使用。
          items:
            type: object
        networks:
          type: array
          description: >-
            ネットワーク情報の一覧。Connectivity
            一覧（get-v1-applications-connectivity-list）で使用。
          items:
            type: object
        package:
          type: string
          description: >-
            アンインストール対象のパッケージ名。アンインストール（delete-v1-applications-devices-package）で使用。
      required:
        - timestamp
    GetTransaction:
      title: GetTransaction
      type: object
      description: トランザクション情報
      properties:
        transactionId:
          type: integer
          example: 1
        transactionStatus:
          type: string
          description: |-
            - created
            - published（デバイスへトランザクション通知済み）
            - accepted（デバイスでトランザクション処理中）
            - processed（トランザクション処理済み）
            - canceled（トランザクションキャンセル済み）
          example: accepted
        transactionResult:
          type: string
          enum:
            - success
            - failure
          nullable: true
          description: >-
            トランザクション結果のサマリー。

            - "success" : トランザクションが正常に完了した

            - "failure" : トランザクションが失敗またはキャンセルされた

            処理中のトランザクションは null。

            transactionStatus が "canceled" の場合は transactionResultEvent の有無に関わらず
            "failure" となります。

            それ以外の場合は transactionResultEvent の結果と同じ値が入ります。操作種別に関わらず成否を統一的に確認できます。
        transactionResultEvent:
          description: |-
            デバイスからの最新結果通知イベント。
            トランザクションが完了していない場合は null。
            SOTA/FOTA の場合、処理中は progress が 1.0 未満の値となり、完了後は 1.0 となる。
            成否のみ確認する場合は transactionResult フィールドを参照してください。
          nullable: true
          allOf:
            - $ref: '#/components/schemas/TransactionResultEvent'
        operationId:
          type: string
          description: >-
            オペレーションID。トランザクションを発行したAPIを識別する文字列。

            格納される値の一覧は、[「オペレーションIDとトランザクションの処理結果」](/docs/development/transaction#オペレーションidとトランザクションの処理結果)を参照してください。
          example: put-v1-applications-devices-commands
        deviceId:
          type: string
          description: THINKLETのIMEI
          example: '123456789023421'
        requestBody:
          description: |-
            トランザクション作成時のAPIリクエストボディ。
            リクエストボディがない操作（DELETE・GET メソッドの API）の場合は null。
            以下の機密フィールドは `"****************"` にマスクされて保存されます。
            - アクティベート（POST /devices）の `mimiClientSecret`
            - Wi-Fi設定（PUT /settings/wifi）の `password`
            - APN設定（PUT /settings/apn）の `password`
            - コマンド実行（PUT /commands）の `extras`
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/Activate'
            - $ref: '#/components/schemas/WifiList'
            - $ref: '#/components/schemas/ApnList'
            - $ref: '#/components/schemas/Commands'
            - $ref: '#/components/schemas/LangList'
            - $ref: '#/components/schemas/KeyConfigs'
            - $ref: '#/components/schemas/App'
            - $ref: '#/components/schemas/Firmware'
            - $ref: '#/components/schemas/PutConnectivityState'
            - $ref: '#/components/schemas/BluetoothDeviceInfo'
            - $ref: '#/components/schemas/BluetoothDeviceStateInfo'
        createdAt:
          type: string
          format: ISO8601
          description: トランザクションの作成時刻
          example: '2022-04-24T14:15:22.123456'
        updatedAt:
          type: string
          format: ISO8601
          description: トランザクションの更新時刻
          example: '2022-04-24T14:15:22.123456'
      required:
        - transactionId
        - transactionStatus
        - transactionResult
        - transactionResultEvent
        - operationId
        - deviceId
        - requestBody
        - createdAt
        - updatedAt
    WebRTCRequest:
      title: WebRTCRequest
      type: object
      properties:
        soraVersion:
          type: string
          description: >-
            Soraのバージョン。[利用可能なSoraのバージョンを取得](/apis/v1/cws_api#tag/CommunicationService/operation/get-v1-applications-sora-versions)にて取得したバージョンを指定する
      description: WebRTCエンドポイントとチャネルIDを返却するリクエストのモデル
    WebRTCEndpoint:
      title: Channels
      type: object
      properties:
        endpointUrl:
          type: string
          description: WebRTCエンドポイントURL
        channelId:
          type: string
          description: チャネルID(10桁のランダム文字列_生成日時(ミリ秒))
      required:
        - endpointUrl
        - channelId
      description: WebRTCエンドポイントとチャネルIDを返却するレスポンスのモデル
    GetAvailableSoraVersions:
      title: GetAvailableSoraVersions
      type: object
      properties:
        soraVersions:
          type: array
          items:
            type: object
            properties:
              soraVersion:
                type: string
                example: '2025.1'
                description: Soraのバージョン
              isDefault:
                type: boolean
                example: true
                description: デフォルトで利用される稼働中のWebRTCサーバ
            required:
              - soraVersion
              - isDefault
          description: 利用可能なSoraのバージョンのリスト
      required:
        - soraVersions
    Plan:
      title: Plan
      type: object
      description: プランの情報
      properties:
        videoMeeting:
          type: string
          nullable: true
          description: |-
            映像通信機能。以下のいずれかが適用される。
            - lite
            - basic 100
            - basic 200
            - null
              （プランに加入していない場合）
        speechRecognition:
          type: string
          nullable: true
          description: |-
            音声認識機能。以下のいずれかが適用される。
            - ja
            - null
            （音声認識機能が無効の場合）
      required:
        - videoMeeting
        - speechRecognition
    DevicePlans:
      title: DevicePlans
      type: object
      description: THINKLETごとのプランの情報
      properties:
        deviceId:
          type: string
          description: THINKLETのIMEI
        plans:
          $ref: '#/components/schemas/Plan'
        amountVideoMeeting:
          type: integer
          description: 映像通信利用時間合計 [hour]
        amountSpeechRecognition:
          type: integer
          description: 音声認識利用時間合計 [hour]
      required:
        - deviceId
        - plans
        - amountVideoMeeting
        - amountSpeechRecognition
    OtherPlans:
      title: OtherPlans
      type: object
      description: THINKLET以外の利用実績情報
      properties:
        amountVideoMeeting:
          type: integer
          description: 映像通信利用時間合計 [hour]
        amountSpeechRecognition:
          type: integer
          description: 音声認識利用時間合計 [hour]
      required:
        - amountVideoMeeting
        - amountSpeechRecognition
    AllPlans:
      title: AllPlans
      type: object
      description: 利用実績情報
      properties:
        numberOfDevices:
          type: integer
          description: アクティベート可能なTHINKLETの台数
        activateDevices:
          type: integer
          description: >-
            アクティベート済み、transactionStatus が processed
            に至っていないTHINKLETの台数。現在の年月を指定した場合のみ、返却される。
        devices:
          type: array
          items:
            $ref: '#/components/schemas/DevicePlans'
        others:
          $ref: '#/components/schemas/OtherPlans'
      required:
        - numberOfDevices
        - devices
        - others
tags:
  - name: Config
    description: Config Apis
  - name: Device
    description: Device(& Hardware Properties) Apis
  - name: Network
    description: Network Apis
  - name: Connectivity
    description: Connectivity Apis
  - name: Update
    description: FOTA & SOTA Apis
  - name: Operation
    description: Operation Apis
  - name: Transaction
    description: Transaction Apis
  - name: CommunicationService
    description: Communication Service Apis
  - name: Billing
    description: Billing Apis
