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

# CommunitiesClient

コミュニティ関連の操作を行うための Client

この Client は、X API のコミュニティ関連エンドポイントとやり取りするためのメソッドを提供します。認証、リクエストのフォーマット、レスポンスの解析を処理し、コミュニティに関連するすべての操作を扱います。

<div id="constructors">
  ## コンストラクタ
</div>

<div id="constructor">
  ### constructor
</div>

• **new CommunitiesClient**(`client`): [`CommunitiesClient`](/ja/xdks/typescript/reference/classes/CommunitiesClient)

新しい Communities クライアントのインスタンスを作成します

<div id="parameters">
  #### パラメーター
</div>

| Name     | Type                                                     | Description                |
| :------- | :------------------------------------------------------- | :------------------------- |
| `client` | [`Client`](/ja/xdks/typescript/reference/classes/Client) | メインの X API 用 Client インスタンス |

<div id="returns">
  #### 戻り値
</div>

[`CommunitiesClient`](/ja/xdks/typescript/reference/classes/CommunitiesClient)

<div id="defined-in">
  #### 定義場所
</div>

[communities/client.ts:102](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L102)

<div id="methods">
  ## メソッド
</div>

<div id="search">
  ### search
</div>

▸ **search**(`query`, `options`): `Promise`\<`Response`>

コミュニティを検索する
指定した検索クエリに一致するコミュニティの一覧を取得します。

<div id="parameters">
  #### パラメーター
</div>

| Name      | Type                                                          | Description    |
| :-------- | :------------------------------------------------------------ | :------------- |
| `query`   | `string`                                                      | コミュニティ検索用のクエリ。 |
| `options` | `SearchOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -              |

<div id="returns">
  #### 戻り値
</div>

`Promise`\<`Response`>

API レスポンス、または requestOptions.raw が true の場合は生の Response に解決される Promise

#### 定義元

[communities/client.ts:147](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L147)

▸ **search**(`query`, `options?`): `Promise`\<[`Get2CommunitiesSearchResponse`](/ja/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesSearchResponse)>

#### パラメータ

| 名前         | type            |
| :--------- | :-------------- |
| `query`    | `string`        |
| `options?` | `SearchOptions` |

<div id="returns">
  #### 戻り値
</div>

`Promise`\<[`Get2CommunitiesSearchResponse`](/ja/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesSearchResponse)>

#### 定義元

[communities/client.ts:160](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L160)

***

<div id="getbyid">
  ### getById
</div>

▸ **getById**(`id`, `options`): `Promise`\<`Response`>

ID でコミュニティを取得する\
指定した ID のコミュニティの詳細情報を取得します。

#### パラメータ

| 名前        | 型                                                              | 説明              |
| :-------- | :------------------------------------------------------------- | :-------------- |
| `id`      | `string`                                                       | Community の ID。 |
| `options` | `GetByIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -               |

<div id="returns">
  #### 戻り値
</div>

`Promise`\<`Response`>

API レスポンスで解決される Promise。requestOptions.raw が true の場合は生の Response で解決されます

<div id="defined-in">
  #### 定義場所
</div>

[communities/client.ts:352](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L352)

▸ **getById**(`id`, `options?`): `Promise`\<[`Get2CommunitiesIdResponse`](/ja/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesIdResponse)>

<div id="parameters">
  #### パラメーター
</div>

| 名前         | 型                |
| :--------- | :--------------- |
| `id`       | `string`         |
| `options?` | `GetByIdOptions` |

<div id="returns">
  #### 戻り値
</div>

`Promise`\<[`Get2CommunitiesIdResponse`](/ja/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesIdResponse)>

#### 定義元

[communities/client.ts:365](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L365)
