---
name: "aiVisualNeedCopyQuery"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## aiVisualNeedCopyQuery

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

### Method signature

```typescript
aiVisualNeedCopyQuery(params: AiVisualNeedCopyQueryParams)
```

### Description

Check whether the Vision Box corresponding to stockId has a configuration currently syncing

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `params` | `AiVisualNeedCopyQueryParams` | Yes | - | Request body |

### Return Value

Type: `Promise<AiVisualNeedCopyQueryResult>`

scenesType, visionBoxId, needCopyEvent (see AiVisualNeedCopyQueryResult)

### Referenced Types

##### `type` AiVisualNeedCopyQueryParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `stockId` | `string` | Yes | Inventory ID |
| `gid` | `string` | Yes | Home ID |

##### `type` AiVisualNeedCopyQueryResult

| Property | Type | Description |
| --- | --- | --- |
| `scenesType` | `"SceneType.security" \\| "SceneType.album"` | Scene type |
| `visionBoxId` | `number` | Vision Box ID (optional) |
| `needCopyEvent` | `boolean` | Whether to sync copy events |

##### `enum` SceneType

| Enum Value | Actual Value | Description |
| --- | --- | --- |
| `SceneType.security` | `0` | Security scenario |
| `SceneType.album` | `1` | Gallery scenario |


### Valid Values

##### `SceneType`

| Value | Description | Since |
| --- | --- | --- |
| `0` | Security scenario | - |
| `1` | Gallery scenario | - |


### Examples

#### Request example

```typescript
import { aiVisualNeedCopyQuery } from '@tuya-miniapp/cloud-api';

aiVisualNeedCopyQuery({ stockId: 'stock-1', gid: '194137' })
  .then((r) => console.log(r))
  .catch(console.error);
```

#### Response example

```json
{ "scenesType": 0, "visionBoxId": 1, "needCopyEvent": false }
```
