From b4332be988f61987794a1420c9e43b4d2841ae1e Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 9 Apr 2025 06:53:47 +0000 Subject: [PATCH 1/2] [AUTOMATED] Update OpenAPI spec --- docs/spec/openapi.json | 213 ++-- docs/spec/openapi_old.json | 2441 ++++++++++++++++++++++++++++++++++++ docs/spec/report.html | 146 +++ 3 files changed, 2693 insertions(+), 107 deletions(-) create mode 100644 docs/spec/openapi_old.json create mode 100755 docs/spec/report.html diff --git a/docs/spec/openapi.json b/docs/spec/openapi.json index bd50a59..32ebd1e 100644 --- a/docs/spec/openapi.json +++ b/docs/spec/openapi.json @@ -38,7 +38,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -48,7 +48,7 @@ }, { "name" : "eventId", "in" : "path", - "description" : "The event ID.", + "description" : "The event ID", "required" : true, "style" : "simple", "explode" : false, @@ -123,7 +123,7 @@ "operationId" : "post-/events_create", "parameters" : [ ], "requestBody" : { - "description" : "The timeline event definition.", + "description" : "The timeline event definition", "content" : { "application/json" : { "schema" : { @@ -230,7 +230,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -240,7 +240,7 @@ }, { "name" : "tokenName", "in" : "path", - "description" : "The token name.", + "description" : "The token name", "required" : true, "style" : "simple", "explode" : false, @@ -250,7 +250,7 @@ }, { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -260,7 +260,7 @@ } } ], "requestBody" : { - "description" : "The updated token definition.", + "description" : "The updated token definition", "content" : { "application/json" : { "schema" : { @@ -321,7 +321,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -331,7 +331,7 @@ }, { "name" : "tokenName", "in" : "path", - "description" : "The token name.", + "description" : "The token name", "required" : true, "style" : "simple", "explode" : false, @@ -341,7 +341,7 @@ }, { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -380,7 +380,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -390,7 +390,7 @@ }, { "name" : "eventId", "in" : "path", - "description" : "The event ID.", + "description" : "The event ID", "required" : true, "style" : "simple", "explode" : false, @@ -465,7 +465,7 @@ "operationId" : "post-/events/batch/create_createBatch", "parameters" : [ ], "requestBody" : { - "description" : "The timeline event definition.", + "description" : "The timeline event definition", "content" : { "application/json" : { "schema" : { @@ -622,7 +622,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -632,7 +632,7 @@ }, { "name" : "eventId", "in" : "path", - "description" : "The event ID.", + "description" : "The event ID", "required" : true, "style" : "simple", "explode" : false, @@ -642,7 +642,7 @@ }, { "name" : "detail", "in" : "query", - "description" : "Set to 'true', we want to render the `detailTemplate` instead of the `headerTemplate`.", + "description" : "Set to 'true', we want to render the `detailTemplate` instead of the `headerTemplate`", "required" : false, "style" : "form", "explode" : true, @@ -718,7 +718,7 @@ "parameters" : [ { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -832,7 +832,7 @@ "parameters" : [ { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -842,7 +842,7 @@ } } ], "requestBody" : { - "description" : "The new event template definition.", + "description" : "The new event template definition", "content" : { "application/json" : { "schema" : { @@ -931,7 +931,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -941,7 +941,7 @@ }, { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -1030,7 +1030,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -1040,7 +1040,7 @@ }, { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -1050,7 +1050,7 @@ } } ], "requestBody" : { - "description" : "The updated event template definition.", + "description" : "The updated event template definition", "content" : { "application/json" : { "schema" : { @@ -1141,7 +1141,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -1151,7 +1151,7 @@ }, { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -1190,7 +1190,7 @@ "parameters" : [ { "name" : "eventTemplateId", "in" : "path", - "description" : "The event template ID.", + "description" : "The event template ID", "required" : true, "style" : "simple", "explode" : false, @@ -1200,7 +1200,7 @@ }, { "name" : "appId", "in" : "path", - "description" : "The ID of the target app.", + "description" : "The ID of the target app", "required" : true, "style" : "simple", "explode" : false, @@ -1210,7 +1210,7 @@ } } ], "requestBody" : { - "description" : "The new token definition.", + "description" : "The new token definition", "content" : { "application/json" : { "schema" : { @@ -1270,13 +1270,13 @@ "properties" : { "eventTemplateId" : { "type" : "string", - "description" : "The event template ID.", + "description" : "The event template ID", "example" : "1001298" }, "extraData" : { "type" : "object", "properties" : { }, - "description" : "Additional event-specific data that can be interpreted by the template's markdown.", + "description" : "Additional event-specific data that can be interpreted by the template's markdown", "example" : { "questions" : [ { "answer" : "Bark!", @@ -1292,14 +1292,14 @@ }, "domain" : { "type" : "string", - "description" : "The event domain (often paired with utk)." + "description" : "The event domain (often paired with utk)" }, "tokens" : { "type" : "object", "additionalProperties" : { "type" : "string" }, - "description" : "A collection of token keys and values associated with the template tokens.", + "description" : "A collection of token keys and values associated with the template tokens", "example" : { "petAge" : 3, "petName" : "Art3mis", @@ -1308,28 +1308,28 @@ }, "id" : { "type" : "string", - "description" : "Identifier for the event. This is optional, and we recommend you do not pass this in. We will create one for you if you omit this. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness." + "description" : "Identifier for the event. This is optional, and we recommend you do not pass this in. We will create one for you if you omit this. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness" }, "utk" : { "type" : "string", - "description" : "Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie." + "description" : "Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie" }, "email" : { "type" : "string", - "description" : "The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`).", + "description" : "The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`)", "example" : "art3mis-pup@petspot.com" }, "objectId" : { "type" : "string", - "description" : "The CRM object identifier. This is required for every event other than contacts (where utk or email can be used)." + "description" : "The CRM object identifier. This is required for every event other than contacts (where utk or email can be used)" }, "timestamp" : { "type" : "string", - "description" : "The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline.", + "description" : "The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline", "format" : "datetime" } }, - "description" : "The state of the timeline event.", + "description" : "The state of the timeline event", "example" : { "eventTemplateId" : "1001298", "email" : "art3mis-pup@petspot.com", @@ -1362,28 +1362,28 @@ "properties" : { "linkLabel" : { "type" : "string", - "description" : "The text displaying the link that will display the iframe.", + "description" : "The text displaying the link that will display the iframe", "example" : "View Art3mis" }, "headerLabel" : { "type" : "string", - "description" : "The label of the modal window that displays the iframe contents.", + "description" : "The label of the modal window that displays the iframe contents", "example" : "Art3mis dog" }, "width" : { "type" : "integer", - "description" : "The width of the modal window in pixels.", + "description" : "The width of the modal window in pixels", "format" : "int32", "example" : 600 }, "url" : { "type" : "string", - "description" : "The URI of the iframe contents.", + "description" : "The URI of the iframe contents", "example" : "https://my.petspot.com/pets/Art3mis" }, "height" : { "type" : "integer", - "description" : "The height of the modal window in pixels.", + "description" : "The height of the modal window in pixels", "format" : "int32", "example" : 400 } @@ -1510,11 +1510,11 @@ "properties" : { "details" : { "type" : "string", - "description" : "The details Markdown rendered as HTML.", + "description" : "The details Markdown rendered as HTML", "example" : "

Registration occurred at Jan 30, 2020, 1:13:25 PM

Questions

Who's a good kitty?: Purr...

Will you stop playing with that?: Meow!

EDIT

" } }, - "description" : "The details Markdown rendered as HTML.", + "description" : "The details Markdown rendered as HTML", "example" : { "details" : "

Registration occurred at Jan 30, 2020, 1:13:25 PM

Questions

Who's a good kitty?: Purr...

Will you stop playing with that?: Meow!

EDIT

" } @@ -1525,17 +1525,17 @@ "properties" : { "detailTemplate" : { "type" : "string", - "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details", "example" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}" }, "name" : { "type" : "string", - "description" : "The template name.", + "description" : "The template name", "example" : "PetSpot Registration" }, "tokens" : { "type" : "array", - "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.", + "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects", "example" : [ { "name" : "petName", "type" : "string", @@ -1568,16 +1568,16 @@ }, "headerTemplate" : { "type" : "string", - "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header", "example" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})" }, "objectType" : { "type" : "string", - "description" : "The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported.", + "description" : "The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported", "example" : "contacts" } }, - "description" : "State of the template definition being created.", + "description" : "State of the template definition being created", "example" : { "name" : "PetSpot Registration", "objectType" : "contacts", @@ -1617,17 +1617,17 @@ "properties" : { "detailTemplate" : { "type" : "string", - "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details", "example" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT" }, "name" : { "type" : "string", - "description" : "The template name.", + "description" : "The template name", "example" : "PetSpot Registration" }, "tokens" : { "type" : "array", - "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.", + "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects", "example" : [ { "name" : "petName", "type" : "string", @@ -1664,16 +1664,16 @@ }, "id" : { "type" : "string", - "description" : "The template ID.", + "description" : "The template ID", "example" : "1001298" }, "headerTemplate" : { "type" : "string", - "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header", "example" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})" } }, - "description" : "State of the template definition being updated.", + "description" : "State of the template definition being updated", "example" : { "id" : "1001298", "name" : "PetSpot Registration", @@ -1737,7 +1737,7 @@ }, "in" : { "type" : "string", - "description" : "The name of the field or parameter in which the error was found." + "description" : "The name of the field or parameter in which the error was found" }, "context" : { "type" : "object", @@ -1764,18 +1764,18 @@ "properties" : { "completedAt" : { "type" : "string", - "description" : "The time the request was completed.", + "description" : "The time the request was completed", "format" : "datetime", "example" : "2020-01-30T18:13:26.227+00:00" }, "requestedAt" : { "type" : "string", - "description" : "The time the request occurred.", + "description" : "The time the request occurred", "format" : "datetime" }, "startedAt" : { "type" : "string", - "description" : "The time the request began processing.", + "description" : "The time the request began processing", "format" : "datetime", "example" : "2020-01-30T18:13:24.974+00:00" }, @@ -1787,7 +1787,7 @@ }, "results" : { "type" : "array", - "description" : "Successfully created events.", + "description" : "Successfully created events", "example" : [ { "id" : "petspot:1001298:art3mis-pup@petspot.com-6edaa73d-d734-404d-908f-74774d58ac2b", "email" : "art3mis-pup@petspot.com", @@ -1851,12 +1851,12 @@ }, "status" : { "type" : "string", - "description" : "The status of the batch response. Should always be COMPLETED if processed.", + "description" : "The status of the batch response. Should always be COMPLETED if processed", "example" : "COMPLETE", "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] } }, - "description" : "The state of the batch event request.", + "description" : "The state of the batch event request", "example" : { "results" : [ { "objectType" : "contacts", @@ -1926,7 +1926,7 @@ "properties" : { "inputs" : { "type" : "array", - "description" : "A collection of timeline events we want to create.", + "description" : "A collection of timeline events we want to create", "example" : [ { "email" : "art3mis-pup@petspot.com", "tokens" : { @@ -1981,7 +1981,7 @@ } } }, - "description" : "Used to create timeline events in batches.", + "description" : "Used to create timeline events in batches", "example" : { "inputs" : [ { "eventTemplateId" : "1001298", @@ -2040,45 +2040,44 @@ "properties" : { "createdAt" : { "type" : "string", - "description" : "The date and time that the Event Template was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "description" : "The date and time that the Event Template was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020", "format" : "datetime", "nullable" : true - }, "detailTemplate" : { "type" : "string", - "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details." + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details" }, "name" : { "type" : "string", - "description" : "The template name." + "description" : "The template name" }, "tokens" : { "type" : "array", - "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.", + "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects", "items" : { "$ref" : "#/components/schemas/TimelineEventTemplateToken" } }, "id" : { "type" : "string", - "description" : "The template ID." + "description" : "The template ID" }, "headerTemplate" : { "type" : "string", - "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header." + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header" }, "objectType" : { "type" : "string", - "description" : "The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported." + "description" : "The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported" }, "updatedAt" : { "type" : "string", - "description" : "The date and time that the Event Template was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "description" : "The date and time that the Event Template was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020", "format" : "datetime" } }, - "description" : "The current state of the template definition." + "description" : "The current state of the template definition" }, "TimelineEventTemplateTokenOption" : { "required" : [ "label", "value" ], @@ -2098,13 +2097,13 @@ "properties" : { "createdAt" : { "type" : "string", - "description" : "The date and time that the Event Template Token was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "description" : "The date and time that the Event Template Token was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020", "format" : "datetime", "example" : "2020-02-12T20:58:26.000+00:00" }, "options" : { "type" : "array", - "description" : "If type is `enumeration`, we should have a list of options to choose from.", + "description" : "If type is `enumeration`, we should have a list of options to choose from", "example" : [ { "label" : "Dog", "value" : "dog" @@ -2118,34 +2117,34 @@ }, "name" : { "type" : "string", - "description" : "The name of the token referenced in the templates. This must be unique for the specific template. It may only contain alphanumeric characters, periods, dashes, or underscores (. - _).", + "description" : "The name of the token referenced in the templates. This must be unique for the specific template. It may only contain alphanumeric characters, periods, dashes, or underscores (. - _)", "example" : "petType" }, "label" : { "type" : "string", - "description" : "Used for list segmentation and reporting.", + "description" : "Used for list segmentation and reporting", "example" : "Pet Type" }, "objectPropertyName" : { "type" : "string", - "description" : "The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API.", - "example" : "customPropertyPetType", - "nullable" : true + "description" : "The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API", + "nullable" : true, + "example" : "customPropertyPetType" }, "type" : { "type" : "string", - "description" : "The data type of the token. You can currently choose from [string, number, date, enumeration].", + "description" : "The data type of the token. You can currently choose from [string, number, date, enumeration]", "example" : "enumeration", "enum" : [ "date", "enumeration", "number", "string" ] }, "updatedAt" : { "type" : "string", - "description" : "The date and time that the Event Template Token was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "description" : "The date and time that the Event Template Token was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020", "format" : "datetime", "example" : "2020-02-12T20:58:26.000+00:00" } }, - "description" : "State of the token definition.", + "description" : "State of the token definition", "example" : { "name" : "petType", "label" : "Pet Type", @@ -2168,19 +2167,18 @@ "properties" : { "eventTemplateId" : { "type" : "string", - "description" : "The event template ID.", + "description" : "The event template ID", "example" : "1001298" - }, "createdAt" : { "type" : "string", "format" : "datetime", - "nullable": true + "nullable" : true }, "extraData" : { "type" : "object", "properties" : { }, - "description" : "Additional event-specific data that can be interpreted by the template's markdown.", + "description" : "Additional event-specific data that can be interpreted by the template's markdown", "example" : { "questions" : [ { "answer" : "Bark!", @@ -2196,14 +2194,14 @@ }, "domain" : { "type" : "string", - "description" : "The event domain (often paired with utk)." + "description" : "The event domain (often paired with utk)" }, "tokens" : { "type" : "object", "additionalProperties" : { "type" : "string" }, - "description" : "A collection of token keys and values associated with the template tokens.", + "description" : "A collection of token keys and values associated with the template tokens", "example" : { "petAge" : "3", "petName" : "Art3mis", @@ -2212,36 +2210,36 @@ }, "id" : { "type" : "string", - "description" : "Identifier for the event. This should be unique to the app and event template. If you use the same ID for different CRM objects, the last to be processed will win and the first will not have a record. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness.", + "description" : "Identifier for the event. This should be unique to the app and event template. If you use the same ID for different CRM objects, the last to be processed will win and the first will not have a record. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness", "example" : "petspot:1001298:art3mis-pup@petspot.com-004-invalid" }, "utk" : { "type" : "string", - "description" : "Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie." + "description" : "Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie" }, "email" : { "type" : "string", - "description" : "The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`).", + "description" : "The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`)", "example" : "art3mis-pup@petspot.com" }, "objectId" : { "type" : "string", - "description" : "The CRM object identifier. This is required for every event other than contacts (where utk or email can be used).", + "description" : "The CRM object identifier. This is required for every event other than contacts (where utk or email can be used)", "example" : "28001" }, "timestamp" : { "type" : "string", - "description" : "The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline.", + "description" : "The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline", "format" : "datetime", "example" : "2020-01-30T18:37:15.569+00:00" }, "objectType" : { "type" : "string", - "description" : "The ObjectType associated with the EventTemplate.", + "description" : "The ObjectType associated with the EventTemplate", "example" : "contacts" } }, - "description" : "The current state of the timeline event.", + "description" : "The current state of the timeline event", "example" : { "objectType" : "contacts", "id" : "petspot:1001298:art3mis-pup@petspot.com-004-invalid", @@ -2278,7 +2276,7 @@ "properties" : { "options" : { "type" : "array", - "description" : "If type is `enumeration`, we should have a list of options to choose from.", + "description" : "If type is `enumeration`, we should have a list of options to choose from", "example" : [ { "label" : "Dog", "value" : "dog" @@ -2295,15 +2293,15 @@ }, "label" : { "type" : "string", - "description" : "Used for list segmentation and reporting.", + "description" : "Used for list segmentation and reporting", "example" : "petType edit" }, "objectPropertyName" : { "type" : "string", - "description" : "The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API." + "description" : "The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API" } }, - "description" : "State of the token definition for update requests.", + "description" : "State of the token definition for update requests", "example" : { "label" : "petType edit", "options" : [ { @@ -2420,13 +2418,14 @@ "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", - "in" : "header" + "in" : "header", + "x-ballerina-name" : "privateAppLegacy" }, "private_apps" : { "type" : "apiKey", "name" : "private-app", - "in" : "header" - + "in" : "header", + "x-ballerina-name" : "privateApp" } } }, diff --git a/docs/spec/openapi_old.json b/docs/spec/openapi_old.json new file mode 100644 index 0000000..bd50a59 --- /dev/null +++ b/docs/spec/openapi_old.json @@ -0,0 +1,2441 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Timeline", + "description" : "This feature allows an app to create and configure custom events that can show up in the timelines of certain CRM objects like contacts, companies, tickets, or deals. You'll find multiple use cases for this API in the sections below.", + "version" : "v3", + "x-hubspot-product-tier-requirements" : { + "marketing" : "FREE", + "sales" : "FREE", + "service" : "FREE", + "cms" : "STARTER" + }, + "x-hubspot-documentation-banner" : "NONE", + "x-hubspot-api-use-case" : "After setting up a new set of sign-up flows on your website, update contact timelines to indicate which flow they completed. In each event, you could also include a link to open an iframe that displays additional external data about the event.", + "x-hubspot-related-documentation" : [ { + "name" : "Timeline Events Guide", + "url" : "https://developers.hubspot.com/docs/guides/api/crm/extensions/timeline" + } ], + "x-hubspot-introduction" : "Use the timeline events API to add custom event information to CRM record timelines. You'll first need to create a public app, then an event template to display event data. " + }, + "servers" : [ { + "url" : "https://api.hubapi.com/integrators/timeline/v3" + } ], + "tags" : [ { + "name" : "Events" + }, { + "name" : "Tokens" + }, { + "name" : "Templates" + } ], + "paths" : { + "/events/{eventTemplateId}/{eventId}/detail" : { + "get" : { + "tags" : [ "Events" ], + "summary" : "Gets the detailTemplate as rendered", + "description" : "This will take the `detailTemplate` from the event template and return an object rendering the specified event. If the template references `extraData` that isn't found in the event, it will be ignored and we'll render without it.", + "operationId" : "get-/events/{eventTemplateId}/{eventId}/detail_getDetailById", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "eventId", + "in" : "path", + "description" : "The event ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/EventDetail" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.schemas.contacts.read" ] + }, { + "private_apps" : [ "crm.schemas.contacts.read" ] + }, { + "oauth2_legacy" : [ "tickets" ] + }, { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.deals.read" ] + }, { + "private_apps_legacy" : [ "timeline" ] + }, { + "oauth2" : [ "crm.objects.deals.read" ] + }, { + "private_apps_legacy" : [ "contacts" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.companies.read" ] + }, { + "oauth2" : [ "crm.objects.companies.read" ] + }, { + "private_apps" : [ "crm.schemas.companies.read" ] + }, { + "oauth2" : [ "crm.schemas.companies.read" ] + }, { + "private_apps_legacy" : [ "tickets" ] + }, { + "private_apps" : [ "crm.schemas.deals.read" ] + }, { + "oauth2" : [ "crm.schemas.deals.read" ] + }, { + "oauth2_legacy" : [ "timeline" ] + } ] + } + }, + "/events" : { + "post" : { + "tags" : [ "Events" ], + "summary" : "Create a single event", + "description" : "Creates an instance of a timeline event based on an event template. Once created, this event is immutable on the object timeline and cannot be modified. If the event template was configured to update object properties via `objectPropertyName`, this call will also attempt to updates those properties, or add them if they don't exist.", + "operationId" : "post-/events_create", + "parameters" : [ ], + "requestBody" : { + "description" : "The timeline event definition.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEvent" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventResponse" + }, + "example" : { + "objectType" : "contacts", + "id" : "petspot:1001298:art3mis-pup@petspot.com-004", + "eventTemplateId" : "1001298", + "email" : "art3mis-pup@petspot.com", + "objectId" : "28001", + "timestamp" : "2020-01-30T17:42:10.276Z", + "tokens" : { + "petName" : "Art3mis", + "petColor" : "black", + "petAge" : "3" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good girl?", + "answer" : "Bark!" + }, { + "question" : "Do you wanna go on a walk?", + "answer" : "Woof!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog", + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400 + } + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2_legacy" : [ "tickets" ] + }, { + "oauth2" : [ "crm.schemas.deals.write" ] + }, { + "private_apps_legacy" : [ "timeline" ] + }, { + "oauth2" : [ "crm.schemas.contacts.write" ] + }, { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + }, { + "oauth2" : [ "crm.schemas.companies.write" ] + }, { + "private_apps_legacy" : [ "contacts" ] + }, { + "private_apps" : [ "crm.schemas.contacts.write" ] + }, { + "private_apps" : [ "crm.schemas.companies.write" ] + }, { + "private_apps" : [ "crm.objects.deals.write" ] + }, { + "oauth2" : [ "crm.objects.deals.write" ] + }, { + "private_apps_legacy" : [ "tickets" ] + }, { + "oauth2_legacy" : [ "timeline" ] + }, { + "private_apps" : [ "crm.objects.companies.write" ] + }, { + "private_apps" : [ "crm.schemas.deals.write" ] + }, { + "oauth2" : [ "crm.objects.companies.write" ] + } ] + } + }, + "/{appId}/event-templates/{eventTemplateId}/tokens/{tokenName}" : { + "put" : { + "tags" : [ "Tokens" ], + "summary" : "Updates an existing token on an event template", + "description" : "This will update the existing token on an event template. Name and type can't be changed on existing tokens.", + "operationId" : "put-/{appId}/event-templates/{eventTemplateId}/tokens/{tokenName}_update", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "tokenName", + "in" : "path", + "description" : "The token name.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "requestBody" : { + "description" : "The updated token definition.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplateTokenUpdateRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplateToken" + }, + "example" : { + "name" : "petType", + "type" : "enumeration", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Type", + "options" : [ { + "value" : "dog", + "label" : "Dog" + }, { + "value" : "cat", + "label" : "Cat" + }, { + "value" : "bird", + "label" : "Bird" + } ] + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + }, + "delete" : { + "tags" : [ "Tokens" ], + "summary" : "Removes a token from the event template", + "description" : "This will remove the token from an existing template. Existing events and CRM objects will still retain the token and its mapped object properties, but new ones will not.\n\nThe timeline will still display this property for older CRM objects if it's still referenced in the template `Markdown`. New events will not.\n\nAny lists or reports referencing deleted tokens will no longer return new contacts, but old ones will still exist in the lists.", + "operationId" : "delete-/{appId}/event-templates/{eventTemplateId}/tokens/{tokenName}_archive", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "tokenName", + "in" : "path", + "description" : "The token name.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + } + }, + "/events/{eventTemplateId}/{eventId}" : { + "get" : { + "tags" : [ "Events" ], + "summary" : "Gets the event", + "description" : "This returns the previously created event. It contains all existing info for the event, but not necessarily the CRM object.", + "operationId" : "get-/events/{eventTemplateId}/{eventId}_getById", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "eventId", + "in" : "path", + "description" : "The event ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventResponse" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.schemas.contacts.read" ] + }, { + "private_apps" : [ "crm.schemas.contacts.read" ] + }, { + "oauth2_legacy" : [ "tickets" ] + }, { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.deals.read" ] + }, { + "private_apps_legacy" : [ "timeline" ] + }, { + "oauth2" : [ "crm.objects.deals.read" ] + }, { + "private_apps_legacy" : [ "contacts" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.companies.read" ] + }, { + "oauth2" : [ "crm.objects.companies.read" ] + }, { + "private_apps" : [ "crm.schemas.companies.read" ] + }, { + "oauth2" : [ "crm.schemas.companies.read" ] + }, { + "private_apps_legacy" : [ "tickets" ] + }, { + "private_apps" : [ "crm.schemas.deals.read" ] + }, { + "oauth2" : [ "crm.schemas.deals.read" ] + }, { + "oauth2_legacy" : [ "timeline" ] + } ] + } + }, + "/events/batch/create" : { + "post" : { + "tags" : [ "Events" ], + "summary" : "Creates multiple events", + "description" : "Creates multiple instances of timeline events based on an event template. Once created, these event are immutable on the object timeline and cannot be modified. If the event template was configured to update object properties via `objectPropertyName`, this call will also attempt to updates those properties, or add them if they don't exist.", + "operationId" : "post-/events/batch/create_createBatch", + "parameters" : [ ], + "requestBody" : { + "description" : "The timeline event definition.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputTimelineEvent" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseTimelineEventResponse" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseTimelineEventResponseWithErrors" + } + } + } + }, + "200" : { + "description" : "", + "content" : { + "application/json" : { + "example" : { + "results" : [ { + "objectType" : "contacts", + "id" : "petspot:1001298:art3mis-pup@petspot.com-b9d73144-41bb-46c8-9a3f-f0849c1ad7e6", + "eventTemplateId" : "1001298", + "email" : "art3mis-pup@petspot.com", + "objectId" : "28001", + "timestamp" : "2020-01-30T18:10:17.057Z", + "tokens" : { + "petName" : "Art3mis", + "petColor" : "black", + "petAge" : "3" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good girl?", + "answer" : "Bark!" + }, { + "question" : "Do you wanna go on a walk?", + "answer" : "Woof!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog", + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400 + } + }, { + "objectType" : "contacts", + "id" : "petspot:1001298:pocket-tiger@petspot.com-c09a620f-60a4-46a8-be9f-fe0609fc3f0e", + "eventTemplateId" : "1001298", + "email" : "pocket-tiger@petspot.com", + "objectId" : "28651", + "timestamp" : "2020-01-30T18:10:17.057Z", + "tokens" : { + "petName" : "Pocket", + "petColor" : "yellow", + "petAge" : "3" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good kitty?", + "answer" : "Purr..." + }, { + "question" : "Will you stop playing with that?", + "answer" : "Meow!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Pocket", + "headerLabel" : "Pocket Tiger", + "url" : "https://my.petspot.com/pets/Pocket", + "width" : 600, + "height" : 400 + } + } ], + "status" : "COMPLETE", + "startedAt" : "2020-01-30T18:10:16.478734Z", + "completedAt" : "2020-01-30T18:10:17.793206Z" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2_legacy" : [ "tickets" ] + }, { + "oauth2" : [ "crm.schemas.deals.write" ] + }, { + "private_apps_legacy" : [ "timeline" ] + }, { + "oauth2" : [ "crm.schemas.contacts.write" ] + }, { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + }, { + "oauth2" : [ "crm.schemas.companies.write" ] + }, { + "private_apps_legacy" : [ "contacts" ] + }, { + "private_apps" : [ "crm.schemas.contacts.write" ] + }, { + "private_apps" : [ "crm.schemas.companies.write" ] + }, { + "private_apps" : [ "crm.objects.deals.write" ] + }, { + "oauth2" : [ "crm.objects.deals.write" ] + }, { + "private_apps_legacy" : [ "tickets" ] + }, { + "oauth2_legacy" : [ "timeline" ] + }, { + "private_apps" : [ "crm.objects.companies.write" ] + }, { + "private_apps" : [ "crm.schemas.deals.write" ] + }, { + "oauth2" : [ "crm.objects.companies.write" ] + } ] + } + }, + "/events/{eventTemplateId}/{eventId}/render" : { + "get" : { + "tags" : [ "Events" ], + "summary" : "Renders the header or detail as HTML", + "description" : "This will take either the `headerTemplate` or `detailTemplate` from the event template and render for the specified event as HTML. If the template references `extraData` that isn't found in the event, it will be ignored and we'll render without it.", + "operationId" : "get-/events/{eventTemplateId}/{eventId}/render_getRenderById", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "eventId", + "in" : "path", + "description" : "The event ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "detail", + "in" : "query", + "description" : "Set to 'true', we want to render the `detailTemplate` instead of the `headerTemplate`.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "text/html" : { + "schema" : { + "type" : "string" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.schemas.contacts.read" ] + }, { + "private_apps" : [ "crm.schemas.contacts.read" ] + }, { + "oauth2_legacy" : [ "tickets" ] + }, { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.deals.read" ] + }, { + "private_apps_legacy" : [ "timeline" ] + }, { + "oauth2" : [ "crm.objects.deals.read" ] + }, { + "private_apps_legacy" : [ "contacts" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.companies.read" ] + }, { + "oauth2" : [ "crm.objects.companies.read" ] + }, { + "private_apps" : [ "crm.schemas.companies.read" ] + }, { + "oauth2" : [ "crm.schemas.companies.read" ] + }, { + "private_apps_legacy" : [ "tickets" ] + }, { + "private_apps" : [ "crm.schemas.deals.read" ] + }, { + "oauth2" : [ "crm.schemas.deals.read" ] + }, { + "oauth2_legacy" : [ "timeline" ] + } ] + } + }, + "/{appId}/event-templates" : { + "get" : { + "tags" : [ "Templates" ], + "summary" : "List all event templates for your app", + "description" : "Use this to list all event templates owned by your app.", + "operationId" : "get-/{appId}/event-templates_getAll", + "parameters" : [ { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseTimelineEventTemplateNoPaging" + }, + "example" : { + "results" : [ { + "id" : "15758", + "objectType" : "companies", + "name" : "company test", + "headerTemplate" : "abcde", + "tokens" : [ ] + }, { + "id" : "1000151", + "objectType" : "deals", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "name" : "deal test", + "headerTemplate" : "deal", + "detailTemplate" : "Deal occurred at {{#formatDate timestamp}}{{/formatDate}}\n\ntest", + "tokens" : [ { + "name" : "test", + "type" : "string", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "test", + "objectPropertyName" : "test", + "options" : [ ] + } ] + }, { + "id" : "1001298", + "objectType" : "contacts", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "name" : "PetSpot Registration", + "headerTemplate" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})", + "detailTemplate" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT", + "tokens" : [ { + "name" : "petAge", + "type" : "number", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Age", + "options" : [ ] + }, { + "name" : "petColor", + "type" : "enumeration", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Color", + "options" : [ { + "value" : "black", + "label" : "Black" + }, { + "value" : "brown", + "label" : "Brown" + }, { + "value" : "other", + "label" : "Other" + }, { + "value" : "white", + "label" : "White" + }, { + "value" : "yellow", + "label" : "Yellow" + } ] + }, { + "name" : "petName", + "type" : "string", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Name", + "options" : [ ] + } ] + } ] + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + }, + "post" : { + "tags" : [ "Templates" ], + "summary" : "Create an event template for the app", + "description" : "Event templates define the general structure for a custom timeline event. This includes formatted copy for its heading and details, as well as any custom property definitions. The event could be something like viewing a video, registering for a webinar, or filling out a survey. A single app can define multiple event templates.\n\nEvent templates will be created for contacts by default, but they can be created for companies, tickets, and deals as well.\n\nEach event template contains its own set of tokens and `Markdown` templates. These tokens can be associated with any CRM object properties via the `objectPropertyName` field to fully build out CRM objects.\n\nYou must create an event template before you can create events.", + "operationId" : "post-/{appId}/event-templates_create", + "parameters" : [ { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "requestBody" : { + "description" : "The new event template definition.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplateCreateRequest" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplate" + }, + "example" : { + "id" : "1001298", + "objectType" : "contacts", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "name" : "PetSpot Registration", + "headerTemplate" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})", + "detailTemplate" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}", + "tokens" : [ { + "name" : "petName", + "type" : "string", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Name", + "options" : [ ] + }, { + "name" : "petAge", + "type" : "number", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Age", + "options" : [ ] + }, { + "name" : "petColor", + "type" : "enumeration", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Color", + "options" : [ { + "value" : "white", + "label" : "White" + }, { + "value" : "black", + "label" : "Black" + }, { + "value" : "brown", + "label" : "Brown" + }, { + "value" : "other", + "label" : "Other" + } ] + } ] + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + } + }, + "/{appId}/event-templates/{eventTemplateId}" : { + "get" : { + "tags" : [ "Templates" ], + "summary" : "Gets a specific event template for your app", + "description" : "View the current state of a specific template and its tokens.", + "operationId" : "get-/{appId}/event-templates/{eventTemplateId}_getById", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplate" + }, + "example" : { + "id" : "1001298", + "objectType" : "contacts", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "name" : "PetSpot Registration", + "headerTemplate" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})", + "detailTemplate" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT", + "tokens" : [ { + "name" : "petAge", + "type" : "number", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Age", + "options" : [ ] + }, { + "name" : "petColor", + "type" : "enumeration", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Color", + "options" : [ { + "value" : "black", + "label" : "Black" + }, { + "value" : "brown", + "label" : "Brown" + }, { + "value" : "other", + "label" : "Other" + }, { + "value" : "white", + "label" : "White" + }, { + "value" : "yellow", + "label" : "Yellow" + } ] + }, { + "name" : "petName", + "type" : "string", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Name", + "options" : [ ] + } ] + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + }, + "put" : { + "tags" : [ "Templates" ], + "summary" : "Update an existing event template", + "description" : "Updates an existing template and its tokens. This is primarily used to update the headerTemplate/detailTemplate, and those changes will take effect for existing events.\n\nYou can also update or replace all the tokens in the template here instead of doing individual API calls on the `/tokens` endpoint.", + "operationId" : "put-/{appId}/event-templates/{eventTemplateId}_update", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "requestBody" : { + "description" : "The updated event template definition.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplateUpdateRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplate" + }, + "example" : { + "id" : "1001298", + "objectType" : "contacts", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "name" : "PetSpot Registration", + "headerTemplate" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})", + "detailTemplate" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT", + "tokens" : [ { + "name" : "petAge", + "type" : "number", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Age", + "options" : [ ] + }, { + "name" : "petColor", + "type" : "enumeration", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Color", + "options" : [ { + "value" : "white", + "label" : "White" + }, { + "value" : "black", + "label" : "Black" + }, { + "value" : "brown", + "label" : "Brown" + }, { + "value" : "yellow", + "label" : "Yellow" + }, { + "value" : "other", + "label" : "Other" + } ] + }, { + "name" : "petName", + "type" : "string", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Name", + "objectPropertyName" : "firstname", + "options" : [ ] + } ] + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + }, + "delete" : { + "tags" : [ "Templates" ], + "summary" : "Deletes an event template for the app", + "description" : "This will delete the event template. All associated events will be removed from search results and the timeline UI.\n\nThis action can't be undone, so it's highly recommended that you stop using any associated events before deleting a template.", + "operationId" : "delete-/{appId}/event-templates/{eventTemplateId}_archive", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + } + }, + "/{appId}/event-templates/{eventTemplateId}/tokens" : { + "post" : { + "tags" : [ "Tokens" ], + "summary" : "Adds a token to an existing event template", + "description" : "Once you've defined an event template, it's likely that you'll want to define tokens for it as well. You can do this on the event template itself or update individual tokens here.\n\nEvent type tokens allow you to attach custom data to events displayed in a timeline or used for list segmentation.\n\nYou can also use `objectPropertyName` to associate any CRM object properties. This will allow you to fully build out CRM objects.\n\nToken names should be unique across the template.", + "operationId" : "post-/{appId}/event-templates/{eventTemplateId}/tokens_create", + "parameters" : [ { + "name" : "eventTemplateId", + "in" : "path", + "description" : "The event template ID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "appId", + "in" : "path", + "description" : "The ID of the target app.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "requestBody" : { + "description" : "The new token definition.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplateToken" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TimelineEventTemplateToken" + }, + "example" : { + "name" : "petType", + "type" : "enumeration", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "label" : "Pet Type", + "options" : [ { + "value" : "dog", + "label" : "Dog" + }, { + "value" : "cat", + "label" : "Cat" + } ] + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "developer_hapikey" : [ ] + } ] + } + } + }, + "components" : { + "schemas" : { + "TimelineEvent" : { + "required" : [ "eventTemplateId", "tokens" ], + "type" : "object", + "properties" : { + "eventTemplateId" : { + "type" : "string", + "description" : "The event template ID.", + "example" : "1001298" + }, + "extraData" : { + "type" : "object", + "properties" : { }, + "description" : "Additional event-specific data that can be interpreted by the template's markdown.", + "example" : { + "questions" : [ { + "answer" : "Bark!", + "question" : "Who's a good girl?" + }, { + "answer" : "Woof!", + "question" : "Do you wanna go on a walk?" + } ] + } + }, + "timelineIFrame" : { + "$ref" : "#/components/schemas/TimelineEventIFrame" + }, + "domain" : { + "type" : "string", + "description" : "The event domain (often paired with utk)." + }, + "tokens" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + }, + "description" : "A collection of token keys and values associated with the template tokens.", + "example" : { + "petAge" : 3, + "petName" : "Art3mis", + "petColor" : "black" + } + }, + "id" : { + "type" : "string", + "description" : "Identifier for the event. This is optional, and we recommend you do not pass this in. We will create one for you if you omit this. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness." + }, + "utk" : { + "type" : "string", + "description" : "Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie." + }, + "email" : { + "type" : "string", + "description" : "The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`).", + "example" : "art3mis-pup@petspot.com" + }, + "objectId" : { + "type" : "string", + "description" : "The CRM object identifier. This is required for every event other than contacts (where utk or email can be used)." + }, + "timestamp" : { + "type" : "string", + "description" : "The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline.", + "format" : "datetime" + } + }, + "description" : "The state of the timeline event.", + "example" : { + "eventTemplateId" : "1001298", + "email" : "art3mis-pup@petspot.com", + "tokens" : { + "petName" : "Art3mis", + "petAge" : 3, + "petColor" : "black" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good girl?", + "answer" : "Bark!" + }, { + "question" : "Do you wanna go on a walk?", + "answer" : "Woof!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog", + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400 + } + } + }, + "TimelineEventIFrame" : { + "required" : [ "headerLabel", "height", "linkLabel", "url", "width" ], + "type" : "object", + "properties" : { + "linkLabel" : { + "type" : "string", + "description" : "The text displaying the link that will display the iframe.", + "example" : "View Art3mis" + }, + "headerLabel" : { + "type" : "string", + "description" : "The label of the modal window that displays the iframe contents.", + "example" : "Art3mis dog" + }, + "width" : { + "type" : "integer", + "description" : "The width of the modal window in pixels.", + "format" : "int32", + "example" : 600 + }, + "url" : { + "type" : "string", + "description" : "The URI of the iframe contents.", + "example" : "https://my.petspot.com/pets/Art3mis" + }, + "height" : { + "type" : "integer", + "description" : "The height of the modal window in pixels.", + "format" : "int32", + "example" : 400 + } + }, + "example" : { + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog", + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400 + } + }, + "StandardError" : { + "required" : [ "category", "context", "errors", "links", "message", "status" ], + "type" : "object", + "properties" : { + "subCategory" : { + "type" : "object", + "properties" : { } + }, + "context" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "id" : { + "type" : "string" + }, + "category" : { + "type" : "string" + }, + "message" : { + "type" : "string" + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ErrorDetail" + } + }, + "status" : { + "type" : "string" + } + } + }, + "Error" : { + "required" : [ "category", "correlationId", "message" ], + "type" : "object", + "properties" : { + "subCategory" : { + "type" : "string", + "description" : "A specific category that contains more specific detail about the error" + }, + "context" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "description" : "Context about the error condition", + "example" : { + "missingScopes" : [ "scope1", "scope2" ], + "invalidPropertyName" : [ "propertyValue" ] + } + }, + "correlationId" : { + "type" : "string", + "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", + "format" : "uuid", + "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + }, + "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps", + "example" : { + "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" + } + }, + "message" : { + "type" : "string", + "description" : "A human readable message describing the error along with remediation steps where appropriate", + "example" : "Invalid input (details will vary based on the error)" + }, + "category" : { + "type" : "string", + "description" : "The error category", + "example" : "VALIDATION_ERROR" + }, + "errors" : { + "type" : "array", + "description" : "further information about the error", + "items" : { + "$ref" : "#/components/schemas/ErrorDetail" + } + } + }, + "example" : { + "message" : "Invalid input (details will vary based on the error)", + "correlationId" : "aeb5f871-7f07-4993-9211-075dc63e7cbf", + "category" : "VALIDATION_ERROR", + "links" : { + "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" + } + } + }, + "EventDetail" : { + "required" : [ "details" ], + "type" : "object", + "properties" : { + "details" : { + "type" : "string", + "description" : "The details Markdown rendered as HTML.", + "example" : "

Registration occurred at Jan 30, 2020, 1:13:25 PM

Questions

Who's a good kitty?: Purr...

Will you stop playing with that?: Meow!

EDIT

" + } + }, + "description" : "The details Markdown rendered as HTML.", + "example" : { + "details" : "

Registration occurred at Jan 30, 2020, 1:13:25 PM

Questions

Who's a good kitty?: Purr...

Will you stop playing with that?: Meow!

EDIT

" + } + }, + "TimelineEventTemplateCreateRequest" : { + "required" : [ "name", "objectType", "tokens" ], + "type" : "object", + "properties" : { + "detailTemplate" : { + "type" : "string", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.", + "example" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}" + }, + "name" : { + "type" : "string", + "description" : "The template name.", + "example" : "PetSpot Registration" + }, + "tokens" : { + "type" : "array", + "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.", + "example" : [ { + "name" : "petName", + "type" : "string", + "label" : "Pet Name" + }, { + "name" : "petAge", + "type" : "number", + "label" : "Pet Age" + }, { + "name" : "petColor", + "type" : "enumeration", + "label" : "Pet Color", + "options" : [ { + "label" : "White", + "value" : "white" + }, { + "label" : "Black", + "value" : "black" + }, { + "label" : "Brown", + "value" : "brown" + }, { + "label" : "Other", + "value" : "other" + } ] + } ], + "items" : { + "$ref" : "#/components/schemas/TimelineEventTemplateToken" + } + }, + "headerTemplate" : { + "type" : "string", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.", + "example" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})" + }, + "objectType" : { + "type" : "string", + "description" : "The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported.", + "example" : "contacts" + } + }, + "description" : "State of the template definition being created.", + "example" : { + "name" : "PetSpot Registration", + "objectType" : "contacts", + "headerTemplate" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})", + "detailTemplate" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}", + "tokens" : [ { + "name" : "petName", + "label" : "Pet Name", + "type" : "string" + }, { + "name" : "petAge", + "label" : "Pet Age", + "type" : "number" + }, { + "name" : "petColor", + "label" : "Pet Color", + "type" : "enumeration", + "options" : [ { + "value" : "white", + "label" : "White" + }, { + "value" : "black", + "label" : "Black" + }, { + "value" : "brown", + "label" : "Brown" + }, { + "value" : "other", + "label" : "Other" + } ] + } ] + } + }, + "TimelineEventTemplateUpdateRequest" : { + "required" : [ "id", "name", "tokens" ], + "type" : "object", + "properties" : { + "detailTemplate" : { + "type" : "string", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.", + "example" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT" + }, + "name" : { + "type" : "string", + "description" : "The template name.", + "example" : "PetSpot Registration" + }, + "tokens" : { + "type" : "array", + "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.", + "example" : [ { + "name" : "petName", + "type" : "string", + "label" : "Pet Name", + "objectPropertyName" : "firstname" + }, { + "name" : "petAge", + "type" : "number", + "label" : "Pet Age" + }, { + "name" : "petColor", + "type" : "enumeration", + "label" : "Pet Color", + "options" : [ { + "label" : "White", + "value" : "white" + }, { + "label" : "Black", + "value" : "black" + }, { + "label" : "Brown", + "value" : "brown" + }, { + "label" : "Yellow", + "value" : "yellow" + }, { + "label" : "Other", + "value" : "other" + } ] + } ], + "items" : { + "$ref" : "#/components/schemas/TimelineEventTemplateToken" + } + }, + "id" : { + "type" : "string", + "description" : "The template ID.", + "example" : "1001298" + }, + "headerTemplate" : { + "type" : "string", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.", + "example" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})" + } + }, + "description" : "State of the template definition being updated.", + "example" : { + "id" : "1001298", + "name" : "PetSpot Registration", + "headerTemplate" : "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})", + "detailTemplate" : "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT", + "tokens" : [ { + "name" : "petName", + "label" : "Pet Name", + "type" : "string", + "objectPropertyName" : "firstname" + }, { + "name" : "petAge", + "label" : "Pet Age", + "type" : "number" + }, { + "name" : "petColor", + "label" : "Pet Color", + "type" : "enumeration", + "options" : [ { + "value" : "white", + "label" : "White" + }, { + "value" : "black", + "label" : "Black" + }, { + "value" : "brown", + "label" : "Brown" + }, { + "value" : "yellow", + "label" : "Yellow" + }, { + "value" : "other", + "label" : "Other" + } ] + } ] + } + }, + "CollectionResponseTimelineEventTemplateNoPaging" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TimelineEventTemplate" + } + } + } + }, + "ErrorDetail" : { + "required" : [ "message" ], + "type" : "object", + "properties" : { + "subCategory" : { + "type" : "string", + "description" : "A specific category that contains more specific detail about the error" + }, + "code" : { + "type" : "string", + "description" : "The status code associated with the error detail" + }, + "in" : { + "type" : "string", + "description" : "The name of the field or parameter in which the error was found." + }, + "context" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "description" : "Context about the error condition", + "example" : { + "missingScopes" : [ "scope1", "scope2" ] + } + }, + "message" : { + "type" : "string", + "description" : "A human readable message describing the error along with remediation steps where appropriate" + } + } + }, + "BatchResponseTimelineEventResponse" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "description" : "The time the request was completed.", + "format" : "datetime", + "example" : "2020-01-30T18:13:26.227+00:00" + }, + "requestedAt" : { + "type" : "string", + "description" : "The time the request occurred.", + "format" : "datetime" + }, + "startedAt" : { + "type" : "string", + "description" : "The time the request began processing.", + "format" : "datetime", + "example" : "2020-01-30T18:13:24.974+00:00" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "description" : "Successfully created events.", + "example" : [ { + "id" : "petspot:1001298:art3mis-pup@petspot.com-6edaa73d-d734-404d-908f-74774d58ac2b", + "email" : "art3mis-pup@petspot.com", + "tokens" : { + "petAge" : "3", + "petName" : "Art3mis", + "petColor" : "black" + }, + "objectId" : "28001", + "extraData" : { + "questions" : [ { + "answer" : "Bark!", + "question" : "Who's a good girl?" + }, { + "answer" : "Woof!", + "question" : "Do you wanna go on a walk?" + } ] + }, + "timestamp" : "2020-01-30T18:13:25.665Z", + "objectType" : "contacts", + "timelineIFrame" : { + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400, + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog" + }, + "eventTemplateId" : "1001298" + }, { + "id" : "petspot:1001298:pocket-tiger@petspot.com-0df6277b-6eba-4d1f-8c19-1994cbfaa4ca", + "email" : "pocket-tiger@petspot.com", + "tokens" : { + "petAge" : "3", + "petName" : "Pocket", + "petColor" : "yellow" + }, + "objectId" : "28651", + "extraData" : { + "questions" : [ { + "answer" : "Purr...", + "question" : "Who's a good kitty?" + }, { + "answer" : "Meow!", + "question" : "Will you stop playing with that?" + } ] + }, + "timestamp" : "2020-01-30T18:13:25.665Z", + "objectType" : "contacts", + "timelineIFrame" : { + "url" : "https://my.petspot.com/pets/Pocket", + "width" : 600, + "height" : 400, + "linkLabel" : "View Pocket", + "headerLabel" : "Pocket Tiger" + }, + "eventTemplateId" : "1001298" + } ], + "items" : { + "$ref" : "#/components/schemas/TimelineEventResponse" + } + }, + "status" : { + "type" : "string", + "description" : "The status of the batch response. Should always be COMPLETED if processed.", + "example" : "COMPLETE", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + }, + "description" : "The state of the batch event request.", + "example" : { + "results" : [ { + "objectType" : "contacts", + "id" : "petspot:1001298:art3mis-pup@petspot.com-6edaa73d-d734-404d-908f-74774d58ac2b", + "eventTemplateId" : "1001298", + "email" : "art3mis-pup@petspot.com", + "objectId" : "28001", + "timestamp" : "2020-01-30T18:13:25.665Z", + "tokens" : { + "petName" : "Art3mis", + "petColor" : "black", + "petAge" : "3" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good girl?", + "answer" : "Bark!" + }, { + "question" : "Do you wanna go on a walk?", + "answer" : "Woof!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog", + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400 + } + }, { + "objectType" : "contacts", + "id" : "petspot:1001298:pocket-tiger@petspot.com-0df6277b-6eba-4d1f-8c19-1994cbfaa4ca", + "eventTemplateId" : "1001298", + "email" : "pocket-tiger@petspot.com", + "objectId" : "28651", + "timestamp" : "2020-01-30T18:13:25.665Z", + "tokens" : { + "petName" : "Pocket", + "petColor" : "yellow", + "petAge" : "3" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good kitty?", + "answer" : "Purr..." + }, { + "question" : "Will you stop playing with that?", + "answer" : "Meow!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Pocket", + "headerLabel" : "Pocket Tiger", + "url" : "https://my.petspot.com/pets/Pocket", + "width" : 600, + "height" : 400 + } + } ], + "status" : "COMPLETE", + "startedAt" : "2020-01-30T18:13:24.974023Z", + "completedAt" : "2020-01-30T18:13:26.227559Z" + } + }, + "BatchInputTimelineEvent" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "description" : "A collection of timeline events we want to create.", + "example" : [ { + "email" : "art3mis-pup@petspot.com", + "tokens" : { + "petAge" : 3, + "petName" : "Art3mis", + "petColor" : "black" + }, + "extraData" : { + "questions" : [ { + "answer" : "Bark!", + "question" : "Who's a good girl?" + }, { + "answer" : "Woof!", + "question" : "Do you wanna go on a walk?" + } ] + }, + "timelineIFrame" : { + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400, + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog" + }, + "eventTemplateId" : "1001298" + }, { + "email" : "pocket-tiger@petspot.com", + "tokens" : { + "petAge" : 3, + "petName" : "Pocket", + "petColor" : "yellow" + }, + "extraData" : { + "questions" : [ { + "answer" : "Purr...", + "question" : "Who's a good kitty?" + }, { + "answer" : "Meow!", + "question" : "Will you stop playing with that?" + } ] + }, + "timelineIFrame" : { + "url" : "https://my.petspot.com/pets/Pocket", + "width" : 600, + "height" : 400, + "linkLabel" : "View Pocket", + "headerLabel" : "Pocket Tiger" + }, + "eventTemplateId" : "1001298" + } ], + "items" : { + "$ref" : "#/components/schemas/TimelineEvent" + } + } + }, + "description" : "Used to create timeline events in batches.", + "example" : { + "inputs" : [ { + "eventTemplateId" : "1001298", + "email" : "art3mis-pup@petspot.com", + "tokens" : { + "petName" : "Art3mis", + "petAge" : 3, + "petColor" : "black" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good girl?", + "answer" : "Bark!" + }, { + "question" : "Do you wanna go on a walk?", + "answer" : "Woof!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog", + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400 + } + }, { + "eventTemplateId" : "1001298", + "email" : "pocket-tiger@petspot.com", + "tokens" : { + "petName" : "Pocket", + "petAge" : 3, + "petColor" : "yellow" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good kitty?", + "answer" : "Purr..." + }, { + "question" : "Will you stop playing with that?", + "answer" : "Meow!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Pocket", + "headerLabel" : "Pocket Tiger", + "url" : "https://my.petspot.com/pets/Pocket", + "width" : 600, + "height" : 400 + } + } ] + } + }, + "TimelineEventTemplate" : { + "required" : [ "id", "name", "objectType", "tokens" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "description" : "The date and time that the Event Template was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "format" : "datetime", + "nullable" : true + + }, + "detailTemplate" : { + "type" : "string", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details." + }, + "name" : { + "type" : "string", + "description" : "The template name." + }, + "tokens" : { + "type" : "array", + "description" : "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.", + "items" : { + "$ref" : "#/components/schemas/TimelineEventTemplateToken" + } + }, + "id" : { + "type" : "string", + "description" : "The template ID." + }, + "headerTemplate" : { + "type" : "string", + "description" : "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header." + }, + "objectType" : { + "type" : "string", + "description" : "The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported." + }, + "updatedAt" : { + "type" : "string", + "description" : "The date and time that the Event Template was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "format" : "datetime" + } + }, + "description" : "The current state of the template definition." + }, + "TimelineEventTemplateTokenOption" : { + "required" : [ "label", "value" ], + "type" : "object", + "properties" : { + "label" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + } + }, + "TimelineEventTemplateToken" : { + "required" : [ "label", "name", "type" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "description" : "The date and time that the Event Template Token was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "format" : "datetime", + "example" : "2020-02-12T20:58:26.000+00:00" + }, + "options" : { + "type" : "array", + "description" : "If type is `enumeration`, we should have a list of options to choose from.", + "example" : [ { + "label" : "Dog", + "value" : "dog" + }, { + "label" : "Cat", + "value" : "cat" + } ], + "items" : { + "$ref" : "#/components/schemas/TimelineEventTemplateTokenOption" + } + }, + "name" : { + "type" : "string", + "description" : "The name of the token referenced in the templates. This must be unique for the specific template. It may only contain alphanumeric characters, periods, dashes, or underscores (. - _).", + "example" : "petType" + }, + "label" : { + "type" : "string", + "description" : "Used for list segmentation and reporting.", + "example" : "Pet Type" + }, + "objectPropertyName" : { + "type" : "string", + "description" : "The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API.", + "example" : "customPropertyPetType", + "nullable" : true + }, + "type" : { + "type" : "string", + "description" : "The data type of the token. You can currently choose from [string, number, date, enumeration].", + "example" : "enumeration", + "enum" : [ "date", "enumeration", "number", "string" ] + }, + "updatedAt" : { + "type" : "string", + "description" : "The date and time that the Event Template Token was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.", + "format" : "datetime", + "example" : "2020-02-12T20:58:26.000+00:00" + } + }, + "description" : "State of the token definition.", + "example" : { + "name" : "petType", + "label" : "Pet Type", + "type" : "enumeration", + "createdAt" : "2020-02-12T20:58:26Z", + "updatedAt" : "2020-02-12T20:58:26Z", + "objectPropertyName" : "customPropertyPetType", + "options" : [ { + "value" : "dog", + "label" : "Dog" + }, { + "value" : "cat", + "label" : "Cat" + } ] + } + }, + "TimelineEventResponse" : { + "required" : [ "eventTemplateId", "id", "objectType", "tokens" ], + "type" : "object", + "properties" : { + "eventTemplateId" : { + "type" : "string", + "description" : "The event template ID.", + "example" : "1001298" + + }, + "createdAt" : { + "type" : "string", + "format" : "datetime", + "nullable": true + }, + "extraData" : { + "type" : "object", + "properties" : { }, + "description" : "Additional event-specific data that can be interpreted by the template's markdown.", + "example" : { + "questions" : [ { + "answer" : "Bark!", + "question" : "Who's a good girl?" + }, { + "answer" : "Woof!", + "question" : "Do you wanna go on a walk?" + } ] + } + }, + "timelineIFrame" : { + "$ref" : "#/components/schemas/TimelineEventIFrame" + }, + "domain" : { + "type" : "string", + "description" : "The event domain (often paired with utk)." + }, + "tokens" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + }, + "description" : "A collection of token keys and values associated with the template tokens.", + "example" : { + "petAge" : "3", + "petName" : "Art3mis", + "petColor" : "black" + } + }, + "id" : { + "type" : "string", + "description" : "Identifier for the event. This should be unique to the app and event template. If you use the same ID for different CRM objects, the last to be processed will win and the first will not have a record. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness.", + "example" : "petspot:1001298:art3mis-pup@petspot.com-004-invalid" + }, + "utk" : { + "type" : "string", + "description" : "Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie." + }, + "email" : { + "type" : "string", + "description" : "The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`).", + "example" : "art3mis-pup@petspot.com" + }, + "objectId" : { + "type" : "string", + "description" : "The CRM object identifier. This is required for every event other than contacts (where utk or email can be used).", + "example" : "28001" + }, + "timestamp" : { + "type" : "string", + "description" : "The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline.", + "format" : "datetime", + "example" : "2020-01-30T18:37:15.569+00:00" + }, + "objectType" : { + "type" : "string", + "description" : "The ObjectType associated with the EventTemplate.", + "example" : "contacts" + } + }, + "description" : "The current state of the timeline event.", + "example" : { + "objectType" : "contacts", + "id" : "petspot:1001298:art3mis-pup@petspot.com-004-invalid", + "eventTemplateId" : "1001298", + "email" : "art3mis-pup@petspot.com", + "objectId" : "28001", + "timestamp" : "2020-01-30T18:37:15.569Z", + "tokens" : { + "petName" : "Art3mis", + "petColor" : "black", + "petAge" : "3" + }, + "extraData" : { + "questions" : [ { + "question" : "Who's a good girl?", + "answer" : "Bark!" + }, { + "question" : "Do you wanna go on a walk?", + "answer" : "Woof!" + } ] + }, + "timelineIFrame" : { + "linkLabel" : "View Art3mis", + "headerLabel" : "Art3mis dog", + "url" : "https://my.petspot.com/pets/Art3mis", + "width" : 600, + "height" : 400 + } + } + }, + "TimelineEventTemplateTokenUpdateRequest" : { + "required" : [ "label" ], + "type" : "object", + "properties" : { + "options" : { + "type" : "array", + "description" : "If type is `enumeration`, we should have a list of options to choose from.", + "example" : [ { + "label" : "Dog", + "value" : "dog" + }, { + "label" : "Cat", + "value" : "cat" + }, { + "label" : "Bird", + "value" : "bird" + } ], + "items" : { + "$ref" : "#/components/schemas/TimelineEventTemplateTokenOption" + } + }, + "label" : { + "type" : "string", + "description" : "Used for list segmentation and reporting.", + "example" : "petType edit" + }, + "objectPropertyName" : { + "type" : "string", + "description" : "The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API." + } + }, + "description" : "State of the token definition for update requests.", + "example" : { + "label" : "petType edit", + "options" : [ { + "value" : "dog", + "label" : "Dog" + }, { + "value" : "cat", + "label" : "Cat" + }, { + "value" : "bird", + "label" : "Bird" + } ] + } + }, + "BatchResponseTimelineEventResponseWithErrors" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "datetime" + }, + "numErrors" : { + "type" : "integer", + "format" : "int32" + }, + "requestedAt" : { + "type" : "string", + "format" : "datetime" + }, + "startedAt" : { + "type" : "string", + "format" : "datetime" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TimelineEventResponse" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + } + }, + "responses" : { + "Error" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "securitySchemes" : { + "oauth2_legacy" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "tickets" : "Read and write tickets", + "timeline" : "Create timeline events" + } + } + } + }, + "developer_hapikey" : { + "type" : "apiKey", + "name" : "hapikey", + "in" : "query" + }, + "oauth2" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "crm.objects.contacts.write" : " ", + "crm.schemas.contacts.write" : " ", + "crm.objects.companies.write" : " ", + "crm.schemas.companies.write" : " ", + "crm.schemas.deals.write" : " ", + "crm.objects.deals.write" : " ", + "crm.schemas.contacts.read" : " ", + "crm.objects.contacts.read" : " ", + "crm.objects.companies.read" : " ", + "crm.schemas.companies.read" : " ", + "crm.objects.deals.read" : " ", + "crm.schemas.deals.read" : " " + } + } + } + }, + "private_apps_legacy" : { + "type" : "apiKey", + "name" : "private-app-legacy", + "in" : "header" + }, + "private_apps" : { + "type" : "apiKey", + "name" : "private-app", + "in" : "header" + + } + } + }, + "x-hubspot-available-client-libraries" : [ "PHP", "Node", "Ruby", "Python" ], + "x-hubspot-product-tier-requirements" : { + "marketing" : "FREE", + "sales" : "FREE", + "service" : "FREE", + "cms" : "STARTER" + }, + "x-hubspot-documentation-banner" : "NONE" +} \ No newline at end of file diff --git a/docs/spec/report.html b/docs/spec/report.html new file mode 100755 index 0000000..b0be7aa --- /dev/null +++ b/docs/spec/report.html @@ -0,0 +1,146 @@ + + + + OpenAPI Changes Report + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ OpenAPI Changes report is loading... +
+
+
+ + \ No newline at end of file From 892243a99b54f962e2c8418ae3805d93be3b5c0e Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 9 Apr 2025 06:53:47 +0000 Subject: [PATCH 2/2] [AUTOMATED] Client Regeneration --- ballerina/client.bal | 234 ++++++++++++++++++------------------------- ballerina/types.bal | 211 ++++++++++++++++++-------------------- gradle.properties | 2 +- 3 files changed, 198 insertions(+), 249 deletions(-) diff --git a/ballerina/client.bal b/ballerina/client.bal index 73f698f..6836ad5 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -29,141 +29,130 @@ public isolated client class Client { # + serviceUrl - URL of the target service # + return - An error if connector initialization failed public isolated function init(ConnectionConfig config, string serviceUrl = "https://api.hubapi.com/integrators/timeline/v3") returns error? { - http:ClientConfiguration httpClientConfig = {httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation}; - do { - if config.http1Settings is ClientHttp1Settings { - ClientHttp1Settings settings = check config.http1Settings.ensureType(ClientHttp1Settings); - httpClientConfig.http1Settings = {...settings}; - } - if config.http2Settings is http:ClientHttp2Settings { - httpClientConfig.http2Settings = check config.http2Settings.ensureType(http:ClientHttp2Settings); - } - if config.cache is http:CacheConfig { - httpClientConfig.cache = check config.cache.ensureType(http:CacheConfig); - } - if config.responseLimits is http:ResponseLimitConfigs { - httpClientConfig.responseLimits = check config.responseLimits.ensureType(http:ResponseLimitConfigs); - } - if config.secureSocket is http:ClientSecureSocket { - httpClientConfig.secureSocket = check config.secureSocket.ensureType(http:ClientSecureSocket); - } - if config.proxy is http:ProxyConfig { - httpClientConfig.proxy = check config.proxy.ensureType(http:ProxyConfig); - } - } + http:ClientConfiguration httpClientConfig = {httpVersion: config.httpVersion, http1Settings: config.http1Settings, http2Settings: config.http2Settings, timeout: config.timeout, forwarded: config.forwarded, followRedirects: config.followRedirects, poolConfig: config.poolConfig, cache: config.cache, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, cookieConfig: config.cookieConfig, responseLimits: config.responseLimits, secureSocket: config.secureSocket, proxy: config.proxy, socketConfig: config.socketConfig, validation: config.validation, laxDataBinding: config.laxDataBinding}; if config.auth is ApiKeysConfig { self.apiKeyConfig = (config.auth).cloneReadOnly(); } else { httpClientConfig.auth = config.auth; self.apiKeyConfig = (); } - http:Client httpEp = check new (serviceUrl, httpClientConfig); - self.clientEp = httpEp; - return; + self.clientEp = check new (serviceUrl, httpClientConfig); } - # Deletes an event template for the app + # Gets the detailTemplate as rendered # - # + eventTemplateId - The event template ID. - # + appId - The ID of the target app. + # + eventTemplateId - The event template ID + # + eventId - The event ID # + headers - Headers to be sent with the request - # + return - No content - resource isolated function delete [int:Signed32 appId]/event\-templates/[string eventTemplateId](map headers = {}) returns http:Response|error { - string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}`; - map queryParam = {}; + # + return - successful operation + resource isolated function get events/[string eventTemplateId]/[string eventId]/detail(map headers = {}) returns EventDetail|error { + string resourcePath = string `/events/${getEncodedUri(eventTemplateId)}/${getEncodedUri(eventId)}/detail`; + map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - queryParam["hapikey"] = self.apiKeyConfig?.hapikey; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - return self.clientEp->delete(resourcePath, headers = headers); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->get(resourcePath, httpHeaders); } - # Removes a token from the event template + # Create a single event # - # + eventTemplateId - The event template ID. - # + tokenName - The token name. - # + appId - The ID of the target app. # + headers - Headers to be sent with the request - # + return - No content - resource isolated function delete [int:Signed32 appId]/event\-templates/[string eventTemplateId]/tokens/[string tokenName](map headers = {}) returns http:Response|error { - string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}/tokens/${getEncodedUri(tokenName)}`; - map queryParam = {}; + # + payload - The timeline event definition + # + return - successful operation + resource isolated function post events(TimelineEvent payload, map headers = {}) returns TimelineEventResponse|error { + string resourcePath = string `/events`; + map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - queryParam["hapikey"] = self.apiKeyConfig?.hapikey; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - return self.clientEp->delete(resourcePath, headers = headers); + map httpHeaders = http:getHeaderMap(headerValues); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, httpHeaders); } - # List all event templates for your app - # - # + appId - The ID of the target app. + # Updates an existing token on an event template + # + # + eventTemplateId - The event template ID + # + tokenName - The token name + # + appId - The ID of the target app # + headers - Headers to be sent with the request + # + payload - The updated token definition # + return - successful operation - resource isolated function get [int:Signed32 appId]/event\-templates(map headers = {}) returns CollectionResponseTimelineEventTemplateNoPaging|error { - string resourcePath = string `/${getEncodedUri(appId)}/event-templates`; + resource isolated function put [int:Signed32 appId]/event\-templates/[string eventTemplateId]/tokens/[string tokenName](TimelineEventTemplateTokenUpdateRequest payload, map headers = {}) returns TimelineEventTemplateToken|error { + string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}/tokens/${getEncodedUri(tokenName)}`; map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { queryParam["hapikey"] = self.apiKeyConfig?.hapikey; } resourcePath = resourcePath + check getPathForQueryParam(queryParam); - return self.clientEp->get(resourcePath, headers); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->put(resourcePath, request, headers); } - # Gets a specific event template for your app + # Removes a token from the event template # - # + eventTemplateId - The event template ID. - # + appId - The ID of the target app. + # + eventTemplateId - The event template ID + # + tokenName - The token name + # + appId - The ID of the target app # + headers - Headers to be sent with the request - # + return - successful operation - resource isolated function get [int:Signed32 appId]/event\-templates/[string eventTemplateId](map headers = {}) returns TimelineEventTemplate|error { - string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}`; + # + return - No content + resource isolated function delete [int:Signed32 appId]/event\-templates/[string eventTemplateId]/tokens/[string tokenName](map headers = {}) returns error? { + string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}/tokens/${getEncodedUri(tokenName)}`; map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { queryParam["hapikey"] = self.apiKeyConfig?.hapikey; } resourcePath = resourcePath + check getPathForQueryParam(queryParam); - return self.clientEp->get(resourcePath, headers); + return self.clientEp->delete(resourcePath, headers = headers); } # Gets the event # - # + eventTemplateId - The event template ID. - # + eventId - The event ID. + # + eventTemplateId - The event template ID + # + eventId - The event ID # + headers - Headers to be sent with the request # + return - successful operation resource isolated function get events/[string eventTemplateId]/[string eventId](map headers = {}) returns TimelineEventResponse|error { string resourcePath = string `/events/${getEncodedUri(eventTemplateId)}/${getEncodedUri(eventId)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } map httpHeaders = http:getHeaderMap(headerValues); return self.clientEp->get(resourcePath, httpHeaders); } - # Gets the detailTemplate as rendered + # Creates multiple events # - # + eventTemplateId - The event template ID. - # + eventId - The event ID. # + headers - Headers to be sent with the request + # + payload - The timeline event definition # + return - successful operation - resource isolated function get events/[string eventTemplateId]/[string eventId]/detail(map headers = {}) returns EventDetail|error { - string resourcePath = string `/events/${getEncodedUri(eventTemplateId)}/${getEncodedUri(eventId)}/detail`; + resource isolated function post events/batch/create(BatchInputTimelineEvent payload, map headers = {}) returns BatchResponseTimelineEventResponse|BatchResponseTimelineEventResponseWithErrors|json|error { + string resourcePath = string `/events/batch/create`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } map httpHeaders = http:getHeaderMap(headerValues); - return self.clientEp->get(resourcePath, httpHeaders); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, httpHeaders); } # Renders the header or detail as HTML # - # + eventTemplateId - The event template ID. - # + eventId - The event ID. + # + eventTemplateId - The event template ID + # + eventId - The event ID # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request # + return - successful operation @@ -171,42 +160,26 @@ public isolated client class Client { string resourcePath = string `/events/${getEncodedUri(eventTemplateId)}/${getEncodedUri(eventId)}/render`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } resourcePath = resourcePath + check getPathForQueryParam(queries); map httpHeaders = http:getHeaderMap(headerValues); return self.clientEp->get(resourcePath, httpHeaders); } - # Create an event template for your app - # - # + appId - The ID of the target app. - # + headers - Headers to be sent with the request - # + payload - The updated event template definition. - # + return - successful operation - resource isolated function post [int:Signed32 appId]/event\-templates(TimelineEventTemplateCreateRequest payload, map headers = {}) returns TimelineEventTemplate|error { + resource isolated function get [int:Signed32 appId]/event\-templates(map headers = {}) returns CollectionResponseTimelineEventTemplateNoPaging|error { string resourcePath = string `/${getEncodedUri(appId)}/event-templates`; map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { queryParam["hapikey"] = self.apiKeyConfig?.hapikey; } resourcePath = resourcePath + check getPathForQueryParam(queryParam); - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - return self.clientEp->post(resourcePath, request, headers); + return self.clientEp->get(resourcePath, headers); } - # Adds a token to an existing event template - # - # + eventTemplateId - The event template ID. - # + appId - The ID of the target app. - # + headers - Headers to be sent with the request - # + payload - The new token definition. - # + return - successful operation - resource isolated function post [int:Signed32 appId]/event\-templates/[string eventTemplateId]/tokens(TimelineEventTemplateToken payload, map headers = {}) returns TimelineEventTemplateToken|error { - string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}/tokens`; + resource isolated function post [int:Signed32 appId]/event\-templates(TimelineEventTemplateCreateRequest payload, map headers = {}) returns TimelineEventTemplate|error { + string resourcePath = string `/${getEncodedUri(appId)}/event-templates`; map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { queryParam["hapikey"] = self.apiKeyConfig?.hapikey; @@ -218,74 +191,67 @@ public isolated client class Client { return self.clientEp->post(resourcePath, request, headers); } - # Create a single event + # Gets a specific event template for your app # + # + eventTemplateId - The event template ID + # + appId - The ID of the target app # + headers - Headers to be sent with the request - # + payload - The timeline event definition. # + return - successful operation - resource isolated function post events(TimelineEvent payload, map headers = {}) returns TimelineEventResponse|error { - string resourcePath = string `/events`; - map headerValues = {...headers}; + resource isolated function get [int:Signed32 appId]/event\-templates/[string eventTemplateId](map headers = {}) returns TimelineEventTemplate|error { + string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}`; + map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + queryParam["hapikey"] = self.apiKeyConfig?.hapikey; } - map httpHeaders = http:getHeaderMap(headerValues); - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - return self.clientEp->post(resourcePath, request, httpHeaders); + resourcePath = resourcePath + check getPathForQueryParam(queryParam); + return self.clientEp->get(resourcePath, headers); } - # Creates multiple events + # Update an existing event template # + # + eventTemplateId - The event template ID + # + appId - The ID of the target app # + headers - Headers to be sent with the request - # + payload - The timeline event definition. + # + payload - The updated event template definition # + return - successful operation - resource isolated function post events/batch/create(BatchInputTimelineEvent payload, map headers = {}) returns BatchResponseTimelineEventResponse|BatchResponseTimelineEventResponseWithErrors|json|error { - string resourcePath = string `/events/batch/create`; - map headerValues = {...headers}; + resource isolated function put [int:Signed32 appId]/event\-templates/[string eventTemplateId](TimelineEventTemplateUpdateRequest payload, map headers = {}) returns TimelineEventTemplate|error { + string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}`; + map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + queryParam["hapikey"] = self.apiKeyConfig?.hapikey; } - map httpHeaders = http:getHeaderMap(headerValues); + resourcePath = resourcePath + check getPathForQueryParam(queryParam); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); - return self.clientEp->post(resourcePath, request, httpHeaders); + return self.clientEp->put(resourcePath, request, headers); } - # Update an existing event template + # Deletes an event template for the app # - # + eventTemplateId - The event template ID. - # + appId - The ID of the target app. + # + eventTemplateId - The event template ID + # + appId - The ID of the target app # + headers - Headers to be sent with the request - # + payload - The updated event template definition. - # + return - successful operation - resource isolated function put [int:Signed32 appId]/event\-templates/[string eventTemplateId](TimelineEventTemplateUpdateRequest payload, map headers = {}) returns TimelineEventTemplate|error { + # + return - No content + resource isolated function delete [int:Signed32 appId]/event\-templates/[string eventTemplateId](map headers = {}) returns error? { string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}`; map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { queryParam["hapikey"] = self.apiKeyConfig?.hapikey; } resourcePath = resourcePath + check getPathForQueryParam(queryParam); - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - return self.clientEp->put(resourcePath, request, headers); + return self.clientEp->delete(resourcePath, headers = headers); } - # Updates an existing token on an event template + # Adds a token to an existing event template # - # + eventTemplateId - The event template ID. - # + tokenName - The token name. - # + appId - The ID of the target app. + # + eventTemplateId - The event template ID + # + appId - The ID of the target app # + headers - Headers to be sent with the request - # + payload - The updated token definition. + # + payload - The new token definition # + return - successful operation - resource isolated function put [int:Signed32 appId]/event\-templates/[string eventTemplateId]/tokens/[string tokenName](TimelineEventTemplateTokenUpdateRequest payload, map headers = {}) returns TimelineEventTemplateToken|error { - string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}/tokens/${getEncodedUri(tokenName)}`; + resource isolated function post [int:Signed32 appId]/event\-templates/[string eventTemplateId]/tokens(TimelineEventTemplateToken payload, map headers = {}) returns TimelineEventTemplateToken|error { + string resourcePath = string `/${getEncodedUri(appId)}/event-templates/${getEncodedUri(eventTemplateId)}/tokens`; map queryParam = {}; if self.apiKeyConfig is ApiKeysConfig { queryParam["hapikey"] = self.apiKeyConfig?.hapikey; @@ -294,6 +260,6 @@ public isolated client class Client { http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); - return self.clientEp->put(resourcePath, request, headers); + return self.clientEp->post(resourcePath, request, headers); } } diff --git a/ballerina/types.bal b/ballerina/types.bal index f5b69fd..15ee3c8 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -20,38 +20,38 @@ import ballerina/http; public type TimelineEventIFrame record { - # The text displaying the link that will display the iframe. + # The text displaying the link that will display the iframe string linkLabel; - # The label of the modal window that displays the iframe contents. + # The label of the modal window that displays the iframe contents string headerLabel; - # The width of the modal window in pixels. + # The width of the modal window in pixels int:Signed32 width; - # The URI of the iframe contents. + # The URI of the iframe contents string url; - # The height of the modal window in pixels. + # The height of the modal window in pixels int:Signed32 height; }; -# The state of the timeline event. +# The state of the timeline event public type TimelineEvent record { - # The event template ID. + # The event template ID string eventTemplateId; - # Additional event-specific data that can be interpreted by the template's markdown. + # Additional event-specific data that can be interpreted by the template's markdown record {} extraData?; TimelineEventIFrame timelineIFrame?; - # The event domain (often paired with utk). + # The event domain (often paired with utk) string domain?; - # A collection of token keys and values associated with the template tokens. + # A collection of token keys and values associated with the template tokens record {|string...;|} tokens; - # Identifier for the event. This is optional, and we recommend you do not pass this in. We will create one for you if you omit this. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness. + # Identifier for the event. This is optional, and we recommend you do not pass this in. We will create one for you if you omit this. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness string id?; - # Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie. + # Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie string utk?; - # The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`). + # The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`) string email?; - # The CRM object identifier. This is required for every event other than contacts (where utk or email can be used). + # The CRM object identifier. This is required for every event other than contacts (where utk or email can be used) string objectId?; - # The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline. + # The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline string timestamp?; }; @@ -66,69 +66,50 @@ public type StandardError record { string status; }; -# State of the template definition being updated. -public type TimelineEventTemplateUpdateRequest record { - # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details. - string detailTemplate?; - # The template name. - string name; - # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects. - TimelineEventTemplateToken[] tokens; - # The template ID. - string id; - # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header. - string headerTemplate?; -}; - -# The details Markdown rendered as HTML. +# The details Markdown rendered as HTML public type EventDetail record { - # The details Markdown rendered as HTML. + # The details Markdown rendered as HTML string details; }; -# State of the template definition being created. +# State of the template definition being created public type TimelineEventTemplateCreateRequest record { - # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details. + # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details string detailTemplate?; - # The template name. + # The template name string name; - # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects. + # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects TimelineEventTemplateToken[] tokens; - # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header. + # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header string headerTemplate?; - # The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported. + # The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported string objectType; }; -# Proxy server configurations to be used with the HTTP client endpoint. -public type ProxyConfig record {| - # Host name of the proxy server - string host = ""; - # Proxy server port - int port = 0; - # Proxy server username - string userName = ""; - # Proxy server password - @display {label: "", kind: "password"} - string password = ""; -|}; +# State of the template definition being updated +public type TimelineEventTemplateUpdateRequest record { + # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details + string detailTemplate?; + # The template name + string name; + # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects + TimelineEventTemplateToken[] tokens; + # The template ID + string id; + # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header + string headerTemplate?; +}; public type CollectionResponseTimelineEventTemplateNoPaging record { TimelineEventTemplate[] results; }; -# Represents the Queries record for the operation: get-/events/{eventTemplateId}/{eventId}/render_getRenderById -public type GetEventsEventTemplateIdEventIdRenderGetRenderByIdQueries record { - # Set to 'true', we want to render the `detailTemplate` instead of the `headerTemplate`. - boolean detail?; -}; - public type ErrorDetail record { # A specific category that contains more specific detail about the error string subCategory?; # The status code associated with the error detail string code?; - # The name of the field or parameter in which the error was found. + # The name of the field or parameter in which the error was found string 'in?; # Context about the error condition record {|string[]...;|} context?; @@ -136,59 +117,55 @@ public type ErrorDetail record { string message; }; -# The state of the batch event request. +# Represents the Queries record for the operation: get-/events/{eventTemplateId}/{eventId}/render_getRenderById +public type GetEventsEventTemplateIdEventIdRenderGetRenderByIdQueries record { + # Set to 'true', we want to render the `detailTemplate` instead of the `headerTemplate` + boolean detail?; +}; + +# The state of the batch event request public type BatchResponseTimelineEventResponse record { - # The time the request was completed. + # The time the request was completed string completedAt; - # The time the request occurred. + # The time the request occurred string requestedAt?; - # The time the request began processing. + # The time the request began processing string startedAt; record {|string...;|} links?; - # Successfully created events. + # Successfully created events TimelineEventResponse[] results; - # The status of the batch response. Should always be COMPLETED if processed. + # The status of the batch response. Should always be COMPLETED if processed "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; }; -# Used to create timeline events in batches. +# Used to create timeline events in batches public type BatchInputTimelineEvent record { - # A collection of timeline events we want to create. + # A collection of timeline events we want to create TimelineEvent[] inputs; }; -# Provides settings related to HTTP/1.x protocol. -public type ClientHttp1Settings record {| - # Specifies whether to reuse a connection for multiple requests - http:KeepAlive keepAlive = http:KEEPALIVE_AUTO; - # The chunking behaviour of the request - http:Chunking chunking = http:CHUNKING_AUTO; - # Proxy server related options - ProxyConfig proxy?; -|}; - public type TimelineEventTemplateTokenOption record { string label; string value; }; -# The current state of the template definition. +# The current state of the template definition public type TimelineEventTemplate record { - # The date and time that the Event Template was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020. - string createdAt?; - # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details. + # The date and time that the Event Template was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020 + string? createdAt?; + # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details string detailTemplate?; - # The template name. + # The template name string name; - # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects. + # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects TimelineEventTemplateToken[] tokens; - # The template ID. + # The template ID string id; - # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header. + # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header string headerTemplate?; - # The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported. + # The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported string objectType; - # The date and time that the Event Template was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020. + # The date and time that the Event Template was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020 string updatedAt?; }; @@ -199,65 +176,65 @@ public type OAuth2RefreshTokenGrantConfig record {| string refreshUrl = "https://api.hubapi.com/oauth/v1/token"; |}; -# State of the token definition. +# State of the token definition public type TimelineEventTemplateToken record { - # The date and time that the Event Template Token was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020. + # The date and time that the Event Template Token was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020 string createdAt?; - # If type is `enumeration`, we should have a list of options to choose from. + # If type is `enumeration`, we should have a list of options to choose from TimelineEventTemplateTokenOption[] options?; - # The name of the token referenced in the templates. This must be unique for the specific template. It may only contain alphanumeric characters, periods, dashes, or underscores (. - _). + # The name of the token referenced in the templates. This must be unique for the specific template. It may only contain alphanumeric characters, periods, dashes, or underscores (. - _) string name; - # Used for list segmentation and reporting. + # Used for list segmentation and reporting string label; - # The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API. + # The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API string? objectPropertyName?; - # The data type of the token. You can currently choose from [string, number, date, enumeration]. + # The data type of the token. You can currently choose from [string, number, date, enumeration] "date"|"enumeration"|"number"|"string" 'type; - # The date and time that the Event Template Token was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020. + # The date and time that the Event Template Token was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020 string updatedAt?; }; -# The current state of the timeline event. +# The current state of the timeline event public type TimelineEventResponse record { - # The event template ID. + # The event template ID string eventTemplateId; string? createdAt?; - # Additional event-specific data that can be interpreted by the template's markdown. + # Additional event-specific data that can be interpreted by the template's markdown record {} extraData?; TimelineEventIFrame timelineIFrame?; - # The event domain (often paired with utk). + # The event domain (often paired with utk) string domain?; - # A collection of token keys and values associated with the template tokens. + # A collection of token keys and values associated with the template tokens record {|string...;|} tokens; - # Identifier for the event. This should be unique to the app and event template. If you use the same ID for different CRM objects, the last to be processed will win and the first will not have a record. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness. + # Identifier for the event. This should be unique to the app and event template. If you use the same ID for different CRM objects, the last to be processed will win and the first will not have a record. You can also use `{{uuid}}` anywhere in the ID to generate a unique string, guaranteeing uniqueness string id; - # Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie. + # Use the `utk` parameter to associate an event with a contact by `usertoken`. This is recommended if you don't know a user's email, but have an identifying user token in your cookie string utk?; - # The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`). + # The email address used for contact-specific events. This can be used to identify existing contacts, create new ones, or change the email for an existing contact (if paired with the `objectId`) string email?; - # The CRM object identifier. This is required for every event other than contacts (where utk or email can be used). + # The CRM object identifier. This is required for every event other than contacts (where utk or email can be used) string objectId?; - # The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline. + # The time the event occurred. If not passed in, the curren time will be assumed. This is used to determine where an event is shown on a CRM object's timeline string timestamp?; - # The ObjectType associated with the EventTemplate. + # The ObjectType associated with the EventTemplate string objectType; }; -# State of the token definition for update requests. +# State of the token definition for update requests public type TimelineEventTemplateTokenUpdateRequest record { - # If type is `enumeration`, we should have a list of options to choose from. + # If type is `enumeration`, we should have a list of options to choose from TimelineEventTemplateTokenOption[] options?; - # Used for list segmentation and reporting. + # Used for list segmentation and reporting string label; - # The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API. + # The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API string objectPropertyName?; }; # Provides API key configurations needed when communicating with a remote HTTP endpoint. public type ApiKeysConfig record {| string hapikey; - string? private\-app\-legacy; - string? private\-app; + string privateAppLegacy; + string privateApp; |}; # Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint. @@ -268,29 +245,35 @@ public type ConnectionConfig record {| # The HTTP version understood by the client http:HttpVersion httpVersion = http:HTTP_2_0; # Configurations related to HTTP/1.x protocol - ClientHttp1Settings http1Settings?; + http:ClientHttp1Settings http1Settings = {}; # Configurations related to HTTP/2 protocol - http:ClientHttp2Settings http2Settings?; + http:ClientHttp2Settings http2Settings = {}; # The maximum time to wait (in seconds) for a response before closing the connection - decimal timeout = 60; + decimal timeout = 30; # The choice of setting `forwarded`/`x-forwarded` header string forwarded = "disable"; + # Configurations associated with Redirection + http:FollowRedirects followRedirects?; # Configurations associated with request pooling http:PoolConfiguration poolConfig?; # HTTP caching related configurations - http:CacheConfig cache?; + http:CacheConfig cache = {}; # Specifies the way of handling compression (`accept-encoding`) header http:Compression compression = http:COMPRESSION_AUTO; # Configurations associated with the behaviour of the Circuit Breaker http:CircuitBreakerConfig circuitBreaker?; # Configurations associated with retrying http:RetryConfig retryConfig?; + # Configurations associated with cookies + http:CookieConfig cookieConfig?; # Configurations associated with inbound response size limits - http:ResponseLimitConfigs responseLimits?; + http:ResponseLimitConfigs responseLimits = {}; # SSL/TLS-related options http:ClientSecureSocket secureSocket?; # Proxy server related options http:ProxyConfig proxy?; + # Provides settings related to client socket configuration + http:ClientSocketConfig socketConfig = {}; # Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default boolean validation = true; # Enables relaxed data binding on the client side. When enabled, `nil` values are treated as optional, diff --git a/gradle.properties b/gradle.properties index c6e641c..389daaf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,4 @@ version=1.0.1-SNAPSHOT releasePluginVersion=2.8.0 ballerinaGradlePluginVersion=2.3.0 -ballerinaLangVersion=2201.11.0 +ballerinaLangVersion=2201.12.2