Skip to content

Latest commit

 

History

History
508 lines (424 loc) · 23.1 KB

File metadata and controls

508 lines (424 loc) · 23.1 KB

Crm.CustomObjectSchemas

Overview

Available Operations

  • list - List custom object schemas
  • create - Create custom object schema
  • get - Get custom object schema
  • update - Update custom object schema
  • delete - Delete custom object schema

list

List custom object schemas

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

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

$request = new Operations\CrmCustomObjectSchemasAllRequest(
    serviceId: 'salesforce',
    passThrough: [
        'search' => 'San Francisco',
    ],
);

$responses = $sdk->crm->customObjectSchemas->list(
    request: $request
);


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

Parameters

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

Response

?Operations\CrmCustomObjectSchemasAllResponse

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

create

Create custom object schema

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

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

$request = new Operations\CrmCustomObjectSchemasAddRequest(
    serviceId: 'salesforce',
    customObjectSchema: new Components\CustomObjectSchemaInput(
        name: 'project',
        description: 'This schema defines a project custom object',
        fields: [
            new Components\Fields(
                id: 'field_123',
                name: 'project_name',
                description: 'Name of the project',
                type: Components\CustomObjectSchemaType::String,
                required: true,
                options: [
                    new Components\CustomObjectSchemaOptions(
                        value: 'option1',
                        label: 'Option 1',
                    ),
                ],
                defaultValue: 'New Project',
            ),
        ],
        visible: true,
        active: true,
        passThrough: [
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
        ],
    ),
);

$response = $sdk->crm->customObjectSchemas->create(
    request: $request
);

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

Parameters

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

Response

?Operations\CrmCustomObjectSchemasAddResponse

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 custom object schema

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

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

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

$response = $sdk->crm->customObjectSchemas->get(
    request: $request
);

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

Parameters

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

Response

?Operations\CrmCustomObjectSchemasOneResponse

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 custom object schema

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

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

$request = new Operations\CrmCustomObjectSchemasUpdateRequest(
    id: '<id>',
    serviceId: 'salesforce',
    customObjectSchema: new Components\CustomObjectSchemaInput(
        name: 'project',
        description: 'This schema defines a project custom object',
        fields: [
            new Components\Fields(
                id: 'field_123',
                name: 'project_name',
                description: 'Name of the project',
                type: Components\CustomObjectSchemaType::String,
                required: true,
                options: [
                    new Components\CustomObjectSchemaOptions(
                        value: 'option1',
                        label: 'Option 1',
                    ),
                    new Components\CustomObjectSchemaOptions(
                        value: 'option1',
                        label: 'Option 1',
                    ),
                ],
                defaultValue: 'New Project',
            ),
            new Components\Fields(
                id: 'field_123',
                name: 'project_name',
                description: 'Name of the project',
                type: Components\CustomObjectSchemaType::String,
                required: true,
                options: [
                    new Components\CustomObjectSchemaOptions(
                        value: 'option1',
                        label: 'Option 1',
                    ),
                    new Components\CustomObjectSchemaOptions(
                        value: 'option1',
                        label: 'Option 1',
                    ),
                ],
                defaultValue: 'New Project',
            ),
            new Components\Fields(
                id: 'field_123',
                name: 'project_name',
                description: 'Name of the project',
                type: Components\CustomObjectSchemaType::String,
                required: true,
                options: [
                    new Components\CustomObjectSchemaOptions(
                        value: 'option1',
                        label: 'Option 1',
                    ),
                    new Components\CustomObjectSchemaOptions(
                        value: 'option1',
                        label: 'Option 1',
                    ),
                ],
                defaultValue: 'New Project',
            ),
        ],
        visible: true,
        active: true,
        passThrough: [
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
        ],
    ),
);

$response = $sdk->crm->customObjectSchemas->update(
    request: $request
);

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

Parameters

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

Response

?Operations\CrmCustomObjectSchemasUpdateResponse

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 custom object schema

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

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

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

$response = $sdk->crm->customObjectSchemas->delete(
    request: $request
);

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

Parameters

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

Response

?Operations\CrmCustomObjectSchemasDeleteResponse

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