# Picasa

Main class

## Constructor

#### new Picasa()

Creates an instance of Picasa.

Source:
  - picasa.js, line 20

### Methods

#### createAlbum(accessToken, albumData, callback) → {Promise}

Create an albums

Source:
  - picasa.js, line 91

##### Parameters:

Name | Type | Description
--- | --- | ---
`accessToken` | `string` | See `Picasa#getTokens`
`albumData` | `object` | Can be empty object
Name | Type | Description
--- | --- | ---
`title` | `string` |
`summary` | `string` |
`callback` | `function` | (error, response). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`

#### deletePhoto(accessToken, albumId, photoId, callback) → {Promise}

Delete Photo

Source:
  - picasa.js, line 66

##### Parameters:

Name | Type | Description
--- | --- | ---
`accessToken` | `string` | See `Picasa#getTokens`
`albumId` | `string` |
`photoId` | `string` |
`callback` | `function` | (error, response). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`

#### getAlbums(accessToken, options, callback) → {Promise}

Get all Albums

Source:
  - picasa.js, line 78

##### Parameters:

Name | Type | Description
--- | --- | ---
`accessToken` | `string` | See `Picasa#getTokens`
`options` | `object` | Can be empty object
Name | Type | Description
--- | --- | ---
`TODO` | `integer` | TODO
`callback` | `function` | (error, response). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`

#### getAuthURL(config, callback) → {Promise}

Get Auth URL. Redirect user to this URL to get code. The code will be used later for `Picasa#getTokens`

Source:
  - picasa.js, line 131

##### Parameters:

Name | Type | Description
--- | --- | ---
`config` | `object` | Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
Name | Type | Description
--- | --- | ---
`clientId` | `string` |
`redirectURI` | `string` | URL to user will be redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
`callback` | `function` | (error, response). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`

#### getPhotos(accessToken, options, callback) → {Promise}

Get Photos

Source:
  - picasa.js, line 38

##### Parameters:

Name | Type | Description
--- | --- | ---
`accessToken` | `string` | See `Picasa#getTokens`
`options` | `object` | Can be empty object
Name | Type | Description
--- | --- | ---
`maxResults` | `integer` | By default get all photos
`albumId` | `string` | By default all photos are selected
`callback` | `function` | (error, response). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`

#### getTokens(config, code, callback) → {Promise}

Get access token and refresh token

Source:
  - picasa.js, line 105

##### Parameters:

Name | Type | Description
--- | --- | ---
`config` | `object` | Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
Name | Type | Description
--- | --- | ---
`clientId` | `string` |
`redirectURI` | `string` | URL that user was redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
`clientSecret` | `string` |
`code` | `string` | Get code from URL param, when user is redirected from authURL. See `Picasa#getAuthURL`
`callback` | `function` | (error, response{accessToken, refreshToken}). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`

- Object{accessToken, refreshToken}

#### postPhoto(accessToken, albumId, photoData, callback) → {Promise}

Create Photos

Source:
  - picasa.js, line 54

##### Parameters:

Name | Type | Description
--- | --- | ---
`accessToken` | `string` | See `Picasa#getTokens`
`albumId` | `string` |
`photoData` | `object` | Photo's propperties
Name | Type | Description
--- | --- | ---
`title` | `string` |
`summary` | `string` |
`contentType` | `string` | image/bmp, image/gif, image/png
`binary` | `blob` | Blob binary
`callback` | `function` | (error, response). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`

#### renewAccessToken(config, refreshToken, callback) → {Promise}

Renews access token

Source:
  - picasa.js, line 119

##### Parameters:

Name | Type | Description
--- | --- | ---
`config` | `object` | Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
Name | Type | Description
--- | --- | ---
`clientId` | `string` |
`redirectURI` | `string` | URL that user was redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
`clientSecret` | `string` |
`refreshToken` | `string` | The refreshToken is retrived after getTokens is executed. See `Picasa#getTokens`
`callback` | `function` | (error, response). If not provided, a promise will be returned

##### Returns:

Type:
  `Promise`