Skip to content

Latest commit

 

History

History
459 lines (336 loc) · 21.1 KB

README.md

File metadata and controls

459 lines (336 loc) · 21.1 KB

Files

(fileStorage->files)

Overview

Available Operations

list

List Files

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\FileStorageFilesAllRequest(
    serviceId: 'salesforce',
    filter: new Components\FilesFilter(
        driveId: '1234',
        folderId: 'root',
        shared: true,
    ),
    sort: new Components\FilesSort(
        by: Components\FilesSortBy::UpdatedAt,
        direction: Components\SortDirection::Desc,
    ),
    passThrough: [
        'search' => 'San Francisco',
    ],
    fields: 'id,updated_at',
);

$responses = $sdk->fileStorage->files->list(
    request: $request
);


foreach ($responses as $response) {
    if ($response->httpMeta->response->getStatusCode() === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\FileStorageFilesAllRequest ✔️ The request object to use for the request.

Response

?Operations\FileStorageFilesAllResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

delete

Delete File

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\FileStorageFilesDeleteRequest(
    id: '<id>',
    serviceId: 'salesforce',
);

$response = $sdk->fileStorage->files->delete(
    request: $request
);

if ($response->deleteFileResponse !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\FileStorageFilesDeleteRequest ✔️ The request object to use for the request.

Response

?Operations\FileStorageFilesDeleteResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

download

Download File

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\FileStorageFilesDownloadRequest(
    id: '<id>',
    serviceId: 'salesforce',
    fields: 'id,updated_at',
);

$response = $sdk->fileStorage->files->download(
    request: $request
);

if ($response->getFileDownloadResponse !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\FileStorageFilesDownloadRequest ✔️ The request object to use for the request.

Response

?Operations\FileStorageFilesDownloadResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

export

Export File

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\FileStorageFilesExportRequest(
    id: '<id>',
    format: 'pdf',
    serviceId: 'salesforce',
    fields: 'id,updated_at',
);

$response = $sdk->fileStorage->files->export(
    request: $request
);

if ($response->getFileDownloadResponse !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\FileStorageFilesExportRequest ✔️ The request object to use for the request.

Response

?Operations\FileStorageFilesExportResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

get

Get File

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\FileStorageFilesOneRequest(
    id: '<id>',
    serviceId: 'salesforce',
    fields: 'id,updated_at',
);

$response = $sdk->fileStorage->files->get(
    request: $request
);

if ($response->getFileResponse !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\FileStorageFilesOneRequest ✔️ The request object to use for the request.

Response

?Operations\FileStorageFilesOneResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

search

Search Files

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\FileStorageFilesSearchRequest(
    filesSearch: new Components\FilesSearch(
        query: 'logo jpg',
    ),
    serviceId: 'salesforce',
    passThrough: [
        'search' => 'San Francisco',
    ],
    filter: new Components\FilesFilter(
        driveId: '1234',
        folderId: 'root',
        shared: true,
    ),
    fields: 'id,updated_at',
);

$response = $sdk->fileStorage->files->search(
    request: $request
);

if ($response->getFilesResponse !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\FileStorageFilesSearchRequest ✔️ The request object to use for the request.

Response

?Operations\FileStorageFilesSearchResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

update

Rename or move File

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\FileStorageFilesUpdateRequest(
    id: '<id>',
    updateFileRequest: new Components\UpdateFileRequest(
        name: 'New Name.pdf',
        description: 'Renamed PDF Document',
        parentFolderId: '1234',
        passThrough: [
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
        ],
    ),
    serviceId: 'salesforce',
);

$response = $sdk->fileStorage->files->update(
    request: $request
);

if ($response->updateFileResponse !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\FileStorageFilesUpdateRequest ✔️ The request object to use for the request.

Response

?Operations\FileStorageFilesUpdateResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*