Connection
This class defines a Connection from an [[User]] to an external service.
Extends
ResourceProperty<bkper.Connection>
Constructors
Constructor
new Connection(payload?, config?): Connection;Parameters
| Parameter | Type |
|---|---|
payload? | Connection |
config? | Config |
Returns
Connection
Overrides
ResourceProperty<bkper.Connection>.constructorProperties
payload
payload: Connection;The underlying payload data for this resource
Inherited from
ResourceProperty.payloadMethods
clearTokenProperties()
clearTokenProperties(): void;Cleans any token property stored in the Connection.
Returns
void
create()
create(): Promise<Connection>;Performs create new Connection.
Returns
Promise<Connection>
The created Connection, for chaining
deleteProperty()
deleteProperty(key): this;Deletes a custom property.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The property key |
Returns
this
This resource, for chaining
Inherited from
ResourceProperty.deletePropertygetAgentId()
getAgentId(): string | undefined;Gets the agentId of the Connection.
Returns
string | undefined
The Connection’s agentId
getDateAddedMs()
getDateAddedMs(): string | undefined;Gets the date when the Connection was added.
Returns
string | undefined
The Connection add date in milliseconds
getEmail()
getEmail(): string | undefined;Gets the email of the owner of the Connection.
Returns
string | undefined
The Connection owner’s email
getId()
getId(): string | undefined;Gets the id of the Connection.
Returns
string | undefined
The Connection’s id
getIntegrations()
getIntegrations(): Promise<Integration[]>;Gets the existing [[Integrations]] on the Connection.
Returns
Promise<Integration[]>
The existing Integration objects
getLogo()
getLogo(): string | undefined;Gets the logo of the Connection.
Returns
string | undefined
The Connection logo
getName()
getName(): string | undefined;Gets the name of the Connection.
Returns
string | undefined
The Connection name
getProperties()
getProperties(): object;Gets the custom properties stored in this resource.
Returns
object
Object with key/value pair properties
Inherited from
ResourceProperty.getPropertiesgetProperty()
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
ResourceProperty.getPropertygetPropertyKeys()
getPropertyKeys(): string[];Gets the custom properties keys stored in this resource.
Returns
string[]
Array of property keys sorted alphabetically
Inherited from
ResourceProperty.getPropertyKeysgetType()
getType(): "APP" | "BANK" | undefined;Gets the type of the Connection.
Returns
"APP" | "BANK" | undefined
The Connection type
getUUID()
getUUID(): string | undefined;Gets the universal unique identifier of this Connection.
Returns
string | undefined
The Connection’s universal unique identifier name
getVisibleProperties()
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
ResourceProperty.getVisiblePropertiesjson()
json(): Connection;Gets an immutable copy of the JSON payload for this resource.
Returns
Connection
An immutable copy of the json payload
Inherited from
ResourceProperty.jsonremove()
remove(): Promise<Connection>;Performs remove Connection.
Returns
Promise<Connection>
The removed Connection object
setAgentId()
setAgentId(agentId): Connection;Sets the Connection agentId.
Parameters
| Parameter | Type | Description |
|---|---|---|
agentId | string | The Connection agentId |
Returns
Connection
The Connection, for chaining
setName()
setName(name): Connection;Sets the name of the Connection.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the Connection |
Returns
Connection
The Connection, for chaining
setProperties()
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
ResourceProperty.setPropertiessetProperty()
setProperty(key, value): this;Sets a custom property in this resource.
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
ResourceProperty.setPropertysetType()
setType(type): Connection;Sets the Connection type.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | "APP" | "BANK" | The Connection type |
Returns
Connection
The Connection, for chaining
setUUID()
setUUID(uuid): Connection;Sets the universal unique identifier of the Connection.
Parameters
| Parameter | Type | Description |
|---|---|---|
uuid | string | The universal unique identifier of the Connection |
Returns
Connection
The Connection, for chaining
setVisibleProperties()
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
ResourceProperty.setVisiblePropertiessetVisibleProperty()
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
ResourceProperty.setVisibleProperty