View Source ActiveCampaign.CustomObject.Schema (active_campaign v0.2.4)

Documentation for ActiveCampaign.CustomObject.Schema.

Link to this section Summary

Functions

Create a schema

Create a public schema

Create a public schema

Delete a schema

Retrieve a schema

List all schemas

Update a schema

Link to this section Functions

@spec create(map()) :: {:ok, map()} | {:error, any()}

Create a schema

iex(nex@2475ffae5951)29> ActiveCampaign.CustomObject.Schema.create %{slug: "disorder-relationship", fields: [%{id: "disorder", slug: "disorder", type: "text", labels: %{singular: "Disorder", plural: "Disorders"}}, %{id: "relationship", slug: "relationship", type: "dropdown", options: [%{id: "patient", value: "patient"}, %{id: "caregiver", value: "caregiver"}, %{id: "healthcare_provider", value: "healthcare_provider"}, %{id: "other", value: "other"}], labels: %{singular: "Relationship", plural: "Relationships"}}], labels: %{singular: "Disorder Relationship", plural: "Disorder Relationships"}, relationships: [%{id: "primary-contact", namespace: "contacts", hasMany: false, labels: %{singular: "Contact Disorder Relationship", plural: "Contact Disorder Relationships"}}]} {:ok, %{ "schema" => %{

 "createdTimestamp" => "2022-12-05T22:11:23.493594210Z",
 "fields" => [
   %{
     "id" => "disorder",
     "inherited" => false,
     "labels" => %{"plural" => "Disorders", "singular" => "Disorder"},
     "required" => false,
     "type" => "text"
   },
   %{
     "id" => "relationship",
     "inherited" => false,
     "labels" => %{
       "plural" => "Relationships",
       "singular" => "Relationship"
     },
     "options" => [
       %{
         "id" => "c6ef017a-4f03-4cf0-a918-d397a1be5a50",
         "value" => "patient"
       },
       %{
         "id" => "a3392140-824a-47c1-9164-bf85f3d30386",
         "value" => "caregiver"
       },
       %{
         "id" => "39d418cd-7553-4b46-b769-ad9ce1e5f0cd",
         "value" => "healthcare_provider"
       },
       %{"id" => "300c3732-13dd-4d00-989a-f2670c950da6", "value" => "other"}
     ],
     "required" => false,
     "type" => "dropdown"
   }
 ],
 "icons" => %{
   "default" => "https://d226aj4ao1t61q.cloudfront.net/n9mayqo2d_customobject.png"
 },
 "id" => "76a5a396-2705-48b4-9f8b-e50c11d6919a",
 "labels" => %{
   "plural" => "Disorder Relationships",
   "singular" => "Disorder Relationship"
 },
 "relationships" => [
   %{
     "hasMany" => false,
     "id" => "primary-contact",
     "inherited" => false,
     "labels" => %{
       "plural" => "Contact Disorder Relationships",
       "singular" => "Contact Disorder Relationship"
     },
     "namespace" => "contacts"
   }
 ],
 "slug" => "disorder-relationship",
 "updatedTimestamp" => "2022-12-05T22:11:23.493594210Z",
 "visibility" => "private"

} }}

@spec create_child_schema(integer()) :: {:ok, map()} | {:error, any()}

Create a public schema

Link to this function

create_public_schema(schema)

View Source
@spec create_public_schema(map()) :: {:ok, map()} | {:error, any()}

Create a public schema

@spec delete(integer()) :: {:ok, map()} | {:error, any()}

Delete a schema

Link to this function

delete_field(schema_id, field_id)

View Source
@spec delete_field(integer(), integer()) :: {:ok, map()} | {:error, any()}

Delete a field

@spec get(integer()) :: {:ok, map()} | {:error, any()}

Retrieve a schema

Link to this function

list(query_params \\ %{})

View Source
@spec list(map()) :: {:ok, map()} | {:error, any()}

List all schemas

@spec update(integer(), map()) :: {:ok, map()} | {:error, any()}

Update a schema