> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Client

> 中心となるオブジェクトは Client オブジェクトで、API キーを使ってインスタンス化されます。このオブジェクトは Square Cloud サービスへの接続を表し、サービスのさまざまな側面とやり取りするためのインターフェースとして機能します。

```python theme={null}
import squarecloud as square

client = square.Client(api_key='API_KEY')

async def example():
    app_status = await client.app_status('application_id')
    print(app_status)
```

## パラメータ:

* api\_key

`api_key: str`: Client オブジェクトをインスタンス化する際に必須のパラメータです。
認証を正しく行うために、有効な API キーを文字列として指定する必要があります。

* debug

`debug: bool = True`: Client オブジェクトのデバッグモードを制御する
オプションのパラメータです。True に設定すると、リクエストが行われるたびに Client オブジェクトが
デバッグ情報を出力し、問題の検出と解決を容易にします。
ただし本番環境では、不要な情報の表示を避けるために、このパラメータを
False に設定するのが一般的です。
この値はデフォルトで True です。

## Application

\[Client] を使うと、アプリケーションを表すオブジェクト（またはオブジェクトの
リスト）を取得できます。このオブジェクトは Application クラスの
インスタンスで、アプリケーションの id を常に渡す必要なく、
アプリケーションをより便利に管理するために使えます。

<Tabs>
  <Tab title="アプリケーションを取得する">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')

    async def example():
        app = await client.app('application id')
        print(app)  # <Application tag='example' id='application_id'>
    ```
  </Tab>

  <Tab title="すべてのアプリケーションを取得する">
    ```python theme={null}
    import squarecloud as square

    client = square.Client(api_key='API KEY')

    async def example():
        apps = await client.all_apps()
        print(apps)  # list[<Application tag='example' id='application_id'>]
    ```
  </Tab>
</Tabs>
