# AV

Source:
  - av.js, line 24

Contains all AV API classes and functions.

### Classes

ACL
Captcha
Conversation
Error
File
GeoPoint
InboxQuery
Leaderboard
LiveQuery
Object
Query
Relation
Role
SearchQuery
SearchSortBuilder
Status
User

### Namespaces

Cloud
Insight
Push

### Members

#### (static) LeaderboardOrder

Source:
  - leaderboard.js, line 22

##### Properties:

Name | Type | Description
--- | --- | ---
`ASCENDING` |  |
`DESCENDING` |  |

The order of the leaderboard results

#### (static) LeaderboardUpdateStrategy

Source:
  - leaderboard.js, line 31

##### Properties:

Name | Type | Description
--- | --- | ---
`BETTER` |  | Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one.
`LAST` |  | Keep the last updated statistic
`SUM` |  | Keep the sum of all updated statistics

The update strategy for Leaderboard

#### (static) LeaderboardVersionChangeInterval

Source:
  - leaderboard.js, line 11

##### Properties:

Name | Type | Description
--- | --- | ---
`NEVER` |  |
`DAY` |  |
`WEEK` |  |
`MONTH` |  |

The version change interval for Leaderboard

### Methods

#### (static) init(options)

Source:
  - init.js, line 47

Call this method first to set up your authentication tokens for AV. You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .

##### Parameters:

Name | Type | Description
--- | --- | ---

`options`

Object

###### Properties

Name | Type | Attributes | Description
--- | --- | --- | ---
`appId` | String |  | application id
`appKey` | String |  | application key
`masterKey` | String | <optional> | application master key
`production` | Boolean | <optional> |
`serverURLs` | String | ServerURLs | <optional> | URLs for services. if a string was given, it will be applied for all services.
`disableCurrentUser` | Boolean | <optional> |

#### (static) parseJSON(return)

Source:
  - av.js, line 258
Since:
  - 2.0.0

The inverse function of AV.Object#toFullJSON.

##### Parameters:

Name | Type | Description
--- | --- | ---
`return` | Object | {AV.Object|AV.File|any}

#### (static) request(options)

Source:
  - request.js, line 100
Since:
  - 3.0.0

Low level REST API client. Call REST endpoints with authorization headers.

##### Parameters:

Name | Type | Description
--- | --- | ---

`options`

Object

###### Properties

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`method` | String |  |  | HTTP method
`path` | String |  |  | endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
`query` | Object | <optional> |  | query string dict
`data` | Object | <optional> |  | HTTP body
`authOptions` | AuthOptions | <optional> |  |
`service` | String | <optional> | `'api'` |
`version` | String | <optional> | `'1.1'` |

#### (static) setProduction(production)

Source:
  - init.js, line 127

Call this method to set production environment variable.

##### Parameters:

Name | Type | Description
--- | --- | ---
`production` | Boolean | True is production environment,and it's true by default.

#### (static) setRequestTimeout(ms)

Source:
  - init.js, line 169
Since:
  - 3.6.0

Set a deadline for requests to complete. Note that file upload requests are not affected.

##### Parameters:

Name | Type | Description
--- | --- | ---
`ms` | number |

#### (static) setServerURLs(urls)

Source:
  - init.js, line 156
Since:
  - 3.0.0

Set server URLs for services.

##### Parameters:

Name | Type | Description
--- | --- | ---
`urls` | String | ServerURLs | URLs for services. if a string was given, it will be applied for all services. You can also set them when initializing SDK with `options.serverURLs`