Skip to content

Latest commit

 

History

History
340 lines (251 loc) · 15.2 KB

README.md

File metadata and controls

340 lines (251 loc) · 15.2 KB

ApideckDepartments

(hris->departments)

Overview

Available Operations

  • create - Create Department
  • list - List Departments
  • delete - Delete Department
  • get - Get Department
  • update - Update Department

create

Create Department

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\HrisDepartmentsAddRequest(
    department: new Components\DepartmentInput(
        passThrough: [
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
        ],
        name: 'R&D',
        code: '2',
        description: 'R&D',
    ),
    serviceId: 'salesforce',
);

$response = $sdk->hris->departments->create(
    request: $request
);

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

Parameters

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

Response

?Operations\HrisDepartmentsAddResponse

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 */*

list

List Departments

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\HrisDepartmentsAllRequest(
    serviceId: 'salesforce',
    passThrough: [
        'search' => 'San Francisco',
    ],
    fields: 'id,updated_at',
);

$responses = $sdk->hris->departments->list(
    request: $request
);


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

Parameters

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

Response

?Operations\HrisDepartmentsAllResponse

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 Department

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\HrisDepartmentsDeleteRequest(
    id: '<id>',
    serviceId: 'salesforce',
);

$response = $sdk->hris->departments->delete(
    request: $request
);

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

Parameters

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

Response

?Operations\HrisDepartmentsDeleteResponse

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 Department

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\HrisDepartmentsOneRequest(
    id: '<id>',
    serviceId: 'salesforce',
    fields: 'id,updated_at',
);

$response = $sdk->hris->departments->get(
    request: $request
);

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

Parameters

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

Response

?Operations\HrisDepartmentsOneResponse

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

Update Department

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\HrisDepartmentsUpdateRequest(
    id: '<id>',
    department: new Components\DepartmentInput(
        passThrough: [
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
        ],
        name: 'R&D',
        code: '2',
        description: 'R&D',
    ),
    serviceId: 'salesforce',
);

$response = $sdk->hris->departments->update(
    request: $request
);

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

Parameters

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

Response

?Operations\HrisDepartmentsUpdateResponse

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 */*