Skip to content

Latest commit

 

History

History
466 lines (392 loc) · 25.4 KB

File metadata and controls

466 lines (392 loc) · 25.4 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

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

CrmCustomObjectSchemasAllRequest req = new CrmCustomObjectSchemasAllRequest() {
    ServiceId = "salesforce",
    PassThrough = new Dictionary<string, object>() {
        { "search", "San Francisco" },
    },
};

CrmCustomObjectSchemasAllResponse? res = await sdk.Crm.CustomObjectSchemas.ListAsync(req);

while(res != null)
{
    // handle items

    res = await res.Next!();
}

Parameters

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

Response

CrmCustomObjectSchemasAllResponse

Errors

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

Create

Create custom object schema

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

CrmCustomObjectSchemasAddRequest req = new CrmCustomObjectSchemasAddRequest() {
    ServiceId = "salesforce",
    CustomObjectSchema = new CustomObjectSchemaInput() {
        Name = "project",
        Description = "This schema defines a project custom object",
        Fields = new List<Fields>() {
            new Fields() {
                Id = "field_123",
                Name = "project_name",
                Description = "Name of the project",
                Type = CustomObjectSchemaType.String,
                Required = true,
                Options = new List<CustomObjectSchemaOptions>() {
                    new CustomObjectSchemaOptions() {
                        Value = "option1",
                        Label = "Option 1",
                    },
                },
                DefaultValue = "New Project",
            },
        },
        Visible = true,
        Active = true,
        PassThrough = new List<PassThroughBody>() {
            new PassThroughBody() {
                ServiceId = "<id>",
                ExtendPaths = new List<ExtendPaths>() {
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                },
            },
            new PassThroughBody() {
                ServiceId = "<id>",
                ExtendPaths = new List<ExtendPaths>() {
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                },
            },
        },
    },
};

var res = await sdk.Crm.CustomObjectSchemas.CreateAsync(req);

// handle response

Parameters

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

Response

CrmCustomObjectSchemasAddResponse

Errors

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

Get

Get custom object schema

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

CrmCustomObjectSchemasOneRequest req = new CrmCustomObjectSchemasOneRequest() {
    Id = "<id>",
    ServiceId = "salesforce",
};

var res = await sdk.Crm.CustomObjectSchemas.GetAsync(req);

// handle response

Parameters

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

Response

CrmCustomObjectSchemasOneResponse

Errors

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

Update

Update custom object schema

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

CrmCustomObjectSchemasUpdateRequest req = new CrmCustomObjectSchemasUpdateRequest() {
    Id = "<id>",
    ServiceId = "salesforce",
    CustomObjectSchema = new CustomObjectSchemaInput() {
        Name = "project",
        Description = "This schema defines a project custom object",
        Fields = new List<Fields>() {
            new Fields() {
                Id = "field_123",
                Name = "project_name",
                Description = "Name of the project",
                Type = CustomObjectSchemaType.String,
                Required = true,
                Options = new List<CustomObjectSchemaOptions>() {
                    new CustomObjectSchemaOptions() {
                        Value = "option1",
                        Label = "Option 1",
                    },
                    new CustomObjectSchemaOptions() {
                        Value = "option1",
                        Label = "Option 1",
                    },
                },
                DefaultValue = "New Project",
            },
            new Fields() {
                Id = "field_123",
                Name = "project_name",
                Description = "Name of the project",
                Type = CustomObjectSchemaType.String,
                Required = true,
                Options = new List<CustomObjectSchemaOptions>() {
                    new CustomObjectSchemaOptions() {
                        Value = "option1",
                        Label = "Option 1",
                    },
                    new CustomObjectSchemaOptions() {
                        Value = "option1",
                        Label = "Option 1",
                    },
                },
                DefaultValue = "New Project",
            },
            new Fields() {
                Id = "field_123",
                Name = "project_name",
                Description = "Name of the project",
                Type = CustomObjectSchemaType.String,
                Required = true,
                Options = new List<CustomObjectSchemaOptions>() {
                    new CustomObjectSchemaOptions() {
                        Value = "option1",
                        Label = "Option 1",
                    },
                    new CustomObjectSchemaOptions() {
                        Value = "option1",
                        Label = "Option 1",
                    },
                },
                DefaultValue = "New Project",
            },
        },
        Visible = true,
        Active = true,
        PassThrough = new List<PassThroughBody>() {
            new PassThroughBody() {
                ServiceId = "<id>",
                ExtendPaths = new List<ExtendPaths>() {
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                },
            },
            new PassThroughBody() {
                ServiceId = "<id>",
                ExtendPaths = new List<ExtendPaths>() {
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                },
            },
            new PassThroughBody() {
                ServiceId = "<id>",
                ExtendPaths = new List<ExtendPaths>() {
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                    new ExtendPaths() {
                        Path = "$.nested.property",
                        Value = new Dictionary<string, object>() {
                            { "TaxClassificationRef", new Dictionary<string, object>() {
                                { "value", "EUC-99990201-V1-00020000" },
                            } },
                        },
                    },
                },
            },
        },
    },
};

var res = await sdk.Crm.CustomObjectSchemas.UpdateAsync(req);

// handle response

Parameters

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

Response

CrmCustomObjectSchemasUpdateResponse

Errors

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

Delete

Delete custom object schema

Example Usage

using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

CrmCustomObjectSchemasDeleteRequest req = new CrmCustomObjectSchemasDeleteRequest() {
    Id = "<id>",
    ServiceId = "salesforce",
};

var res = await sdk.Crm.CustomObjectSchemas.DeleteAsync(req);

// handle response

Parameters

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

Response

CrmCustomObjectSchemasDeleteResponse

Errors

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