# Integration

This class defines a Integration from an [[User]] to an external service.

## Extends

- `ResourceProperty`\<`bkper.Integration`\>

### Constructor

```ts
new Integration(payload?, config?): Integration;
```

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `payload?` | `Integration` |
| `config?` | [`Config`](https://bkper.com/docs/api/bkper-js/interfaces/config.md) |

#### Returns

`Integration`

#### Overrides

```ts
ResourceProperty<bkper.Integration>.constructor
```

### payload

```ts
payload: Integration;
```

The underlying payload data for this resource

#### Inherited from

```ts
ResourceProperty.payload
```

### deleteProperty()

```ts
deleteProperty(key): this;
```

Deletes a custom property.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `key` | `string` | The property key |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
ResourceProperty.deleteProperty
```

***

### getAddedBy()

```ts
getAddedBy(): string | undefined;
```

Gets the name of the user who added the Integration.

#### Returns

`string` \| `undefined`

The user name of who added the Integration

***

### getAgentId()

```ts
getAgentId(): string | undefined;
```

Gets the agent id of the Integration.

#### Returns

`string` \| `undefined`

The Integration's agent id

***

### getBookId()

```ts
getBookId(): string | undefined;
```

Gets the [[Book]] id of the Integration.

#### Returns

`string` \| `undefined`

The Integration's Book id

***

### getDateAddedMs()

```ts
getDateAddedMs(): string | undefined;
```

Gets the date when the Integration was added.

#### Returns

`string` \| `undefined`

The Integration add date in milliseconds

***

### getId()

```ts
getId(): string | undefined;
```

Gets the id of the Integration.

#### Returns

`string` \| `undefined`

This Integration's id

***

### getLastUpdateMs()

```ts
getLastUpdateMs(): string | undefined;
```

Gets the date when the Integration was last updated.

#### Returns

`string` \| `undefined`

The Integration last update date in milliseconds

***

### ~~getLogo()~~

```ts
getLogo(): string | undefined;
```

Gets the logo of the Integration.

> **Caution: Deprecated**
> Use getLogoUrl instead.
#### Returns

`string` \| `undefined`

The Integration's logo

***

### getLogoUrl()

```ts
getLogoUrl(): string | undefined;
```

Gets the logo url of this Integration.

#### Returns

`string` \| `undefined`

The logo url of this Integration

***

### getLogoUrlDark()

```ts
getLogoUrlDark(): string | undefined;
```

Gets the logo url of this Integration in dark mode.

#### Returns

`string` \| `undefined`

The logo url of this Integration in dark mode

***

### getName()

```ts
getName(): string | undefined;
```

Gets the name of the Integration.

#### Returns

`string` \| `undefined`

The Integration's name

***

### getProperties()

```ts
getProperties(): object;
```

Gets the custom properties stored in this resource.

#### Returns

`object`

Object with key/value pair properties

#### Inherited from

```ts
ResourceProperty.getProperties
```

***

### getProperty()

```ts
getProperty(...keys): string | undefined;
```

Gets the property value for given keys. First property found will be retrieved.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| ...`keys` | `string`[] | The property keys to search for |

#### Returns

`string` \| `undefined`

The property value or undefined if not found

#### Inherited from

```ts
ResourceProperty.getProperty
```

***

### getPropertyKeys()

```ts
getPropertyKeys(): string[];
```

Gets the custom properties keys stored in this resource.

#### Returns

`string`[]

Array of property keys sorted alphabetically

#### Inherited from

```ts
ResourceProperty.getPropertyKeys
```

***

### getVisibleProperties()

```ts
getVisibleProperties(): object;
```

Gets the visible custom properties stored in this resource.
Hidden properties (those ending with "_") are excluded from the result.

#### Returns

`object`

Object with key/value pair properties, excluding hidden properties

#### Inherited from

```ts
ResourceProperty.getVisibleProperties
```

***

### json()

```ts
json(): Integration;
```

Gets an immutable copy of the JSON payload for this resource.

#### Returns

`Integration`

An immutable copy of the json payload

#### Inherited from

```ts
ResourceProperty.json
```

***

### remove()

```ts
remove(): Promise;
```

Performs remove Integration.

#### Returns

`Promise`\<`Integration`\>

The removed Integration object

***

### setName()

```ts
setName(name): Integration;
```

Sets the name of the Integration.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | The name of the Integration |

#### Returns

`Integration`

The Integration, for chaining

***

### setProperties()

```ts
setProperties(properties): this;
```

Sets the custom properties of this resource.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} | Object with key/value pair properties |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
ResourceProperty.setProperties
```

***

### setProperty()

```ts
setProperty(key, value): this;
```

Sets a custom property in this resource.

Property keys are normalized and validated by the API when saved. Keep keys
to 30 characters or fewer after normalization. Use a trailing underscore
(`_`) for hidden/internal properties.

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `key` | `string` | The property key |
| `value` | `string` \| `null` \| `undefined` | The property value, or null/undefined to clean it |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
ResourceProperty.setProperty
```

***

### setVisibleProperties()

```ts
setVisibleProperties(properties): this;
```

Sets the custom properties of this resource, filtering out hidden properties.
Hidden properties are those whose keys end with an underscore "_".

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} | Object with key/value pair properties |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
ResourceProperty.setVisibleProperties
```

***

### setVisibleProperty()

```ts
setVisibleProperty(key, value): this;
```

Sets a custom property in this resource, filtering out hidden properties.
Hidden properties are those whose keys end with an underscore "_".

#### Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `key` | `string` | The property key |
| `value` | `string` \| `null` \| `undefined` | The property value, or null/undefined to clean it |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
ResourceProperty.setVisibleProperty
```

***

### update()

```ts
update(): Promise;
```

Performs update Integration.

#### Returns

`Promise`\<`Integration`\>

The updated Integration object
