# File

## Extends

- `File`

### payload

```ts
payload: File;
```

The underlying payload data for this resource

#### Inherited from

```ts
Bkper.File.payload
```

### create()

```ts
create(): File;
```

Perform create new File.

#### Returns

`File`

#### Inherited from

```ts
Bkper.File.create
```

***

### deleteProperty()

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

Deletes a custom property.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.File.deleteProperty
```

***

### getBlob()

```ts
getBlob(): Blob;
```

Gets the Blob from this file

#### Returns

`Blob`

#### Inherited from

```ts
Bkper.File.getBlob
```

***

### getContent()

```ts
getContent(): string;
```

Gets the file content Base64 encoded

#### Returns

`string`

#### Inherited from

```ts
Bkper.File.getContent
```

***

### getContentType()

```ts
getContentType(): string;
```

Gets the File content type

#### Returns

`string`

#### Inherited from

```ts
Bkper.File.getContentType
```

***

### getId()

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

Gets the File id

#### Returns

`string`

#### Inherited from

```ts
Bkper.File.getId
```

***

### getName()

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

Gets the File name

#### Returns

`string`

#### Inherited from

```ts
Bkper.File.getName
```

***

### getProperties()

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

Gets the custom properties stored in this resource.

#### Returns

`object`

Object with key/value pair properties

#### Inherited from

```ts
Bkper.File.getProperties
```

***

### getProperty()

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

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

#### Parameters

| Parameter | Type |
| :------ | :------ |
| ...`keys` | `string`[] |

#### Returns

`string`

The property value or null if not found

#### Inherited from

```ts
Bkper.File.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
Bkper.File.getPropertyKeys
```

***

### getSize()

```ts
getSize(): number;
```

Gets the file size in bytes

#### Returns

`number`

#### Inherited from

```ts
Bkper.File.getSize
```

***

### getUrl()

```ts
getUrl(): string;
```

Gets the file serving url for accessing via browser

#### Returns

`string`

#### Inherited from

```ts
Bkper.File.getUrl
```

***

### 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
Bkper.File.getVisibleProperties
```

***

### json()

```ts
json(): File;
```

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

#### Returns

`File`

An immutable copy of the json payload

#### Inherited from

```ts
Bkper.File.json
```

***

### setBlob()

```ts
setBlob(blob): File;
```

Sets the File properties from a Blob

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `blob` | `Blob` |

#### Returns

`File`

This File, for chainning.

#### Inherited from

```ts
Bkper.File.setBlob
```

***

### setContent()

```ts
setContent(content): File;
```

Sets the File content Base64 encoded.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `content` | `string` |

#### Returns

`File`

This File, for chainning.

#### Inherited from

```ts
Bkper.File.setContent
```

***

### setContentType()

```ts
setContentType(contentType): File;
```

Sets the File content type.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `contentType` | `string` |

#### Returns

`File`

This File, for chainning.

#### Inherited from

```ts
Bkper.File.setContentType
```

***

### setName()

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

Sets the name of the File.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `name` | `string` |

#### Returns

`File`

This File, for chainning.

#### Inherited from

```ts
Bkper.File.setName
```

***

### setProperties()

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

Sets the custom properties of this resource.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.File.setProperties
```

***

### setProperty()

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

Sets a custom property in this resource.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |
| `value` | `string` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.File.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 |
| :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.File.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 |
| :------ | :------ |
| `key` | `string` |
| `value` | `string` \| `null` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.File.setVisibleProperty
```
