From 872eaf1d645cef1c4e0c4799dd42d0dbb64a44f8 Mon Sep 17 00:00:00 2001 From: ChathuraIshara Date: Fri, 14 Feb 2025 11:09:47 +0530 Subject: [PATCH 1/6] add tasks.json --- docs/spec/tasks.json | 1656 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1656 insertions(+) create mode 100644 docs/spec/tasks.json diff --git a/docs/spec/tasks.json b/docs/spec/tasks.json new file mode 100644 index 0000000..b0349b1 --- /dev/null +++ b/docs/spec/tasks.json @@ -0,0 +1,1656 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Tasks", + "description" : "", + "version" : "v3", + "x-hubspot-product-tier-requirements" : { + "marketing" : "FREE", + "sales" : "FREE", + "service" : "FREE", + "cms" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE", + "x-hubspot-api-use-case" : "If you're using a third-party service for project management, you can create and manage any tasks associated with your CRM records by logging them in HubSpot.", + "x-hubspot-related-documentation" : [ { + "name" : "Tasks Guide", + "url" : "https://developers.hubspot.com/docs/guides/api/crm/engagements/tasks" + } ], + "x-hubspot-introduction" : "Use the tasks API to associate tasks with your CRM records. You can assign tasks to specific users in your account, keep track of their status, and organize them using different priorities and types." + }, + "servers" : [ { + "url" : "https://api.hubapi.com" + } ], + "tags" : [ { + "name" : "Batch" + }, { + "name" : "Basic" + }, { + "name" : "Search" + } ], + "paths" : { + "/crm/v3/objects/tasks/batch/read" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Read a batch of tasks by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/tasks/batch/read_read", + "parameters" : [ { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchReadInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + } + }, + "/crm/v3/objects/tasks/{taskId}" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "Read", + "description" : "Read an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/tasks/{taskId}_getById", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object type", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + }, + "delete" : { + "tags" : [ "Basic" ], + "summary" : "Archive", + "description" : "Move an Object identified by `{taskId}` to the recycling bin.", + "operationId" : "delete-/crm/v3/objects/tasks/{taskId}_archive", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + }, + "patch" : { + "tags" : [ "Basic" ], + "summary" : "Update", + "description" : "Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.", + "operationId" : "patch-/crm/v3/objects/tasks/{taskId}_update", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object type", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/crm/v3/objects/tasks/batch/archive" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Archive a batch of tasks by ID", + "operationId" : "post-/crm/v3/objects/tasks/batch/archive_archive", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/crm/v3/objects/tasks/batch/create" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create a batch of tasks", + "operationId" : "post-/crm/v3/objects/tasks/batch/create_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/crm/v3/objects/tasks/batch/update" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Update a batch of tasks by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/tasks/batch/update_update", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/crm/v3/objects/tasks" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "List", + "description" : "Read a page of tasks. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/tasks_getPage", + "parameters" : [ { + "name" : "limit", + "in" : "query", + "description" : "The maximum number of results to display per page.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "after", + "in" : "query", + "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + }, + "post" : { + "tags" : [ "Basic" ], + "summary" : "Create", + "description" : "Create a task with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tasks is provided.", + "operationId" : "post-/crm/v3/objects/tasks_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/crm/v3/objects/tasks/batch/upsert" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create or update a batch of tasks by unique property values", + "description" : "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.", + "operationId" : "post-/crm/v3/objects/tasks/batch/upsert_upsert", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInputUpsert" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/crm/v3/objects/tasks/search" : { + "post" : { + "tags" : [ "Search" ], + "operationId" : "post-/crm/v3/objects/tasks/search_doSearch", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicObjectSearchRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseWithTotalSimplePublicObjectForwardPaging" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ], + "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] + } + } + }, + "components" : { + "schemas" : { + "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" + } + } + }, + "CollectionResponseAssociatedId" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/Paging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociatedId" + } + } + } + }, + "PublicAssociationsForObject" : { + "required" : [ "to", "types" ], + "type" : "object", + "properties" : { + "types" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociationSpec" + } + }, + "to" : { + "$ref" : "#/components/schemas/PublicObjectId" + } + } + }, + "BatchResponseSimplePublicObject" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "FilterGroup" : { + "required" : [ "filters" ], + "type" : "object", + "properties" : { + "filters" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Filter" + } + } + } + }, + "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" + } + } + }, + "ForwardPaging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + } + } + }, + "SimplePublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "BatchResponseSimplePublicUpsertObjectWithErrors" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "numErrors" : { + "type" : "integer", + "format" : "int32" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicUpsertObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchReadInputSimplePublicObjectId" : { + "required" : [ "inputs", "properties", "propertiesWithHistory" ], + "type" : "object", + "properties" : { + "propertiesWithHistory" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "idProperty" : { + "type" : "string" + }, + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicUpsertObject" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicUpsertObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchInputSimplePublicObjectId" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + } + } + }, + "ValueWithTimestamp" : { + "required" : [ "sourceType", "timestamp", "value" ], + "type" : "object", + "properties" : { + "sourceId" : { + "type" : "string" + }, + "sourceType" : { + "type" : "string" + }, + "sourceLabel" : { + "type" : "string" + }, + "updatedByUserId" : { + "type" : "integer", + "format" : "int32" + }, + "value" : { + "type" : "string" + }, + "timestamp" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "BatchInputSimplePublicObjectBatchInputUpsert" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInputUpsert" + } + } + } + }, + "CollectionResponseWithTotalSimplePublicObjectForwardPaging" : { + "required" : [ "results", "total" ], + "type" : "object", + "properties" : { + "total" : { + "type" : "integer", + "format" : "int32" + }, + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "SimplePublicObject" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "archived" : { + "type" : "boolean", + "example" : false + }, + "archivedAt" : { + "type" : "string", + "format" : "date-time" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string", + "example" : "512" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + } + }, + "example" : { + "id" : "512", + "properties" : { + "createdate" : "2019-10-30T03:30:17.883Z", + "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", + "hs_task_body" : "Send Proposal", + "hs_task_priority" : "HIGH", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hubspot_owner_id" : "64492917" + }, + "createdAt" : "2019-10-30T03:30:17.883Z", + "updatedAt" : "2019-12-07T16:50:06.678Z", + "archived" : false + } + }, + "PublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "Paging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + }, + "prev" : { + "$ref" : "#/components/schemas/PreviousPage" + } + } + }, + "PublicObjectSearchRequest" : { + "type" : "object", + "properties" : { + "query" : { + "type" : "string" + }, + "limit" : { + "type" : "integer", + "format" : "int32" + }, + "after" : { + "type" : "string" + }, + "sorts" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "filterGroups" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/FilterGroup" + } + } + } + }, + "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" + } + } + }, + "SimplePublicObjectBatchInputUpsert" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicObjectWithErrors" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "numErrors" : { + "type" : "integer", + "format" : "int32" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "SimplePublicObjectInput" : { + "required" : [ "properties" ], + "type" : "object", + "properties" : { + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + } + }, + "example" : { + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + }, + "associations" : [ { + "to" : { + "id" : "101" + }, + "types" : [ { + "associationCategory" : "HUBSPOT_DEFINED", + "associationTypeId" : 2 + } ] + } ] + } + }, + "CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "AssociationSpec" : { + "required" : [ "associationCategory", "associationTypeId" ], + "type" : "object", + "properties" : { + "associationCategory" : { + "type" : "string", + "enum" : [ "HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED" ] + }, + "associationTypeId" : { + "type" : "integer", + "format" : "int32" + } + } + }, + "SimplePublicObjectWithAssociations" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/CollectionResponseAssociatedId" + } + }, + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "date-time" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + } + }, + "example" : { + "properties" : { + "createdate" : "2019-10-30T03:30:17.883Z", + "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", + "hs_task_body" : "Send Proposal", + "hs_task_priority" : "HIGH", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hubspot_owner_id" : "64492917" + } + } + }, + "Filter" : { + "required" : [ "operator", "propertyName" ], + "type" : "object", + "properties" : { + "highValue" : { + "type" : "string" + }, + "propertyName" : { + "type" : "string" + }, + "values" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "value" : { + "type" : "string" + }, + "operator" : { + "type" : "string", + "description" : "null", + "enum" : [ "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN" ] + } + } + }, + "BatchInputSimplePublicObjectBatchInput" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInput" + } + } + } + }, + "BatchInputSimplePublicObjectInputForCreate" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + } + }, + "PreviousPage" : { + "required" : [ "before" ], + "type" : "object", + "properties" : { + "before" : { + "type" : "string" + }, + "link" : { + "type" : "string" + } + } + }, + "SimplePublicUpsertObject" : { + "required" : [ "createdAt", "id", "new", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "date-time" + }, + "new" : { + "type" : "boolean" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "SimplePublicObjectBatchInput" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string", + "example" : "my_unique_property_name" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "example" : { + "id" : "1", + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + } + } + }, + "AssociatedId" : { + "required" : [ "id", "type" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "type" : { + "type" : "string" + } + } + }, + "NextPage" : { + "required" : [ "after" ], + "type" : "object", + "properties" : { + "link" : { + "type" : "string", + "example" : "?after=NTI1Cg%3D%3D" + }, + "after" : { + "type" : "string", + "example" : "NTI1Cg%3D%3D" + } + }, + "example" : { + "after" : "NTI1Cg%3D%3D", + "link" : "?after=NTI1Cg%3D%3D" + } + }, + "SimplePublicObjectInputForCreate" : { + "required" : [ "associations", "properties" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicAssociationsForObject" + } + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "example" : { + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + }, + "associations" : [ { + "to" : { + "id" : "101" + }, + "types" : [ { + "associationCategory" : "HUBSPOT_DEFINED", + "associationTypeId" : 2 + } ] + } ] + } + } + }, + "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" : { + "e-commerce" : "e-commerce", + "crm.objects.custom.write" : "Change custom object records", + "media_bridge.read" : "Read media and media events", + "crm.objects.goals.read" : "Read goals", + "tickets" : "Read and write tickets", + "crm.objects.custom.read" : "View custom object records" + } + } + } + }, + "oauth2" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "crm.objects.contacts.read" : " ", + "crm.objects.listings.read" : "Read listings", + "crm.objects.carts.write" : "Write cart", + "crm.objects.courses.write" : "Write courses", + "crm.objects.quotes.write" : "Quotes", + "crm.objects.users.read" : "Read User CRM objects", + "crm.objects.companies.read" : " ", + "crm.objects.appointments.read" : "Read appointments", + "crm.objects.partner-clients.write" : "Modify Partner Client CRM objects", + "crm.objects.leads.read" : "Read lead objects", + "crm.objects.appointments.write" : "Write appointments", + "crm.objects.services.write" : "Write services", + "crm.objects.line_items.read" : "Line Items", + "crm.objects.courses.read" : "Read courses", + "crm.objects.deals.read" : " ", + "crm.objects.invoices.read" : "Read invoices objects", + "crm.objects.partner-clients.read" : "View Partner Client CRM objects", + "crm.objects.deals.write" : " ", + "crm.objects.line_items.write" : "Line Items", + "crm.objects.listings.write" : "Write listings", + "crm.objects.companies.write" : " ", + "crm.objects.contacts.write" : " ", + "crm.objects.users.write" : "Write User CRM objects", + "crm.objects.commercepayments.read" : "Read the COMMERCE_PAYMENT object.", + "crm.objects.leads.write" : "Modify lead objects", + "crm.objects.subscriptions.read" : "Read Commerce Subscriptions", + "crm.objects.carts.read" : "Read carts", + "crm.objects.orders.write" : "Write orders", + "crm.objects.quotes.read" : "Quotes", + "crm.objects.services.read" : "Read services", + "crm.objects.orders.read" : "Read Orders" + } + } + } + }, + "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" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE" +} \ No newline at end of file From 05ec647d51f60f0bb1959ddeaad4482437f49473 Mon Sep 17 00:00:00 2001 From: ChathuraIshara Date: Fri, 14 Feb 2025 13:22:38 +0530 Subject: [PATCH 2/6] update openapi and sanitations --- docs/spec/aligned_ballerina_openapi.json | 1733 ++++++++++++++++++++++ docs/spec/flattened_openapi.json | 1656 +++++++++++++++++++++ docs/spec/sanitations.md | 34 +- docs/spec/tasks.json | 62 +- 4 files changed, 3445 insertions(+), 40 deletions(-) create mode 100644 docs/spec/aligned_ballerina_openapi.json create mode 100644 docs/spec/flattened_openapi.json diff --git a/docs/spec/aligned_ballerina_openapi.json b/docs/spec/aligned_ballerina_openapi.json new file mode 100644 index 0000000..7ac984a --- /dev/null +++ b/docs/spec/aligned_ballerina_openapi.json @@ -0,0 +1,1733 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Tasks", + "description" : "", + "version" : "v3", + "x-hubspot-product-tier-requirements" : { + "marketing" : "FREE", + "sales" : "FREE", + "service" : "FREE", + "cms" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE", + "x-hubspot-api-use-case" : "If you're using a third-party service for project management, you can create and manage any tasks associated with your CRM records by logging them in HubSpot.", + "x-hubspot-related-documentation" : [ { + "name" : "Tasks Guide", + "url" : "https://developers.hubspot.com/docs/guides/api/crm/engagements/tasks" + } ], + "x-hubspot-introduction" : "Use the tasks API to associate tasks with your CRM records. You can assign tasks to specific users in your account, keep track of their status, and organize them using different priorities and types." + }, + "servers" : [ { + "url" : "https://api.hubapi.com/crm/v3/objects/tasks" + } ], + "tags" : [ { + "name" : "Batch" + }, { + "name" : "Basic" + }, { + "name" : "Search" + } ], + "paths" : { + "/batch/read" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Read a batch of tasks by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/tasks/batch/read_read", + "parameters" : [ { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchReadInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + } + }, + "/{taskId}" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "Read", + "description" : "Read an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/tasks/{taskId}_getById", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object type", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + }, + "delete" : { + "tags" : [ "Basic" ], + "summary" : "Archive", + "description" : "Move an Object identified by `{taskId}` to the recycling bin.", + "operationId" : "delete-/crm/v3/objects/tasks/{taskId}_archive", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + }, + "patch" : { + "tags" : [ "Basic" ], + "summary" : "Update", + "description" : "Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.", + "operationId" : "patch-/crm/v3/objects/tasks/{taskId}_update", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object type", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/archive" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Archive a batch of tasks by ID", + "operationId" : "post-/crm/v3/objects/tasks/batch/archive_archive", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/create" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create a batch of tasks", + "operationId" : "post-/crm/v3/objects/tasks/batch/create_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/update" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Update a batch of tasks by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/tasks/batch/update_update", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "List", + "description" : "Read a page of tasks. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/tasks_getPage", + "parameters" : [ { + "name" : "limit", + "in" : "query", + "description" : "The maximum number of results to display per page.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "after", + "in" : "query", + "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + }, + "post" : { + "tags" : [ "Basic" ], + "summary" : "Create", + "description" : "Create a task with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tasks is provided.", + "operationId" : "post-/crm/v3/objects/tasks_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/upsert" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create or update a batch of tasks by unique property values", + "description" : "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.", + "operationId" : "post-/crm/v3/objects/tasks/batch/upsert_upsert", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInputUpsert" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObjectWithErrors" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/search" : { + "post" : { + "tags" : [ "Search" ], + "operationId" : "post-/crm/v3/objects/tasks/search_doSearch", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicObjectSearchRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseWithTotalSimplePublicObjectForwardPaging" + } + } + } + }, + "default" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ], + "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] + } + } + }, + "components" : { + "schemas" : { + "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" + } + } + }, + "CollectionResponseAssociatedId" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/Paging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociatedId" + } + } + } + }, + "PublicAssociationsForObject" : { + "required" : [ "to", "types" ], + "type" : "object", + "properties" : { + "types" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociationSpec" + } + }, + "to" : { + "$ref" : "#/components/schemas/PublicObjectId" + } + } + }, + "BatchResponseSimplePublicObject" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "datetime" + }, + "requestedAt" : { + "type" : "string", + "format" : "datetime" + }, + "startedAt" : { + "type" : "string", + "format" : "datetime" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "FilterGroup" : { + "required" : [ "filters" ], + "type" : "object", + "properties" : { + "filters" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Filter" + } + } + } + }, + "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" + } + } + }, + "ForwardPaging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + } + } + }, + "SimplePublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "BatchResponseSimplePublicUpsertObjectWithErrors" : { + "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/SimplePublicUpsertObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchReadInputSimplePublicObjectId" : { + "required" : [ "inputs", "properties", "propertiesWithHistory" ], + "type" : "object", + "properties" : { + "propertiesWithHistory" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "idProperty" : { + "type" : "string" + }, + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicUpsertObject" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "datetime" + }, + "requestedAt" : { + "type" : "string", + "format" : "datetime" + }, + "startedAt" : { + "type" : "string", + "format" : "datetime" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicUpsertObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchInputSimplePublicObjectId" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + } + } + }, + "ValueWithTimestamp" : { + "required" : [ "sourceType", "timestamp", "value" ], + "type" : "object", + "properties" : { + "sourceId" : { + "type" : "string" + }, + "sourceType" : { + "type" : "string" + }, + "sourceLabel" : { + "type" : "string" + }, + "updatedByUserId" : { + "type" : "integer", + "format" : "int32" + }, + "value" : { + "type" : "string" + }, + "timestamp" : { + "type" : "string", + "format" : "datetime" + } + } + }, + "BatchInputSimplePublicObjectBatchInputUpsert" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInputUpsert" + } + } + } + }, + "CollectionResponseWithTotalSimplePublicObjectForwardPaging" : { + "required" : [ "results", "total" ], + "type" : "object", + "properties" : { + "total" : { + "type" : "integer", + "format" : "int32" + }, + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "SimplePublicObject" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "datetime" + }, + "archived" : { + "type" : "boolean", + "example" : false + }, + "archivedAt" : { + "type" : "string", + "format" : "datetime" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string", + "example" : "512" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "datetime" + } + }, + "example" : { + "id" : "512", + "properties" : { + "createdate" : "2019-10-30T03:30:17.883Z", + "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", + "hs_task_body" : "Send Proposal", + "hs_task_priority" : "HIGH", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hubspot_owner_id" : "64492917" + }, + "createdAt" : "2019-10-30T03:30:17.883Z", + "updatedAt" : "2019-12-07T16:50:06.678Z", + "archived" : false + } + }, + "PublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "Paging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + }, + "prev" : { + "$ref" : "#/components/schemas/PreviousPage" + } + } + }, + "PublicObjectSearchRequest" : { + "type" : "object", + "properties" : { + "query" : { + "type" : "string" + }, + "limit" : { + "type" : "integer", + "format" : "int32" + }, + "after" : { + "type" : "string" + }, + "sorts" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "filterGroups" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/FilterGroup" + } + } + } + }, + "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" + } + } + }, + "SimplePublicObjectBatchInputUpsert" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicObjectWithErrors" : { + "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/SimplePublicObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "SimplePublicObjectInput" : { + "required" : [ "properties" ], + "type" : "object", + "properties" : { + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + } + }, + "example" : { + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + }, + "associations" : [ { + "to" : { + "id" : "101" + }, + "types" : [ { + "associationCategory" : "HUBSPOT_DEFINED", + "associationTypeId" : 2 + } ] + } ] + } + }, + "CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "AssociationSpec" : { + "required" : [ "associationCategory", "associationTypeId" ], + "type" : "object", + "properties" : { + "associationCategory" : { + "type" : "string", + "enum" : [ "HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED" ] + }, + "associationTypeId" : { + "type" : "integer", + "format" : "int32" + } + } + }, + "SimplePublicObjectWithAssociations" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/CollectionResponseAssociatedId" + } + }, + "createdAt" : { + "type" : "string", + "format" : "datetime" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "datetime" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + } + }, + "updatedAt" : { + "type" : "string", + "format" : "datetime" + } + }, + "example" : { + "properties" : { + "createdate" : "2019-10-30T03:30:17.883Z", + "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", + "hs_task_body" : "Send Proposal", + "hs_task_priority" : "HIGH", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hubspot_owner_id" : "64492917" + } + } + }, + "Filter" : { + "required" : [ "operator", "propertyName" ], + "type" : "object", + "properties" : { + "highValue" : { + "type" : "string" + }, + "propertyName" : { + "type" : "string" + }, + "values" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "value" : { + "type" : "string" + }, + "operator" : { + "type" : "string", + "description" : "null", + "enum" : [ "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN" ] + } + } + }, + "BatchInputSimplePublicObjectBatchInput" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInput" + } + } + } + }, + "BatchInputSimplePublicObjectInputForCreate" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + } + }, + "PreviousPage" : { + "required" : [ "before" ], + "type" : "object", + "properties" : { + "before" : { + "type" : "string" + }, + "link" : { + "type" : "string" + } + } + }, + "SimplePublicUpsertObject" : { + "required" : [ "createdAt", "id", "new", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "datetime" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "datetime" + }, + "new" : { + "type" : "boolean" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "datetime" + } + } + }, + "SimplePublicObjectBatchInput" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string", + "example" : "my_unique_property_name" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "example" : { + "id" : "1", + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + } + } + }, + "AssociatedId" : { + "required" : [ "id", "type" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "type" : { + "type" : "string" + } + } + }, + "NextPage" : { + "required" : [ "after" ], + "type" : "object", + "properties" : { + "link" : { + "type" : "string", + "example" : "?after=NTI1Cg%3D%3D" + }, + "after" : { + "type" : "string", + "example" : "NTI1Cg%3D%3D" + } + }, + "example" : { + "after" : "NTI1Cg%3D%3D", + "link" : "?after=NTI1Cg%3D%3D" + } + }, + "SimplePublicObjectInputForCreate" : { + "required" : [ "associations", "properties" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicAssociationsForObject" + } + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "example" : { + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + }, + "associations" : [ { + "to" : { + "id" : "101" + }, + "types" : [ { + "associationCategory" : "HUBSPOT_DEFINED", + "associationTypeId" : 2 + } ] + } ] + } + } + }, + "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" : { + "e-commerce" : "e-commerce", + "crm.objects.custom.write" : "Change custom object records", + "media_bridge.read" : "Read media and media events", + "crm.objects.goals.read" : "Read goals", + "tickets" : "Read and write tickets", + "crm.objects.custom.read" : "View custom object records" + } + } + } + }, + "oauth2" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "crm.objects.contacts.read" : " ", + "crm.objects.listings.read" : "Read listings", + "crm.objects.carts.write" : "Write cart", + "crm.objects.courses.write" : "Write courses", + "crm.objects.quotes.write" : "Quotes", + "crm.objects.users.read" : "Read User CRM objects", + "crm.objects.companies.read" : " ", + "crm.objects.appointments.read" : "Read appointments", + "crm.objects.partner-clients.write" : "Modify Partner Client CRM objects", + "crm.objects.leads.read" : "Read lead objects", + "crm.objects.appointments.write" : "Write appointments", + "crm.objects.services.write" : "Write services", + "crm.objects.line_items.read" : "Line Items", + "crm.objects.courses.read" : "Read courses", + "crm.objects.deals.read" : " ", + "crm.objects.invoices.read" : "Read invoices objects", + "crm.objects.partner-clients.read" : "View Partner Client CRM objects", + "crm.objects.deals.write" : " ", + "crm.objects.line_items.write" : "Line Items", + "crm.objects.listings.write" : "Write listings", + "crm.objects.companies.write" : " ", + "crm.objects.contacts.write" : " ", + "crm.objects.users.write" : "Write User CRM objects", + "crm.objects.commercepayments.read" : "Read the COMMERCE_PAYMENT object.", + "crm.objects.leads.write" : "Modify lead objects", + "crm.objects.subscriptions.read" : "Read Commerce Subscriptions", + "crm.objects.carts.read" : "Read carts", + "crm.objects.orders.write" : "Write orders", + "crm.objects.quotes.read" : "Quotes", + "crm.objects.services.read" : "Read services", + "crm.objects.orders.read" : "Read Orders" + } + } + } + }, + "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" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE" +} \ No newline at end of file diff --git a/docs/spec/flattened_openapi.json b/docs/spec/flattened_openapi.json new file mode 100644 index 0000000..1dc12cf --- /dev/null +++ b/docs/spec/flattened_openapi.json @@ -0,0 +1,1656 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Tasks", + "description" : "", + "version" : "v3", + "x-hubspot-product-tier-requirements" : { + "marketing" : "FREE", + "sales" : "FREE", + "service" : "FREE", + "cms" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE", + "x-hubspot-api-use-case" : "If you're using a third-party service for project management, you can create and manage any tasks associated with your CRM records by logging them in HubSpot.", + "x-hubspot-related-documentation" : [ { + "name" : "Tasks Guide", + "url" : "https://developers.hubspot.com/docs/guides/api/crm/engagements/tasks" + } ], + "x-hubspot-introduction" : "Use the tasks API to associate tasks with your CRM records. You can assign tasks to specific users in your account, keep track of their status, and organize them using different priorities and types." + }, + "servers" : [ { + "url" : "https://api.hubapi.com/crm/v3/objects/tasks" + } ], + "tags" : [ { + "name" : "Batch" + }, { + "name" : "Basic" + }, { + "name" : "Search" + } ], + "paths" : { + "/batch/read" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Read a batch of tasks by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/tasks/batch/read_read", + "parameters" : [ { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchReadInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + } + }, + "/{taskId}" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "Read", + "description" : "Read an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/tasks/{taskId}_getById", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object type", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + }, + "delete" : { + "tags" : [ "Basic" ], + "summary" : "Archive", + "description" : "Move an Object identified by `{taskId}` to the recycling bin.", + "operationId" : "delete-/crm/v3/objects/tasks/{taskId}_archive", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + }, + "patch" : { + "tags" : [ "Basic" ], + "summary" : "Update", + "description" : "Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.", + "operationId" : "patch-/crm/v3/objects/tasks/{taskId}_update", + "parameters" : [ { + "name" : "taskId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object type", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/archive" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Archive a batch of tasks by ID", + "operationId" : "post-/crm/v3/objects/tasks/batch/archive_archive", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/create" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create a batch of tasks", + "operationId" : "post-/crm/v3/objects/tasks/batch/create_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/update" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Update a batch of tasks by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/tasks/batch/update_update", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "List", + "description" : "Read a page of tasks. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/tasks_getPage", + "parameters" : [ { + "name" : "limit", + "in" : "query", + "description" : "The maximum number of results to display per page.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "after", + "in" : "query", + "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ] + }, + "post" : { + "tags" : [ "Basic" ], + "summary" : "Create", + "description" : "Create a task with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tasks is provided.", + "operationId" : "post-/crm/v3/objects/tasks_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/batch/upsert" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create or update a batch of tasks by unique property values", + "description" : "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.", + "operationId" : "post-/crm/v3/objects/tasks/batch/upsert_upsert", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInputUpsert" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.write" ] + }, { + "private_apps" : [ "crm.objects.contacts.write" ] + } ] + } + }, + "/search" : { + "post" : { + "tags" : [ "Search" ], + "operationId" : "post-/crm/v3/objects/tasks/search_doSearch", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicObjectSearchRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseWithTotalSimplePublicObjectForwardPaging" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.contacts.read" ] + }, { + "private_apps" : [ "crm.objects.contacts.read" ] + } ], + "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] + } + } + }, + "components" : { + "schemas" : { + "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" + } + } + }, + "CollectionResponseAssociatedId" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/Paging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociatedId" + } + } + } + }, + "PublicAssociationsForObject" : { + "required" : [ "to", "types" ], + "type" : "object", + "properties" : { + "types" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociationSpec" + } + }, + "to" : { + "$ref" : "#/components/schemas/PublicObjectId" + } + } + }, + "BatchResponseSimplePublicObject" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "datetime" + }, + "requestedAt" : { + "type" : "string", + "format" : "datetime" + }, + "startedAt" : { + "type" : "string", + "format" : "datetime" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "FilterGroup" : { + "required" : [ "filters" ], + "type" : "object", + "properties" : { + "filters" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Filter" + } + } + } + }, + "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" + } + } + }, + "ForwardPaging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + } + } + }, + "SimplePublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "BatchResponseSimplePublicUpsertObjectWithErrors" : { + "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/SimplePublicUpsertObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchReadInputSimplePublicObjectId" : { + "required" : [ "inputs", "properties", "propertiesWithHistory" ], + "type" : "object", + "properties" : { + "propertiesWithHistory" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "idProperty" : { + "type" : "string" + }, + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicUpsertObject" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "datetime" + }, + "requestedAt" : { + "type" : "string", + "format" : "datetime" + }, + "startedAt" : { + "type" : "string", + "format" : "datetime" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicUpsertObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchInputSimplePublicObjectId" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + } + } + }, + "ValueWithTimestamp" : { + "required" : [ "sourceType", "timestamp", "value" ], + "type" : "object", + "properties" : { + "sourceId" : { + "type" : "string" + }, + "sourceType" : { + "type" : "string" + }, + "sourceLabel" : { + "type" : "string" + }, + "updatedByUserId" : { + "type" : "integer", + "format" : "int32" + }, + "value" : { + "type" : "string" + }, + "timestamp" : { + "type" : "string", + "format" : "datetime" + } + } + }, + "BatchInputSimplePublicObjectBatchInputUpsert" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInputUpsert" + } + } + } + }, + "CollectionResponseWithTotalSimplePublicObjectForwardPaging" : { + "required" : [ "results", "total" ], + "type" : "object", + "properties" : { + "total" : { + "type" : "integer", + "format" : "int32" + }, + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "SimplePublicObject" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "datetime" + }, + "archived" : { + "type" : "boolean", + "example" : false + }, + "archivedAt" : { + "type" : "string", + "format" : "datetime" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string", + "example" : "512" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "datetime" + } + }, + "example" : { + "id" : "512", + "properties" : { + "createdate" : "2019-10-30T03:30:17.883Z", + "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", + "hs_task_body" : "Send Proposal", + "hs_task_priority" : "HIGH", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hubspot_owner_id" : "64492917" + }, + "createdAt" : "2019-10-30T03:30:17.883Z", + "updatedAt" : "2019-12-07T16:50:06.678Z", + "archived" : false + } + }, + "PublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "Paging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + }, + "prev" : { + "$ref" : "#/components/schemas/PreviousPage" + } + } + }, + "PublicObjectSearchRequest" : { + "type" : "object", + "properties" : { + "query" : { + "type" : "string" + }, + "limit" : { + "type" : "integer", + "format" : "int32" + }, + "after" : { + "type" : "string" + }, + "sorts" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "filterGroups" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/FilterGroup" + } + } + } + }, + "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" + } + } + }, + "SimplePublicObjectBatchInputUpsert" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicObjectWithErrors" : { + "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/SimplePublicObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "SimplePublicObjectInput" : { + "required" : [ "properties" ], + "type" : "object", + "properties" : { + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + } + }, + "example" : { + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + }, + "associations" : [ { + "to" : { + "id" : "101" + }, + "types" : [ { + "associationCategory" : "HUBSPOT_DEFINED", + "associationTypeId" : 2 + } ] + } ] + } + }, + "CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "AssociationSpec" : { + "required" : [ "associationCategory", "associationTypeId" ], + "type" : "object", + "properties" : { + "associationCategory" : { + "type" : "string", + "enum" : [ "HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED" ] + }, + "associationTypeId" : { + "type" : "integer", + "format" : "int32" + } + } + }, + "SimplePublicObjectWithAssociations" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/CollectionResponseAssociatedId" + } + }, + "createdAt" : { + "type" : "string", + "format" : "datetime" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "datetime" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + } + }, + "updatedAt" : { + "type" : "string", + "format" : "datetime" + } + }, + "example" : { + "properties" : { + "createdate" : "2019-10-30T03:30:17.883Z", + "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", + "hs_task_body" : "Send Proposal", + "hs_task_priority" : "HIGH", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hubspot_owner_id" : "64492917" + } + } + }, + "Filter" : { + "required" : [ "operator", "propertyName" ], + "type" : "object", + "properties" : { + "highValue" : { + "type" : "string" + }, + "propertyName" : { + "type" : "string" + }, + "values" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "value" : { + "type" : "string" + }, + "operator" : { + "type" : "string", + "description" : "null", + "enum" : [ "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN" ] + } + } + }, + "BatchInputSimplePublicObjectBatchInput" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInput" + } + } + } + }, + "BatchInputSimplePublicObjectInputForCreate" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + } + }, + "PreviousPage" : { + "required" : [ "before" ], + "type" : "object", + "properties" : { + "before" : { + "type" : "string" + }, + "link" : { + "type" : "string" + } + } + }, + "SimplePublicUpsertObject" : { + "required" : [ "createdAt", "id", "new", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "datetime" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "datetime" + }, + "new" : { + "type" : "boolean" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "datetime" + } + } + }, + "SimplePublicObjectBatchInput" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string", + "example" : "my_unique_property_name" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "example" : { + "id" : "1", + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + } + } + }, + "AssociatedId" : { + "required" : [ "id", "type" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "type" : { + "type" : "string" + } + } + }, + "NextPage" : { + "required" : [ "after" ], + "type" : "object", + "properties" : { + "link" : { + "type" : "string", + "example" : "?after=NTI1Cg%3D%3D" + }, + "after" : { + "type" : "string", + "example" : "NTI1Cg%3D%3D" + } + }, + "example" : { + "after" : "NTI1Cg%3D%3D", + "link" : "?after=NTI1Cg%3D%3D" + } + }, + "SimplePublicObjectInputForCreate" : { + "required" : [ "associations", "properties" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicAssociationsForObject" + } + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "example" : { + "properties" : { + "hs_task_body" : "Send Proposal", + "hs_timestamp" : "2019-10-30T03:30:17.883Z", + "hs_task_status" : "WAITING", + "hs_task_subject" : "Follow-up for Brian Buyer", + "hs_task_priority" : "HIGH", + "hubspot_owner_id" : "64492917" + }, + "associations" : [ { + "to" : { + "id" : "101" + }, + "types" : [ { + "associationCategory" : "HUBSPOT_DEFINED", + "associationTypeId" : 2 + } ] + } ] + } + } + }, + "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" : { + "e-commerce" : "e-commerce", + "crm.objects.custom.write" : "Change custom object records", + "media_bridge.read" : "Read media and media events", + "crm.objects.goals.read" : "Read goals", + "tickets" : "Read and write tickets", + "crm.objects.custom.read" : "View custom object records" + } + } + } + }, + "oauth2" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "crm.objects.contacts.read" : " ", + "crm.objects.listings.read" : "Read listings", + "crm.objects.carts.write" : "Write cart", + "crm.objects.courses.write" : "Write courses", + "crm.objects.quotes.write" : "Quotes", + "crm.objects.users.read" : "Read User CRM objects", + "crm.objects.companies.read" : " ", + "crm.objects.appointments.read" : "Read appointments", + "crm.objects.partner-clients.write" : "Modify Partner Client CRM objects", + "crm.objects.leads.read" : "Read lead objects", + "crm.objects.appointments.write" : "Write appointments", + "crm.objects.services.write" : "Write services", + "crm.objects.line_items.read" : "Line Items", + "crm.objects.courses.read" : "Read courses", + "crm.objects.deals.read" : " ", + "crm.objects.invoices.read" : "Read invoices objects", + "crm.objects.partner-clients.read" : "View Partner Client CRM objects", + "crm.objects.deals.write" : " ", + "crm.objects.line_items.write" : "Line Items", + "crm.objects.listings.write" : "Write listings", + "crm.objects.companies.write" : " ", + "crm.objects.contacts.write" : " ", + "crm.objects.users.write" : "Write User CRM objects", + "crm.objects.commercepayments.read" : "Read the COMMERCE_PAYMENT object.", + "crm.objects.leads.write" : "Modify lead objects", + "crm.objects.subscriptions.read" : "Read Commerce Subscriptions", + "crm.objects.carts.read" : "Read carts", + "crm.objects.orders.write" : "Write orders", + "crm.objects.quotes.read" : "Quotes", + "crm.objects.services.read" : "Read services", + "crm.objects.orders.read" : "Read Orders" + } + } + } + }, + "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" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE" +} \ No newline at end of file diff --git a/docs/spec/sanitations.md b/docs/spec/sanitations.md index eb093a7..3fcf215 100644 --- a/docs/spec/sanitations.md +++ b/docs/spec/sanitations.md @@ -1,24 +1,40 @@ -_Author_: \ -_Created_: \ -_Updated_: \ +_Author_:@ChathuraIshara \ +_Created_:2025/02/14\ +_Updated_:2025/02/14\ _Edition_: Swan Lake # Sanitation for OpenAPI specification This document records the sanitation done on top of the official OpenAPI specification from HubSpot CRM Tasks. -The OpenAPI specification is obtained from (TODO: Add source link). +The OpenAPI specification is obtained from (https://github.com/HubSpot/HubSpot-public-api-spec-collection/blob/main/PublicApiSpecs/CRM/Tasks/Rollouts/424/v3/tasks.json). These changes are done in order to improve the overall usability, and as workarounds for some known language limitations. [//]: # (TODO: Add sanitation details) -1. -2. -3. +1. Change the url property of the servers object + +* Original: https://api.hubapi.com +* Updated: https://api.hubapi.com/crm/v3/objects/tasks +* Reason: This change of adding the common prefix /crm/v3/objects/tasks to the base url makes it easier to access endpoints using the client. + +2. Update the API Paths + +* Original: Paths included common prefix above in each endpoint. (eg: /crm/v3/objects/tasks) +* Updated: Common prefix is now removed from the endpoints as it is included in the base URL. + * Original: /crm/v3/objects/tasks + * Updated: / +* Reason: This change simplifies the API paths, making them shorter and more readable. + +3. Update the date-time into datetime to make it compatible with the ballerina type conversions + +* Original: foramt:date-time +* Updated: foramt:datetime +* Reason: The date-time format is not compatible with the openAPI generation tool. Therefore, it is updated to datetime to make it compatible with the generation tool. ## OpenAPI cli command The following command was used to generate the Ballerina client from the OpenAPI specification. The command should be executed from the repository root directory. ```bash -# TODO: Add OpenAPI CLI command used to generate the client +bal openapi -i docs/spec/tasks.json --mode client --license docs/license.txt -o ballerina ``` -Note: The license year is hardcoded to 2024, change if necessary. +Note: The license year is hardcoded to 2025, change if necessary. diff --git a/docs/spec/tasks.json b/docs/spec/tasks.json index b0349b1..1dc12cf 100644 --- a/docs/spec/tasks.json +++ b/docs/spec/tasks.json @@ -19,7 +19,7 @@ "x-hubspot-introduction" : "Use the tasks API to associate tasks with your CRM records. You can assign tasks to specific users in your account, keep track of their status, and organize them using different priorities and types." }, "servers" : [ { - "url" : "https://api.hubapi.com" + "url" : "https://api.hubapi.com/crm/v3/objects/tasks" } ], "tags" : [ { "name" : "Batch" @@ -29,7 +29,7 @@ "name" : "Search" } ], "paths" : { - "/crm/v3/objects/tasks/batch/read" : { + "/batch/read" : { "post" : { "tags" : [ "Batch" ], "summary" : "Read a batch of tasks by internal ID, or unique property values", @@ -88,7 +88,7 @@ } ] } }, - "/crm/v3/objects/tasks/{taskId}" : { + "/{taskId}" : { "get" : { "tags" : [ "Basic" ], "summary" : "Read", @@ -272,7 +272,7 @@ } ] } }, - "/crm/v3/objects/tasks/batch/archive" : { + "/batch/archive" : { "post" : { "tags" : [ "Batch" ], "summary" : "Archive a batch of tasks by ID", @@ -304,7 +304,7 @@ } ] } }, - "/crm/v3/objects/tasks/batch/create" : { + "/batch/create" : { "post" : { "tags" : [ "Batch" ], "summary" : "Create a batch of tasks", @@ -352,7 +352,7 @@ } ] } }, - "/crm/v3/objects/tasks/batch/update" : { + "/batch/update" : { "post" : { "tags" : [ "Batch" ], "summary" : "Update a batch of tasks by internal ID, or unique property values", @@ -400,7 +400,7 @@ } ] } }, - "/crm/v3/objects/tasks" : { + "/" : { "get" : { "tags" : [ "Basic" ], "summary" : "List", @@ -538,7 +538,7 @@ } ] } }, - "/crm/v3/objects/tasks/batch/upsert" : { + "/batch/upsert" : { "post" : { "tags" : [ "Batch" ], "summary" : "Create or update a batch of tasks by unique property values", @@ -587,7 +587,7 @@ } ] } }, - "/crm/v3/objects/tasks/search" : { + "/search" : { "post" : { "tags" : [ "Search" ], "operationId" : "post-/crm/v3/objects/tasks/search_doSearch", @@ -707,15 +707,15 @@ "properties" : { "completedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "requestedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "startedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "links" : { "type" : "object", @@ -805,7 +805,7 @@ "properties" : { "completedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "numErrors" : { "type" : "integer", @@ -813,11 +813,11 @@ }, "requestedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "startedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "links" : { "type" : "object", @@ -876,15 +876,15 @@ "properties" : { "completedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "requestedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "startedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "links" : { "type" : "object", @@ -938,7 +938,7 @@ }, "timestamp" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" } } }, @@ -979,7 +979,7 @@ "properties" : { "createdAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "archived" : { "type" : "boolean", @@ -987,7 +987,7 @@ }, "archivedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "propertiesWithHistory" : { "type" : "object", @@ -1020,7 +1020,7 @@ }, "updatedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" } }, "example" : { @@ -1185,7 +1185,7 @@ "properties" : { "completedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "numErrors" : { "type" : "integer", @@ -1193,11 +1193,11 @@ }, "requestedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "startedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "links" : { "type" : "object", @@ -1307,14 +1307,14 @@ }, "createdAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "archived" : { "type" : "boolean" }, "archivedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "propertiesWithHistory" : { "type" : "object", @@ -1337,7 +1337,7 @@ }, "updatedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" } }, "example" : { @@ -1421,14 +1421,14 @@ "properties" : { "createdAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "archived" : { "type" : "boolean" }, "archivedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" }, "new" : { "type" : "boolean" @@ -1453,7 +1453,7 @@ }, "updatedAt" : { "type" : "string", - "format" : "date-time" + "format" : "datetime" } } }, From faa9d95249cf1f89a1c1f2f2344dbab1e717a777 Mon Sep 17 00:00:00 2001 From: ChathuraIshara Date: Fri, 14 Feb 2025 13:31:40 +0530 Subject: [PATCH 3/6] generate client --- ballerina/client.bal | 234 +++++++++++++++++++++++++++ ballerina/types.bal | 369 +++++++++++++++++++++++++++++++++++++++++++ ballerina/utils.bal | 219 +++++++++++++++++++++++++ 3 files changed, 822 insertions(+) create mode 100644 ballerina/types.bal create mode 100644 ballerina/utils.bal diff --git a/ballerina/client.bal b/ballerina/client.bal index c000777..777eb6d 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -1,3 +1,6 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + // Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). // // WSO2 LLC. licenses this file to you under the Apache License, @@ -13,3 +16,234 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. + +import ballerina/http; + +public isolated client class Client { + final http:Client clientEp; + final readonly & ApiKeysConfig? apiKeyConfig; + # Gets invoked to initialize the `connector`. + # + # + config - The configurations to be used when initializing the `connector` + # + 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/crm/v3/objects/tasks") 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); + } + } + 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; + } + + # Archive + # + # + headers - Headers to be sent with the request + # + return - No content + resource isolated function delete [string taskId](map headers = {}) returns http:Response|error { + string resourcePath = string `/${getEncodedUri(taskId)}`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->delete(resourcePath, headers = httpHeaders); + } + + # List + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - successful operation + resource isolated function get .(map headers = {}, *GetCrmV3ObjectsTasksGetPageQueries queries) returns CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error { + string resourcePath = string `/`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + map queryParamEncoding = {"properties": {style: FORM, explode: true}, "propertiesWithHistory": {style: FORM, explode: true}, "associations": {style: FORM, explode: true}}; + resourcePath = resourcePath + check getPathForQueryParam(queries, queryParamEncoding); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->get(resourcePath, httpHeaders); + } + + # Read + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - successful operation + resource isolated function get [string taskId](map headers = {}, *GetCrmV3ObjectsTasksTaskIdGetByIdQueries queries) returns SimplePublicObjectWithAssociations|error { + string resourcePath = string `/${getEncodedUri(taskId)}`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + map queryParamEncoding = {"properties": {style: FORM, explode: true}, "propertiesWithHistory": {style: FORM, explode: true}, "associations": {style: FORM, explode: true}}; + resourcePath = resourcePath + check getPathForQueryParam(queries, queryParamEncoding); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->get(resourcePath, httpHeaders); + } + + # Update + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - successful operation + resource isolated function patch [string taskId](SimplePublicObjectInput payload, map headers = {}, *PatchCrmV3ObjectsTasksTaskIdUpdateQueries queries) returns SimplePublicObject|error { + string resourcePath = string `/${getEncodedUri(taskId)}`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + resourcePath = resourcePath + check getPathForQueryParam(queries); + map httpHeaders = http:getHeaderMap(headerValues); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->patch(resourcePath, request, httpHeaders); + } + + # Create + # + # + headers - Headers to be sent with the request + # + return - successful operation + resource isolated function post .(SimplePublicObjectInputForCreate payload, map headers = {}) returns SimplePublicObject|error { + string resourcePath = string `/`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + 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); + } + + # Archive a batch of tasks by ID + # + # + headers - Headers to be sent with the request + # + return - No content + resource isolated function post batch/archive(BatchInputSimplePublicObjectId payload, map headers = {}) returns http:Response|error { + string resourcePath = string `/batch/archive`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + 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); + } + + # Create a batch of tasks + # + # + headers - Headers to be sent with the request + # + return - successful operation + resource isolated function post batch/create(BatchInputSimplePublicObjectInputForCreate payload, map headers = {}) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { + string resourcePath = string `/batch/create`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + 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); + } + + # Read a batch of tasks by internal ID, or unique property values + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - successful operation + resource isolated function post batch/read(BatchReadInputSimplePublicObjectId payload, map headers = {}, *PostCrmV3ObjectsTasksBatchReadReadQueries queries) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { + string resourcePath = string `/batch/read`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + resourcePath = resourcePath + check getPathForQueryParam(queries); + 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); + } + + # Update a batch of tasks by internal ID, or unique property values + # + # + headers - Headers to be sent with the request + # + return - successful operation + resource isolated function post batch/update(BatchInputSimplePublicObjectBatchInput payload, map headers = {}) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { + string resourcePath = string `/batch/update`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + 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); + } + + # Create or update a batch of tasks by unique property values + # + # + headers - Headers to be sent with the request + # + return - successful operation + resource isolated function post batch/upsert(BatchInputSimplePublicObjectBatchInputUpsert payload, map headers = {}) returns BatchResponseSimplePublicUpsertObject|BatchResponseSimplePublicUpsertObjectWithErrors|error { + string resourcePath = string `/batch/upsert`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + 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); + } + + # + headers - Headers to be sent with the request + # + return - successful operation + resource isolated function post search(PublicObjectSearchRequest payload, map headers = {}) returns CollectionResponseWithTotalSimplePublicObjectForwardPaging|error { + string resourcePath = string `/search`; + map headerValues = {...headers}; + if self.apiKeyConfig is ApiKeysConfig { + headerValues["private-app"] = self.apiKeyConfig?.private\-app; + } + 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); + } +} diff --git a/ballerina/types.bal b/ballerina/types.bal new file mode 100644 index 0000000..1b16a40 --- /dev/null +++ b/ballerina/types.bal @@ -0,0 +1,369 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +// Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; + +public type StandardError record { + record {} subCategory?; + record {|string[]...;|} context; + record {|string...;|} links; + string id?; + string category; + string message; + ErrorDetail[] errors; + string status; +}; + +# Represents the Queries record for the operation: patch-/crm/v3/objects/tasks/{taskId}_update +public type PatchCrmV3ObjectsTasksTaskIdUpdateQueries record { + # The name of a property whose values are unique for this object type + string idProperty?; +}; + +public type CollectionResponseAssociatedId record { + Paging paging?; + AssociatedId[] results; +}; + +# Represents the Queries record for the operation: get-/crm/v3/objects/tasks_getPage +public type GetCrmV3ObjectsTasksGetPageQueries record { + # A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. + string[] associations?; + # Whether to return only results that have been archived. + boolean archived = false; + # A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. + string[] propertiesWithHistory?; + # The maximum number of results to display per page. + int:Signed32 'limit = 10; + # The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. + string after?; + # A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. + string[] properties?; +}; + +public type PublicAssociationsForObject record { + AssociationSpec[] types; + PublicObjectId to; +}; + +public type BatchResponseSimplePublicObject record { + string completedAt; + string requestedAt?; + string startedAt; + record {|string...;|} links?; + SimplePublicObject[] results; + "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; +}; + +public type FilterGroup record { + Filter[] filters; +}; + +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. + string 'in?; + # Context about the error condition + record {|string[]...;|} context?; + # A human readable message describing the error along with remediation steps where appropriate + string message; +}; + +public type ForwardPaging record { + NextPage next?; +}; + +public type SimplePublicObjectId record { + string id; +}; + +public type BatchResponseSimplePublicUpsertObjectWithErrors record { + string completedAt; + int:Signed32 numErrors?; + string requestedAt?; + string startedAt; + record {|string...;|} links?; + SimplePublicUpsertObject[] results; + StandardError[] errors?; + "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; +}; + +# Represents the Queries record for the operation: get-/crm/v3/objects/tasks/{taskId}_getById +public type GetCrmV3ObjectsTasksTaskIdGetByIdQueries record { + # A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. + string[] associations?; + # Whether to return only results that have been archived. + boolean archived = false; + # A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. + string[] propertiesWithHistory?; + # The name of a property whose values are unique for this object type + string idProperty?; + # A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. + string[] properties?; +}; + +public type BatchReadInputSimplePublicObjectId record { + string[] propertiesWithHistory; + string idProperty?; + SimplePublicObjectId[] inputs; + string[] properties; +}; + +public type BatchResponseSimplePublicUpsertObject record { + string completedAt; + string requestedAt?; + string startedAt; + record {|string...;|} links?; + SimplePublicUpsertObject[] results; + "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; +}; + +public type ValueWithTimestamp record { + string sourceId?; + string sourceType; + string sourceLabel?; + int:Signed32 updatedByUserId?; + string value; + string timestamp; +}; + +public type BatchInputSimplePublicObjectId record { + SimplePublicObjectId[] inputs; +}; + +# OAuth2 Refresh Token Grant Configs +public type OAuth2RefreshTokenGrantConfig record {| + *http:OAuth2RefreshTokenGrantConfig; + # Refresh URL + string refreshUrl = "https://api.hubapi.com/oauth/v1/token"; +|}; + +public type BatchInputSimplePublicObjectBatchInputUpsert record { + SimplePublicObjectBatchInputUpsert[] inputs; +}; + +public type CollectionResponseWithTotalSimplePublicObjectForwardPaging record { + int:Signed32 total; + ForwardPaging paging?; + SimplePublicObject[] results; +}; + +public type SimplePublicObject record { + string createdAt; + boolean archived?; + string archivedAt?; + record {|ValueWithTimestamp[]...;|} propertiesWithHistory?; + string id; + record {|string?...;|} properties; + string updatedAt; +}; + +# Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint. +@display {label: "Connection Config"} +public type ConnectionConfig record {| + # Provides Auth configurations needed when communicating with a remote HTTP endpoint. + http:BearerTokenConfig|OAuth2RefreshTokenGrantConfig|ApiKeysConfig auth; + # The HTTP version understood by the client + http:HttpVersion httpVersion = http:HTTP_2_0; + # Configurations related to HTTP/1.x protocol + ClientHttp1Settings http1Settings?; + # Configurations related to HTTP/2 protocol + http:ClientHttp2Settings http2Settings?; + # The maximum time to wait (in seconds) for a response before closing the connection + decimal timeout = 60; + # The choice of setting `forwarded`/`x-forwarded` header + string forwarded = "disable"; + # Configurations associated with request pooling + http:PoolConfiguration poolConfig?; + # HTTP caching related configurations + 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 inbound response size limits + http:ResponseLimitConfigs responseLimits?; + # SSL/TLS-related options + http:ClientSecureSocket secureSocket?; + # Proxy server related options + http:ProxyConfig proxy?; + # 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, + # and absent fields are handled as `nilable` types. Enabled by default. + boolean laxDataBinding = true; +|}; + +public type PublicObjectId record { + string id; +}; + +public type Paging record { + NextPage next?; + PreviousPage prev?; +}; + +public type PublicObjectSearchRequest record { + string query?; + int:Signed32 'limit?; + string after?; + string[] sorts?; + string[] properties?; + FilterGroup[] filterGroups?; +}; + +public type SimplePublicObjectBatchInputUpsert record { + string idProperty?; + string objectWriteTraceId?; + string id; + record {|string...;|} properties; +}; + +# Represents the Queries record for the operation: post-/crm/v3/objects/tasks/batch/read_read +public type PostCrmV3ObjectsTasksBatchReadReadQueries record { + # Whether to return only results that have been archived. + boolean archived = false; +}; + +public type BatchResponseSimplePublicObjectWithErrors record { + string completedAt; + int:Signed32 numErrors?; + string requestedAt?; + string startedAt; + record {|string...;|} links?; + SimplePublicObject[] results; + StandardError[] errors?; + "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; +}; + +# 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 = ""; +|}; + +public type SimplePublicObjectInput record { + string objectWriteTraceId?; + record {|string...;|} properties; +}; + +public type CollectionResponseSimplePublicObjectWithAssociationsForwardPaging record { + ForwardPaging paging?; + SimplePublicObjectWithAssociations[] results; +}; + +public type AssociationSpec record { + "HUBSPOT_DEFINED"|"USER_DEFINED"|"INTEGRATOR_DEFINED" associationCategory; + int:Signed32 associationTypeId; +}; + +public type SimplePublicObjectWithAssociations record { + record {|CollectionResponseAssociatedId...;|} associations?; + string createdAt; + boolean archived?; + string archivedAt?; + record {|ValueWithTimestamp[]...;|} propertiesWithHistory?; + string id; + record {|string?...;|} properties; + string updatedAt; +}; + +public type Filter record { + string highValue?; + string propertyName; + string[] values?; + string value?; + # null + "EQ"|"NEQ"|"LT"|"LTE"|"GT"|"GTE"|"BETWEEN"|"IN"|"NOT_IN"|"HAS_PROPERTY"|"NOT_HAS_PROPERTY"|"CONTAINS_TOKEN"|"NOT_CONTAINS_TOKEN" operator; +}; + +# 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 PreviousPage record { + string before; + string link?; +}; + +public type BatchInputSimplePublicObjectBatchInput record { + SimplePublicObjectBatchInput[] inputs; +}; + +public type BatchInputSimplePublicObjectInputForCreate record { + SimplePublicObjectInputForCreate[] inputs; +}; + +public type SimplePublicUpsertObject record { + string createdAt; + boolean archived?; + string archivedAt?; + boolean 'new; + record {|ValueWithTimestamp[]...;|} propertiesWithHistory?; + string id; + record {|string...;|} properties; + string updatedAt; +}; + +public type SimplePublicObjectBatchInput record { + string idProperty?; + string objectWriteTraceId?; + string id; + record {|string...;|} properties; +}; + +public type NextPage record { + string link?; + string after; +}; + +public type AssociatedId record { + string id; + string 'type; +}; + +# Provides API key configurations needed when communicating with a remote HTTP endpoint. +public type ApiKeysConfig record {| + string private\-app\-legacy; + string private\-app; +|}; + +public type SimplePublicObjectInputForCreate record { + PublicAssociationsForObject[] associations; + string objectWriteTraceId?; + record {|string...;|} properties; +}; diff --git a/ballerina/utils.bal b/ballerina/utils.bal new file mode 100644 index 0000000..8269f00 --- /dev/null +++ b/ballerina/utils.bal @@ -0,0 +1,219 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +// Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; +import ballerina/url; + +type SimpleBasicType string|boolean|int|float|decimal; + +# Represents encoding mechanism details. +type Encoding record { + # Defines how multiple values are delimited + string style = FORM; + # Specifies whether arrays and objects should generate as separate fields + boolean explode = true; + # Specifies the custom content type + string contentType?; + # Specifies the custom headers + map headers?; +}; + +enum EncodingStyle { + DEEPOBJECT, FORM, SPACEDELIMITED, PIPEDELIMITED +} + +final Encoding & readonly defaultEncoding = {}; + +# Serialize the record according to the deepObject style. +# +# + parent - Parent record name +# + anyRecord - Record to be serialized +# + return - Serialized record as a string +isolated function getDeepObjectStyleRequest(string parent, record {} anyRecord) returns string { + string[] recordArray = []; + foreach [string, anydata] [key, value] in anyRecord.entries() { + if value is SimpleBasicType { + recordArray.push(parent + "[" + key + "]" + "=" + getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + recordArray.push(getSerializedArray(parent + "[" + key + "]" + "[]", value, DEEPOBJECT, true)); + } else if value is record {} { + string nextParent = parent + "[" + key + "]"; + recordArray.push(getDeepObjectStyleRequest(nextParent, value)); + } else if value is record {}[] { + string nextParent = parent + "[" + key + "]"; + recordArray.push(getSerializedRecordArray(nextParent, value, DEEPOBJECT)); + } + recordArray.push("&"); + } + _ = recordArray.pop(); + return string:'join("", ...recordArray); +} + +# Serialize the record according to the form style. +# +# + parent - Parent record name +# + anyRecord - Record to be serialized +# + explode - Specifies whether arrays and objects should generate separate parameters +# + return - Serialized record as a string +isolated function getFormStyleRequest(string parent, record {} anyRecord, boolean explode = true) returns string { + string[] recordArray = []; + if explode { + foreach [string, anydata] [key, value] in anyRecord.entries() { + if value is SimpleBasicType { + recordArray.push(key, "=", getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + recordArray.push(getSerializedArray(key, value, explode = explode)); + } else if value is record {} { + recordArray.push(getFormStyleRequest(parent, value, explode)); + } + recordArray.push("&"); + } + _ = recordArray.pop(); + } else { + foreach [string, anydata] [key, value] in anyRecord.entries() { + if value is SimpleBasicType { + recordArray.push(key, ",", getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + recordArray.push(getSerializedArray(key, value, explode = false)); + } else if value is record {} { + recordArray.push(getFormStyleRequest(parent, value, explode)); + } + recordArray.push(","); + } + _ = recordArray.pop(); + } + return string:'join("", ...recordArray); +} + +# Serialize arrays. +# +# + arrayName - Name of the field with arrays +# + anyArray - Array to be serialized +# + style - Defines how multiple values are delimited +# + explode - Specifies whether arrays and objects should generate separate parameters +# + return - Serialized array as a string +isolated function getSerializedArray(string arrayName, anydata[] anyArray, string style = "form", boolean explode = true) returns string { + string key = arrayName; + string[] arrayValues = []; + if anyArray.length() > 0 { + if style == FORM && !explode { + arrayValues.push(key, "="); + foreach anydata i in anyArray { + arrayValues.push(getEncodedUri(i.toString()), ","); + } + } else if style == SPACEDELIMITED && !explode { + arrayValues.push(key, "="); + foreach anydata i in anyArray { + arrayValues.push(getEncodedUri(i.toString()), "%20"); + } + } else if style == PIPEDELIMITED && !explode { + arrayValues.push(key, "="); + foreach anydata i in anyArray { + arrayValues.push(getEncodedUri(i.toString()), "|"); + } + } else if style == DEEPOBJECT { + foreach anydata i in anyArray { + arrayValues.push(key, "[]", "=", getEncodedUri(i.toString()), "&"); + } + } else { + foreach anydata i in anyArray { + arrayValues.push(key, "=", getEncodedUri(i.toString()), "&"); + } + } + _ = arrayValues.pop(); + } + return string:'join("", ...arrayValues); +} + +# Serialize the array of records according to the form style. +# +# + parent - Parent record name +# + value - Array of records to be serialized +# + style - Defines how multiple values are delimited +# + explode - Specifies whether arrays and objects should generate separate parameters +# + return - Serialized record as a string +isolated function getSerializedRecordArray(string parent, record {}[] value, string style = FORM, boolean explode = true) returns string { + string[] serializedArray = []; + if style == DEEPOBJECT { + int arayIndex = 0; + foreach var recordItem in value { + serializedArray.push(getDeepObjectStyleRequest(parent + "[" + arayIndex.toString() + "]", recordItem), "&"); + arayIndex = arayIndex + 1; + } + } else { + if !explode { + serializedArray.push(parent, "="); + } + foreach var recordItem in value { + serializedArray.push(getFormStyleRequest(parent, recordItem, explode), ","); + } + } + _ = serializedArray.pop(); + return string:'join("", ...serializedArray); +} + +# Get Encoded URI for a given value. +# +# + value - Value to be encoded +# + return - Encoded string +isolated function getEncodedUri(anydata value) returns string { + string|error encoded = url:encode(value.toString(), "UTF8"); + if encoded is string { + return encoded; + } else { + return value.toString(); + } +} + +# Generate query path with query parameter. +# +# + queryParam - Query parameter map +# + encodingMap - Details on serialization mechanism +# + return - Returns generated Path or error at failure of client initialization +isolated function getPathForQueryParam(map queryParam, map encodingMap = {}) returns string|error { + map queriesMap = http:getQueryMap(queryParam); + string[] param = []; + if queriesMap.length() > 0 { + param.push("?"); + foreach var [key, value] in queriesMap.entries() { + if value is () { + _ = queriesMap.remove(key); + continue; + } + Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : defaultEncoding; + if value is SimpleBasicType { + param.push(key, "=", getEncodedUri(value.toString())); + } else if value is SimpleBasicType[] { + param.push(getSerializedArray(key, value, encodingData.style, encodingData.explode)); + } else if value is record {} { + if encodingData.style == DEEPOBJECT { + param.push(getDeepObjectStyleRequest(key, value)); + } else { + param.push(getFormStyleRequest(key, value, encodingData.explode)); + } + } else { + param.push(key, "=", value.toString()); + } + param.push("&"); + } + _ = param.pop(); + } + string restOfPath = string:'join("", ...param); + return restOfPath; +} From 0e0462cf8c595d0e46e6440c18b84f9cd67db2a6 Mon Sep 17 00:00:00 2001 From: ChathuraIshara Date: Sat, 15 Feb 2025 11:02:51 +0530 Subject: [PATCH 4/6] remove other OpenApispec files and update santiations --- docs/spec/aligned_ballerina_openapi.json | 1733 ---------------------- docs/spec/flattened_openapi.json | 1656 --------------------- docs/spec/sanitations.md | 20 +- docs/spec/tasks.json | 99 +- 4 files changed, 98 insertions(+), 3410 deletions(-) delete mode 100644 docs/spec/aligned_ballerina_openapi.json delete mode 100644 docs/spec/flattened_openapi.json diff --git a/docs/spec/aligned_ballerina_openapi.json b/docs/spec/aligned_ballerina_openapi.json deleted file mode 100644 index 7ac984a..0000000 --- a/docs/spec/aligned_ballerina_openapi.json +++ /dev/null @@ -1,1733 +0,0 @@ -{ - "openapi" : "3.0.1", - "info" : { - "title" : "Tasks", - "description" : "", - "version" : "v3", - "x-hubspot-product-tier-requirements" : { - "marketing" : "FREE", - "sales" : "FREE", - "service" : "FREE", - "cms" : "FREE" - }, - "x-hubspot-documentation-banner" : "NONE", - "x-hubspot-api-use-case" : "If you're using a third-party service for project management, you can create and manage any tasks associated with your CRM records by logging them in HubSpot.", - "x-hubspot-related-documentation" : [ { - "name" : "Tasks Guide", - "url" : "https://developers.hubspot.com/docs/guides/api/crm/engagements/tasks" - } ], - "x-hubspot-introduction" : "Use the tasks API to associate tasks with your CRM records. You can assign tasks to specific users in your account, keep track of their status, and organize them using different priorities and types." - }, - "servers" : [ { - "url" : "https://api.hubapi.com/crm/v3/objects/tasks" - } ], - "tags" : [ { - "name" : "Batch" - }, { - "name" : "Basic" - }, { - "name" : "Search" - } ], - "paths" : { - "/batch/read" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Read a batch of tasks by internal ID, or unique property values", - "operationId" : "post-/crm/v3/objects/tasks/batch/read_read", - "parameters" : [ { - "name" : "archived", - "in" : "query", - "description" : "Whether to return only results that have been archived.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "boolean", - "default" : false - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchReadInputSimplePublicObjectId" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ] - } - }, - "/{taskId}" : { - "get" : { - "tags" : [ "Basic" ], - "summary" : "Read", - "description" : "Read an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.", - "operationId" : "get-/crm/v3/objects/tasks/{taskId}_getById", - "parameters" : [ { - "name" : "taskId", - "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "properties", - "in" : "query", - "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "propertiesWithHistory", - "in" : "query", - "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "associations", - "in" : "query", - "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "archived", - "in" : "query", - "description" : "Whether to return only results that have been archived.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "boolean", - "default" : false - } - }, { - "name" : "idProperty", - "in" : "query", - "description" : "The name of a property whose values are unique for this object type", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ] - }, - "delete" : { - "tags" : [ "Basic" ], - "summary" : "Archive", - "description" : "Move an Object identified by `{taskId}` to the recycling bin.", - "operationId" : "delete-/crm/v3/objects/tasks/{taskId}_archive", - "parameters" : [ { - "name" : "taskId", - "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - }, - "patch" : { - "tags" : [ "Basic" ], - "summary" : "Update", - "description" : "Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.", - "operationId" : "patch-/crm/v3/objects/tasks/{taskId}_update", - "parameters" : [ { - "name" : "taskId", - "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "idProperty", - "in" : "query", - "description" : "The name of a property whose values are unique for this object type", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObjectInput" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/archive" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Archive a batch of tasks by ID", - "operationId" : "post-/crm/v3/objects/tasks/batch/archive_archive", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectId" - } - } - }, - "required" : true - }, - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/create" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Create a batch of tasks", - "operationId" : "post-/crm/v3/objects/tasks/batch/create_create", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectInputForCreate" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/update" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Update a batch of tasks by internal ID, or unique property values", - "operationId" : "post-/crm/v3/objects/tasks/batch/update_update", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInput" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/" : { - "get" : { - "tags" : [ "Basic" ], - "summary" : "List", - "description" : "Read a page of tasks. Control what is returned via the `properties` query param.", - "operationId" : "get-/crm/v3/objects/tasks_getPage", - "parameters" : [ { - "name" : "limit", - "in" : "query", - "description" : "The maximum number of results to display per page.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "integer", - "format" : "int32", - "default" : 10 - } - }, { - "name" : "after", - "in" : "query", - "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "properties", - "in" : "query", - "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "propertiesWithHistory", - "in" : "query", - "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "associations", - "in" : "query", - "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "archived", - "in" : "query", - "description" : "Whether to return only results that have been archived.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "boolean", - "default" : false - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ] - }, - "post" : { - "tags" : [ "Basic" ], - "summary" : "Create", - "description" : "Create a task with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tasks is provided.", - "operationId" : "post-/crm/v3/objects/tasks_create", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/upsert" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Create or update a batch of tasks by unique property values", - "description" : "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.", - "operationId" : "post-/crm/v3/objects/tasks/batch/upsert_upsert", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInputUpsert" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObjectWithErrors" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/search" : { - "post" : { - "tags" : [ "Search" ], - "operationId" : "post-/crm/v3/objects/tasks/search_doSearch", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PublicObjectSearchRequest" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CollectionResponseWithTotalSimplePublicObjectForwardPaging" - } - } - } - }, - "default" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - } - } - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ], - "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] - } - } - }, - "components" : { - "schemas" : { - "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" - } - } - }, - "CollectionResponseAssociatedId" : { - "required" : [ "results" ], - "type" : "object", - "properties" : { - "paging" : { - "$ref" : "#/components/schemas/Paging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/AssociatedId" - } - } - } - }, - "PublicAssociationsForObject" : { - "required" : [ "to", "types" ], - "type" : "object", - "properties" : { - "types" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/AssociationSpec" - } - }, - "to" : { - "$ref" : "#/components/schemas/PublicObjectId" - } - } - }, - "BatchResponseSimplePublicObject" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "datetime" - }, - "requestedAt" : { - "type" : "string", - "format" : "datetime" - }, - "startedAt" : { - "type" : "string", - "format" : "datetime" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "FilterGroup" : { - "required" : [ "filters" ], - "type" : "object", - "properties" : { - "filters" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Filter" - } - } - } - }, - "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" - } - } - }, - "ForwardPaging" : { - "type" : "object", - "properties" : { - "next" : { - "$ref" : "#/components/schemas/NextPage" - } - } - }, - "SimplePublicObjectId" : { - "required" : [ "id" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - } - } - }, - "BatchResponseSimplePublicUpsertObjectWithErrors" : { - "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/SimplePublicUpsertObject" - } - }, - "errors" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/StandardError" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "BatchReadInputSimplePublicObjectId" : { - "required" : [ "inputs", "properties", "propertiesWithHistory" ], - "type" : "object", - "properties" : { - "propertiesWithHistory" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "idProperty" : { - "type" : "string" - }, - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectId" - } - }, - "properties" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - } - }, - "BatchResponseSimplePublicUpsertObject" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "datetime" - }, - "requestedAt" : { - "type" : "string", - "format" : "datetime" - }, - "startedAt" : { - "type" : "string", - "format" : "datetime" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicUpsertObject" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "BatchInputSimplePublicObjectId" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectId" - } - } - } - }, - "ValueWithTimestamp" : { - "required" : [ "sourceType", "timestamp", "value" ], - "type" : "object", - "properties" : { - "sourceId" : { - "type" : "string" - }, - "sourceType" : { - "type" : "string" - }, - "sourceLabel" : { - "type" : "string" - }, - "updatedByUserId" : { - "type" : "integer", - "format" : "int32" - }, - "value" : { - "type" : "string" - }, - "timestamp" : { - "type" : "string", - "format" : "datetime" - } - } - }, - "BatchInputSimplePublicObjectBatchInputUpsert" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectBatchInputUpsert" - } - } - } - }, - "CollectionResponseWithTotalSimplePublicObjectForwardPaging" : { - "required" : [ "results", "total" ], - "type" : "object", - "properties" : { - "total" : { - "type" : "integer", - "format" : "int32" - }, - "paging" : { - "$ref" : "#/components/schemas/ForwardPaging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - } - } - }, - "SimplePublicObject" : { - "required" : [ "createdAt", "id", "properties", "updatedAt" ], - "type" : "object", - "properties" : { - "createdAt" : { - "type" : "string", - "format" : "datetime" - }, - "archived" : { - "type" : "boolean", - "example" : false - }, - "archivedAt" : { - "type" : "string", - "format" : "datetime" - }, - "propertiesWithHistory" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ValueWithTimestamp" - } - } - }, - "id" : { - "type" : "string", - "example" : "512" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "nullable" : true - }, - "example" : { - "property_date" : "1572480000000", - "property_radio" : "option_1", - "property_number" : "17", - "property_string" : "value", - "property_checkbox" : "false", - "property_dropdown" : "choice_b", - "property_multiple_checkboxes" : "chocolate;strawberry" - } - }, - "updatedAt" : { - "type" : "string", - "format" : "datetime" - } - }, - "example" : { - "id" : "512", - "properties" : { - "createdate" : "2019-10-30T03:30:17.883Z", - "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", - "hs_task_body" : "Send Proposal", - "hs_task_priority" : "HIGH", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hubspot_owner_id" : "64492917" - }, - "createdAt" : "2019-10-30T03:30:17.883Z", - "updatedAt" : "2019-12-07T16:50:06.678Z", - "archived" : false - } - }, - "PublicObjectId" : { - "required" : [ "id" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - } - } - }, - "Paging" : { - "type" : "object", - "properties" : { - "next" : { - "$ref" : "#/components/schemas/NextPage" - }, - "prev" : { - "$ref" : "#/components/schemas/PreviousPage" - } - } - }, - "PublicObjectSearchRequest" : { - "type" : "object", - "properties" : { - "query" : { - "type" : "string" - }, - "limit" : { - "type" : "integer", - "format" : "int32" - }, - "after" : { - "type" : "string" - }, - "sorts" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "properties" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "filterGroups" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/FilterGroup" - } - } - } - }, - "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" - } - } - }, - "SimplePublicObjectBatchInputUpsert" : { - "required" : [ "id", "properties" ], - "type" : "object", - "properties" : { - "idProperty" : { - "type" : "string" - }, - "objectWriteTraceId" : { - "type" : "string" - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - } - }, - "BatchResponseSimplePublicObjectWithErrors" : { - "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/SimplePublicObject" - } - }, - "errors" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/StandardError" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "SimplePublicObjectInput" : { - "required" : [ "properties" ], - "type" : "object", - "properties" : { - "objectWriteTraceId" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - }, - "example" : { - "property_date" : "1572480000000", - "property_radio" : "option_1", - "property_number" : "17", - "property_string" : "value", - "property_checkbox" : "false", - "property_dropdown" : "choice_b", - "property_multiple_checkboxes" : "chocolate;strawberry" - } - } - }, - "example" : { - "properties" : { - "hs_task_body" : "Send Proposal", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_task_priority" : "HIGH", - "hubspot_owner_id" : "64492917" - }, - "associations" : [ { - "to" : { - "id" : "101" - }, - "types" : [ { - "associationCategory" : "HUBSPOT_DEFINED", - "associationTypeId" : 2 - } ] - } ] - } - }, - "CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" : { - "required" : [ "results" ], - "type" : "object", - "properties" : { - "paging" : { - "$ref" : "#/components/schemas/ForwardPaging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" - } - } - } - }, - "AssociationSpec" : { - "required" : [ "associationCategory", "associationTypeId" ], - "type" : "object", - "properties" : { - "associationCategory" : { - "type" : "string", - "enum" : [ "HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED" ] - }, - "associationTypeId" : { - "type" : "integer", - "format" : "int32" - } - } - }, - "SimplePublicObjectWithAssociations" : { - "required" : [ "createdAt", "id", "properties", "updatedAt" ], - "type" : "object", - "properties" : { - "associations" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/components/schemas/CollectionResponseAssociatedId" - } - }, - "createdAt" : { - "type" : "string", - "format" : "datetime" - }, - "archived" : { - "type" : "boolean" - }, - "archivedAt" : { - "type" : "string", - "format" : "datetime" - }, - "propertiesWithHistory" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ValueWithTimestamp" - } - } - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "nullable" : true - } - }, - "updatedAt" : { - "type" : "string", - "format" : "datetime" - } - }, - "example" : { - "properties" : { - "createdate" : "2019-10-30T03:30:17.883Z", - "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", - "hs_task_body" : "Send Proposal", - "hs_task_priority" : "HIGH", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hubspot_owner_id" : "64492917" - } - } - }, - "Filter" : { - "required" : [ "operator", "propertyName" ], - "type" : "object", - "properties" : { - "highValue" : { - "type" : "string" - }, - "propertyName" : { - "type" : "string" - }, - "values" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "value" : { - "type" : "string" - }, - "operator" : { - "type" : "string", - "description" : "null", - "enum" : [ "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN" ] - } - } - }, - "BatchInputSimplePublicObjectBatchInput" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectBatchInput" - } - } - } - }, - "BatchInputSimplePublicObjectInputForCreate" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" - } - } - } - }, - "PreviousPage" : { - "required" : [ "before" ], - "type" : "object", - "properties" : { - "before" : { - "type" : "string" - }, - "link" : { - "type" : "string" - } - } - }, - "SimplePublicUpsertObject" : { - "required" : [ "createdAt", "id", "new", "properties", "updatedAt" ], - "type" : "object", - "properties" : { - "createdAt" : { - "type" : "string", - "format" : "datetime" - }, - "archived" : { - "type" : "boolean" - }, - "archivedAt" : { - "type" : "string", - "format" : "datetime" - }, - "new" : { - "type" : "boolean" - }, - "propertiesWithHistory" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ValueWithTimestamp" - } - } - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "updatedAt" : { - "type" : "string", - "format" : "datetime" - } - } - }, - "SimplePublicObjectBatchInput" : { - "required" : [ "id", "properties" ], - "type" : "object", - "properties" : { - "idProperty" : { - "type" : "string", - "example" : "my_unique_property_name" - }, - "objectWriteTraceId" : { - "type" : "string" - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - }, - "example" : { - "id" : "1", - "properties" : { - "hs_task_body" : "Send Proposal", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_task_priority" : "HIGH", - "hubspot_owner_id" : "64492917" - } - } - }, - "AssociatedId" : { - "required" : [ "id", "type" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "type" : { - "type" : "string" - } - } - }, - "NextPage" : { - "required" : [ "after" ], - "type" : "object", - "properties" : { - "link" : { - "type" : "string", - "example" : "?after=NTI1Cg%3D%3D" - }, - "after" : { - "type" : "string", - "example" : "NTI1Cg%3D%3D" - } - }, - "example" : { - "after" : "NTI1Cg%3D%3D", - "link" : "?after=NTI1Cg%3D%3D" - } - }, - "SimplePublicObjectInputForCreate" : { - "required" : [ "associations", "properties" ], - "type" : "object", - "properties" : { - "associations" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicAssociationsForObject" - } - }, - "objectWriteTraceId" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - }, - "example" : { - "properties" : { - "hs_task_body" : "Send Proposal", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_task_priority" : "HIGH", - "hubspot_owner_id" : "64492917" - }, - "associations" : [ { - "to" : { - "id" : "101" - }, - "types" : [ { - "associationCategory" : "HUBSPOT_DEFINED", - "associationTypeId" : 2 - } ] - } ] - } - } - }, - "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" : { - "e-commerce" : "e-commerce", - "crm.objects.custom.write" : "Change custom object records", - "media_bridge.read" : "Read media and media events", - "crm.objects.goals.read" : "Read goals", - "tickets" : "Read and write tickets", - "crm.objects.custom.read" : "View custom object records" - } - } - } - }, - "oauth2" : { - "type" : "oauth2", - "flows" : { - "authorizationCode" : { - "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", - "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", - "scopes" : { - "crm.objects.contacts.read" : " ", - "crm.objects.listings.read" : "Read listings", - "crm.objects.carts.write" : "Write cart", - "crm.objects.courses.write" : "Write courses", - "crm.objects.quotes.write" : "Quotes", - "crm.objects.users.read" : "Read User CRM objects", - "crm.objects.companies.read" : " ", - "crm.objects.appointments.read" : "Read appointments", - "crm.objects.partner-clients.write" : "Modify Partner Client CRM objects", - "crm.objects.leads.read" : "Read lead objects", - "crm.objects.appointments.write" : "Write appointments", - "crm.objects.services.write" : "Write services", - "crm.objects.line_items.read" : "Line Items", - "crm.objects.courses.read" : "Read courses", - "crm.objects.deals.read" : " ", - "crm.objects.invoices.read" : "Read invoices objects", - "crm.objects.partner-clients.read" : "View Partner Client CRM objects", - "crm.objects.deals.write" : " ", - "crm.objects.line_items.write" : "Line Items", - "crm.objects.listings.write" : "Write listings", - "crm.objects.companies.write" : " ", - "crm.objects.contacts.write" : " ", - "crm.objects.users.write" : "Write User CRM objects", - "crm.objects.commercepayments.read" : "Read the COMMERCE_PAYMENT object.", - "crm.objects.leads.write" : "Modify lead objects", - "crm.objects.subscriptions.read" : "Read Commerce Subscriptions", - "crm.objects.carts.read" : "Read carts", - "crm.objects.orders.write" : "Write orders", - "crm.objects.quotes.read" : "Quotes", - "crm.objects.services.read" : "Read services", - "crm.objects.orders.read" : "Read Orders" - } - } - } - }, - "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" : "FREE" - }, - "x-hubspot-documentation-banner" : "NONE" -} \ No newline at end of file diff --git a/docs/spec/flattened_openapi.json b/docs/spec/flattened_openapi.json deleted file mode 100644 index 1dc12cf..0000000 --- a/docs/spec/flattened_openapi.json +++ /dev/null @@ -1,1656 +0,0 @@ -{ - "openapi" : "3.0.1", - "info" : { - "title" : "Tasks", - "description" : "", - "version" : "v3", - "x-hubspot-product-tier-requirements" : { - "marketing" : "FREE", - "sales" : "FREE", - "service" : "FREE", - "cms" : "FREE" - }, - "x-hubspot-documentation-banner" : "NONE", - "x-hubspot-api-use-case" : "If you're using a third-party service for project management, you can create and manage any tasks associated with your CRM records by logging them in HubSpot.", - "x-hubspot-related-documentation" : [ { - "name" : "Tasks Guide", - "url" : "https://developers.hubspot.com/docs/guides/api/crm/engagements/tasks" - } ], - "x-hubspot-introduction" : "Use the tasks API to associate tasks with your CRM records. You can assign tasks to specific users in your account, keep track of their status, and organize them using different priorities and types." - }, - "servers" : [ { - "url" : "https://api.hubapi.com/crm/v3/objects/tasks" - } ], - "tags" : [ { - "name" : "Batch" - }, { - "name" : "Basic" - }, { - "name" : "Search" - } ], - "paths" : { - "/batch/read" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Read a batch of tasks by internal ID, or unique property values", - "operationId" : "post-/crm/v3/objects/tasks/batch/read_read", - "parameters" : [ { - "name" : "archived", - "in" : "query", - "description" : "Whether to return only results that have been archived.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "boolean", - "default" : false - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchReadInputSimplePublicObjectId" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ] - } - }, - "/{taskId}" : { - "get" : { - "tags" : [ "Basic" ], - "summary" : "Read", - "description" : "Read an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.", - "operationId" : "get-/crm/v3/objects/tasks/{taskId}_getById", - "parameters" : [ { - "name" : "taskId", - "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "properties", - "in" : "query", - "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "propertiesWithHistory", - "in" : "query", - "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "associations", - "in" : "query", - "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "archived", - "in" : "query", - "description" : "Whether to return only results that have been archived.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "boolean", - "default" : false - } - }, { - "name" : "idProperty", - "in" : "query", - "description" : "The name of a property whose values are unique for this object type", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ] - }, - "delete" : { - "tags" : [ "Basic" ], - "summary" : "Archive", - "description" : "Move an Object identified by `{taskId}` to the recycling bin.", - "operationId" : "delete-/crm/v3/objects/tasks/{taskId}_archive", - "parameters" : [ { - "name" : "taskId", - "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - }, - "patch" : { - "tags" : [ "Basic" ], - "summary" : "Update", - "description" : "Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.", - "operationId" : "patch-/crm/v3/objects/tasks/{taskId}_update", - "parameters" : [ { - "name" : "taskId", - "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "idProperty", - "in" : "query", - "description" : "The name of a property whose values are unique for this object type", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObjectInput" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/archive" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Archive a batch of tasks by ID", - "operationId" : "post-/crm/v3/objects/tasks/batch/archive_archive", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectId" - } - } - }, - "required" : true - }, - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/create" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Create a batch of tasks", - "operationId" : "post-/crm/v3/objects/tasks/batch/create_create", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectInputForCreate" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/update" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Update a batch of tasks by internal ID, or unique property values", - "operationId" : "post-/crm/v3/objects/tasks/batch/update_update", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInput" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/" : { - "get" : { - "tags" : [ "Basic" ], - "summary" : "List", - "description" : "Read a page of tasks. Control what is returned via the `properties` query param.", - "operationId" : "get-/crm/v3/objects/tasks_getPage", - "parameters" : [ { - "name" : "limit", - "in" : "query", - "description" : "The maximum number of results to display per page.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "integer", - "format" : "int32", - "default" : 10 - } - }, { - "name" : "after", - "in" : "query", - "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "properties", - "in" : "query", - "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "propertiesWithHistory", - "in" : "query", - "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "associations", - "in" : "query", - "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, { - "name" : "archived", - "in" : "query", - "description" : "Whether to return only results that have been archived.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "boolean", - "default" : false - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ] - }, - "post" : { - "tags" : [ "Basic" ], - "summary" : "Create", - "description" : "Create a task with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tasks is provided.", - "operationId" : "post-/crm/v3/objects/tasks_create", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/batch/upsert" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Create or update a batch of tasks by unique property values", - "description" : "Create or update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.", - "operationId" : "post-/crm/v3/objects/tasks/batch/upsert_upsert", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInputUpsert" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObject" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObjectWithErrors" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.write" ] - }, { - "private_apps" : [ "crm.objects.contacts.write" ] - } ] - } - }, - "/search" : { - "post" : { - "tags" : [ "Search" ], - "operationId" : "post-/crm/v3/objects/tasks/search_doSearch", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PublicObjectSearchRequest" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CollectionResponseWithTotalSimplePublicObjectForwardPaging" - } - } - } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } - }, - "security" : [ { - "oauth2" : [ "crm.objects.contacts.read" ] - }, { - "private_apps" : [ "crm.objects.contacts.read" ] - } ], - "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] - } - } - }, - "components" : { - "schemas" : { - "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" - } - } - }, - "CollectionResponseAssociatedId" : { - "required" : [ "results" ], - "type" : "object", - "properties" : { - "paging" : { - "$ref" : "#/components/schemas/Paging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/AssociatedId" - } - } - } - }, - "PublicAssociationsForObject" : { - "required" : [ "to", "types" ], - "type" : "object", - "properties" : { - "types" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/AssociationSpec" - } - }, - "to" : { - "$ref" : "#/components/schemas/PublicObjectId" - } - } - }, - "BatchResponseSimplePublicObject" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "datetime" - }, - "requestedAt" : { - "type" : "string", - "format" : "datetime" - }, - "startedAt" : { - "type" : "string", - "format" : "datetime" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "FilterGroup" : { - "required" : [ "filters" ], - "type" : "object", - "properties" : { - "filters" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Filter" - } - } - } - }, - "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" - } - } - }, - "ForwardPaging" : { - "type" : "object", - "properties" : { - "next" : { - "$ref" : "#/components/schemas/NextPage" - } - } - }, - "SimplePublicObjectId" : { - "required" : [ "id" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - } - } - }, - "BatchResponseSimplePublicUpsertObjectWithErrors" : { - "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/SimplePublicUpsertObject" - } - }, - "errors" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/StandardError" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "BatchReadInputSimplePublicObjectId" : { - "required" : [ "inputs", "properties", "propertiesWithHistory" ], - "type" : "object", - "properties" : { - "propertiesWithHistory" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "idProperty" : { - "type" : "string" - }, - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectId" - } - }, - "properties" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - } - }, - "BatchResponseSimplePublicUpsertObject" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "datetime" - }, - "requestedAt" : { - "type" : "string", - "format" : "datetime" - }, - "startedAt" : { - "type" : "string", - "format" : "datetime" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicUpsertObject" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "BatchInputSimplePublicObjectId" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectId" - } - } - } - }, - "ValueWithTimestamp" : { - "required" : [ "sourceType", "timestamp", "value" ], - "type" : "object", - "properties" : { - "sourceId" : { - "type" : "string" - }, - "sourceType" : { - "type" : "string" - }, - "sourceLabel" : { - "type" : "string" - }, - "updatedByUserId" : { - "type" : "integer", - "format" : "int32" - }, - "value" : { - "type" : "string" - }, - "timestamp" : { - "type" : "string", - "format" : "datetime" - } - } - }, - "BatchInputSimplePublicObjectBatchInputUpsert" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectBatchInputUpsert" - } - } - } - }, - "CollectionResponseWithTotalSimplePublicObjectForwardPaging" : { - "required" : [ "results", "total" ], - "type" : "object", - "properties" : { - "total" : { - "type" : "integer", - "format" : "int32" - }, - "paging" : { - "$ref" : "#/components/schemas/ForwardPaging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObject" - } - } - } - }, - "SimplePublicObject" : { - "required" : [ "createdAt", "id", "properties", "updatedAt" ], - "type" : "object", - "properties" : { - "createdAt" : { - "type" : "string", - "format" : "datetime" - }, - "archived" : { - "type" : "boolean", - "example" : false - }, - "archivedAt" : { - "type" : "string", - "format" : "datetime" - }, - "propertiesWithHistory" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ValueWithTimestamp" - } - } - }, - "id" : { - "type" : "string", - "example" : "512" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "nullable" : true - }, - "example" : { - "property_date" : "1572480000000", - "property_radio" : "option_1", - "property_number" : "17", - "property_string" : "value", - "property_checkbox" : "false", - "property_dropdown" : "choice_b", - "property_multiple_checkboxes" : "chocolate;strawberry" - } - }, - "updatedAt" : { - "type" : "string", - "format" : "datetime" - } - }, - "example" : { - "id" : "512", - "properties" : { - "createdate" : "2019-10-30T03:30:17.883Z", - "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", - "hs_task_body" : "Send Proposal", - "hs_task_priority" : "HIGH", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hubspot_owner_id" : "64492917" - }, - "createdAt" : "2019-10-30T03:30:17.883Z", - "updatedAt" : "2019-12-07T16:50:06.678Z", - "archived" : false - } - }, - "PublicObjectId" : { - "required" : [ "id" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - } - } - }, - "Paging" : { - "type" : "object", - "properties" : { - "next" : { - "$ref" : "#/components/schemas/NextPage" - }, - "prev" : { - "$ref" : "#/components/schemas/PreviousPage" - } - } - }, - "PublicObjectSearchRequest" : { - "type" : "object", - "properties" : { - "query" : { - "type" : "string" - }, - "limit" : { - "type" : "integer", - "format" : "int32" - }, - "after" : { - "type" : "string" - }, - "sorts" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "properties" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "filterGroups" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/FilterGroup" - } - } - } - }, - "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" - } - } - }, - "SimplePublicObjectBatchInputUpsert" : { - "required" : [ "id", "properties" ], - "type" : "object", - "properties" : { - "idProperty" : { - "type" : "string" - }, - "objectWriteTraceId" : { - "type" : "string" - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - } - }, - "BatchResponseSimplePublicObjectWithErrors" : { - "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/SimplePublicObject" - } - }, - "errors" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/StandardError" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] - } - } - }, - "SimplePublicObjectInput" : { - "required" : [ "properties" ], - "type" : "object", - "properties" : { - "objectWriteTraceId" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - }, - "example" : { - "property_date" : "1572480000000", - "property_radio" : "option_1", - "property_number" : "17", - "property_string" : "value", - "property_checkbox" : "false", - "property_dropdown" : "choice_b", - "property_multiple_checkboxes" : "chocolate;strawberry" - } - } - }, - "example" : { - "properties" : { - "hs_task_body" : "Send Proposal", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_task_priority" : "HIGH", - "hubspot_owner_id" : "64492917" - }, - "associations" : [ { - "to" : { - "id" : "101" - }, - "types" : [ { - "associationCategory" : "HUBSPOT_DEFINED", - "associationTypeId" : 2 - } ] - } ] - } - }, - "CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" : { - "required" : [ "results" ], - "type" : "object", - "properties" : { - "paging" : { - "$ref" : "#/components/schemas/ForwardPaging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" - } - } - } - }, - "AssociationSpec" : { - "required" : [ "associationCategory", "associationTypeId" ], - "type" : "object", - "properties" : { - "associationCategory" : { - "type" : "string", - "enum" : [ "HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED" ] - }, - "associationTypeId" : { - "type" : "integer", - "format" : "int32" - } - } - }, - "SimplePublicObjectWithAssociations" : { - "required" : [ "createdAt", "id", "properties", "updatedAt" ], - "type" : "object", - "properties" : { - "associations" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/components/schemas/CollectionResponseAssociatedId" - } - }, - "createdAt" : { - "type" : "string", - "format" : "datetime" - }, - "archived" : { - "type" : "boolean" - }, - "archivedAt" : { - "type" : "string", - "format" : "datetime" - }, - "propertiesWithHistory" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ValueWithTimestamp" - } - } - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "nullable" : true - } - }, - "updatedAt" : { - "type" : "string", - "format" : "datetime" - } - }, - "example" : { - "properties" : { - "createdate" : "2019-10-30T03:30:17.883Z", - "hs_lastmodifieddate" : "2019-12-07T16:50:06.678Z", - "hs_task_body" : "Send Proposal", - "hs_task_priority" : "HIGH", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hubspot_owner_id" : "64492917" - } - } - }, - "Filter" : { - "required" : [ "operator", "propertyName" ], - "type" : "object", - "properties" : { - "highValue" : { - "type" : "string" - }, - "propertyName" : { - "type" : "string" - }, - "values" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "value" : { - "type" : "string" - }, - "operator" : { - "type" : "string", - "description" : "null", - "enum" : [ "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN" ] - } - } - }, - "BatchInputSimplePublicObjectBatchInput" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectBatchInput" - } - } - } - }, - "BatchInputSimplePublicObjectInputForCreate" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" - } - } - } - }, - "PreviousPage" : { - "required" : [ "before" ], - "type" : "object", - "properties" : { - "before" : { - "type" : "string" - }, - "link" : { - "type" : "string" - } - } - }, - "SimplePublicUpsertObject" : { - "required" : [ "createdAt", "id", "new", "properties", "updatedAt" ], - "type" : "object", - "properties" : { - "createdAt" : { - "type" : "string", - "format" : "datetime" - }, - "archived" : { - "type" : "boolean" - }, - "archivedAt" : { - "type" : "string", - "format" : "datetime" - }, - "new" : { - "type" : "boolean" - }, - "propertiesWithHistory" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ValueWithTimestamp" - } - } - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "updatedAt" : { - "type" : "string", - "format" : "datetime" - } - } - }, - "SimplePublicObjectBatchInput" : { - "required" : [ "id", "properties" ], - "type" : "object", - "properties" : { - "idProperty" : { - "type" : "string", - "example" : "my_unique_property_name" - }, - "objectWriteTraceId" : { - "type" : "string" - }, - "id" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - }, - "example" : { - "id" : "1", - "properties" : { - "hs_task_body" : "Send Proposal", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_task_priority" : "HIGH", - "hubspot_owner_id" : "64492917" - } - } - }, - "AssociatedId" : { - "required" : [ "id", "type" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "type" : { - "type" : "string" - } - } - }, - "NextPage" : { - "required" : [ "after" ], - "type" : "object", - "properties" : { - "link" : { - "type" : "string", - "example" : "?after=NTI1Cg%3D%3D" - }, - "after" : { - "type" : "string", - "example" : "NTI1Cg%3D%3D" - } - }, - "example" : { - "after" : "NTI1Cg%3D%3D", - "link" : "?after=NTI1Cg%3D%3D" - } - }, - "SimplePublicObjectInputForCreate" : { - "required" : [ "associations", "properties" ], - "type" : "object", - "properties" : { - "associations" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicAssociationsForObject" - } - }, - "objectWriteTraceId" : { - "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - }, - "example" : { - "properties" : { - "hs_task_body" : "Send Proposal", - "hs_timestamp" : "2019-10-30T03:30:17.883Z", - "hs_task_status" : "WAITING", - "hs_task_subject" : "Follow-up for Brian Buyer", - "hs_task_priority" : "HIGH", - "hubspot_owner_id" : "64492917" - }, - "associations" : [ { - "to" : { - "id" : "101" - }, - "types" : [ { - "associationCategory" : "HUBSPOT_DEFINED", - "associationTypeId" : 2 - } ] - } ] - } - } - }, - "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" : { - "e-commerce" : "e-commerce", - "crm.objects.custom.write" : "Change custom object records", - "media_bridge.read" : "Read media and media events", - "crm.objects.goals.read" : "Read goals", - "tickets" : "Read and write tickets", - "crm.objects.custom.read" : "View custom object records" - } - } - } - }, - "oauth2" : { - "type" : "oauth2", - "flows" : { - "authorizationCode" : { - "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", - "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", - "scopes" : { - "crm.objects.contacts.read" : " ", - "crm.objects.listings.read" : "Read listings", - "crm.objects.carts.write" : "Write cart", - "crm.objects.courses.write" : "Write courses", - "crm.objects.quotes.write" : "Quotes", - "crm.objects.users.read" : "Read User CRM objects", - "crm.objects.companies.read" : " ", - "crm.objects.appointments.read" : "Read appointments", - "crm.objects.partner-clients.write" : "Modify Partner Client CRM objects", - "crm.objects.leads.read" : "Read lead objects", - "crm.objects.appointments.write" : "Write appointments", - "crm.objects.services.write" : "Write services", - "crm.objects.line_items.read" : "Line Items", - "crm.objects.courses.read" : "Read courses", - "crm.objects.deals.read" : " ", - "crm.objects.invoices.read" : "Read invoices objects", - "crm.objects.partner-clients.read" : "View Partner Client CRM objects", - "crm.objects.deals.write" : " ", - "crm.objects.line_items.write" : "Line Items", - "crm.objects.listings.write" : "Write listings", - "crm.objects.companies.write" : " ", - "crm.objects.contacts.write" : " ", - "crm.objects.users.write" : "Write User CRM objects", - "crm.objects.commercepayments.read" : "Read the COMMERCE_PAYMENT object.", - "crm.objects.leads.write" : "Modify lead objects", - "crm.objects.subscriptions.read" : "Read Commerce Subscriptions", - "crm.objects.carts.read" : "Read carts", - "crm.objects.orders.write" : "Write orders", - "crm.objects.quotes.read" : "Quotes", - "crm.objects.services.read" : "Read services", - "crm.objects.orders.read" : "Read Orders" - } - } - } - }, - "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" : "FREE" - }, - "x-hubspot-documentation-banner" : "NONE" -} \ No newline at end of file diff --git a/docs/spec/sanitations.md b/docs/spec/sanitations.md index 3fcf215..4def2e3 100644 --- a/docs/spec/sanitations.md +++ b/docs/spec/sanitations.md @@ -1,33 +1,33 @@ _Author_:@ChathuraIshara \ _Created_:2025/02/14\ -_Updated_:2025/02/14\ +_Updated_:2025/02/15\ _Edition_: Swan Lake # Sanitation for OpenAPI specification This document records the sanitation done on top of the official OpenAPI specification from HubSpot CRM Tasks. -The OpenAPI specification is obtained from (https://github.com/HubSpot/HubSpot-public-api-spec-collection/blob/main/PublicApiSpecs/CRM/Tasks/Rollouts/424/v3/tasks.json). +The OpenAPI specification is obtained from ["Hubspot Api Reference"](https://github.com/HubSpot/HubSpot-public-api-spec-collection/blob/main/PublicApiSpecs/CRM/Tasks/Rollouts/424/v3/tasks.json). These changes are done in order to improve the overall usability, and as workarounds for some known language limitations. -[//]: # (TODO: Add sanitation details) + 1. Change the url property of the servers object -* Original: https://api.hubapi.com -* Updated: https://api.hubapi.com/crm/v3/objects/tasks +* Original: `https://api.hubapi.com` +* Updated: `https://api.hubapi.com/crm/v3/objects/tasks` * Reason: This change of adding the common prefix /crm/v3/objects/tasks to the base url makes it easier to access endpoints using the client. 2. Update the API Paths -* Original: Paths included common prefix above in each endpoint. (eg: /crm/v3/objects/tasks) +* Original: Paths included common prefix above in each endpoint. (eg: `/crm/v3/objects/tasks`) * Updated: Common prefix is now removed from the endpoints as it is included in the base URL. - * Original: /crm/v3/objects/tasks - * Updated: / + * Original: `/crm/v3/objects/tasks` + * Updated: `/` * Reason: This change simplifies the API paths, making them shorter and more readable. 3. Update the date-time into datetime to make it compatible with the ballerina type conversions -* Original: foramt:date-time -* Updated: foramt:datetime +* Original: `"format": "date-time"` +* Updated: `"format": "datetime"` * Reason: The date-time format is not compatible with the openAPI generation tool. Therefore, it is updated to datetime to make it compatible with the generation tool. ## OpenAPI cli command diff --git a/docs/spec/tasks.json b/docs/spec/tasks.json index 1dc12cf..7ac984a 100644 --- a/docs/spec/tasks.json +++ b/docs/spec/tasks.json @@ -78,7 +78,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -176,7 +183,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -206,7 +220,14 @@ "content" : { } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -262,7 +283,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -294,7 +322,14 @@ "content" : { } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -342,7 +377,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -390,7 +432,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -491,7 +540,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -528,7 +584,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -577,7 +640,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { @@ -614,7 +684,14 @@ } }, "default" : { - "$ref" : "#/components/responses/Error" + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } } }, "security" : [ { From a4e673a6452098f4f6562dc13029d9b94f699696 Mon Sep 17 00:00:00 2001 From: ChathuraIshara Date: Sat, 15 Feb 2025 11:37:13 +0530 Subject: [PATCH 5/6] updated sanitations.md --- docs/spec/sanitations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/sanitations.md b/docs/spec/sanitations.md index 4def2e3..af839b5 100644 --- a/docs/spec/sanitations.md +++ b/docs/spec/sanitations.md @@ -6,7 +6,7 @@ _Edition_: Swan Lake # Sanitation for OpenAPI specification This document records the sanitation done on top of the official OpenAPI specification from HubSpot CRM Tasks. -The OpenAPI specification is obtained from ["Hubspot Api Reference"](https://github.com/HubSpot/HubSpot-public-api-spec-collection/blob/main/PublicApiSpecs/CRM/Tasks/Rollouts/424/v3/tasks.json). +The OpenAPI specification is obtained from [Hubspot Api Reference](https://github.com/HubSpot/HubSpot-public-api-spec-collection/blob/main/PublicApiSpecs/CRM/Tasks/Rollouts/424/v3/tasks.json). These changes are done in order to improve the overall usability, and as workarounds for some known language limitations. From b36420f8ed75798f0779b8a359830d562fef2c8e Mon Sep 17 00:00:00 2001 From: ChathuraIshara Date: Mon, 17 Feb 2025 12:17:56 +0530 Subject: [PATCH 6/6] add missing api descriptions,update sanitations.md and regenerate client --- ballerina/client.bal | 12 +++++++----- docs/spec/{tasks.json => openapi.json} | 16 +++++++++++----- docs/spec/sanitations.md | 15 ++++++++++----- 3 files changed, 28 insertions(+), 15 deletions(-) rename docs/spec/{tasks.json => openapi.json} (97%) diff --git a/ballerina/client.bal b/ballerina/client.bal index 777eb6d..363b1b8 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -61,7 +61,7 @@ public isolated client class Client { return; } - # Archive + # Archive a task # # + headers - Headers to be sent with the request # + return - No content @@ -75,7 +75,7 @@ public isolated client class Client { return self.clientEp->delete(resourcePath, headers = httpHeaders); } - # List + # List of the tasks # # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request @@ -92,7 +92,7 @@ public isolated client class Client { return self.clientEp->get(resourcePath, httpHeaders); } - # Read + # Read a task # # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request @@ -109,7 +109,7 @@ public isolated client class Client { return self.clientEp->get(resourcePath, httpHeaders); } - # Update + # Update a task # # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request @@ -128,7 +128,7 @@ public isolated client class Client { return self.clientEp->patch(resourcePath, request, httpHeaders); } - # Create + # Create a task # # + headers - Headers to be sent with the request # + return - successful operation @@ -232,6 +232,8 @@ public isolated client class Client { return self.clientEp->post(resourcePath, request, httpHeaders); } + # Search for tasks + # # + headers - Headers to be sent with the request # + return - successful operation resource isolated function post search(PublicObjectSearchRequest payload, map headers = {}) returns CollectionResponseWithTotalSimplePublicObjectForwardPaging|error { diff --git a/docs/spec/tasks.json b/docs/spec/openapi.json similarity index 97% rename from docs/spec/tasks.json rename to docs/spec/openapi.json index 7ac984a..d6e2402 100644 --- a/docs/spec/tasks.json +++ b/docs/spec/openapi.json @@ -33,6 +33,7 @@ "post" : { "tags" : [ "Batch" ], "summary" : "Read a batch of tasks by internal ID, or unique property values", + "description" : "Retrieves a batch of tasks based on the `inputs`, `properties`, and `propertiesWithHistory` fields. The `properties` field lists properties to return, while the `propertiesWithHistory` field includes properties with their previous values. If any specified properties are missing from the requested objects, they will be ignored.", "operationId" : "post-/crm/v3/objects/tasks/batch/read_read", "parameters" : [ { "name" : "archived", @@ -98,7 +99,7 @@ "/{taskId}" : { "get" : { "tags" : [ "Basic" ], - "summary" : "Read", + "summary" : "Read a task", "description" : "Read an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.", "operationId" : "get-/crm/v3/objects/tasks/{taskId}_getById", "parameters" : [ { @@ -201,7 +202,7 @@ }, "delete" : { "tags" : [ "Basic" ], - "summary" : "Archive", + "summary" : "Archive a task", "description" : "Move an Object identified by `{taskId}` to the recycling bin.", "operationId" : "delete-/crm/v3/objects/tasks/{taskId}_archive", "parameters" : [ { @@ -238,7 +239,7 @@ }, "patch" : { "tags" : [ "Basic" ], - "summary" : "Update", + "summary" : "Update a task", "description" : "Perform a partial update of an Object identified by `{taskId}`. `{taskId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.", "operationId" : "patch-/crm/v3/objects/tasks/{taskId}_update", "parameters" : [ { @@ -304,6 +305,7 @@ "post" : { "tags" : [ "Batch" ], "summary" : "Archive a batch of tasks by ID", + "description" : "Moves a batch of tasks identified by the `id` s specified in the `inputs` to the recycling bin.", "operationId" : "post-/crm/v3/objects/tasks/batch/archive_archive", "parameters" : [ ], "requestBody" : { @@ -343,6 +345,7 @@ "post" : { "tags" : [ "Batch" ], "summary" : "Create a batch of tasks", + "description" : " Create a batch of tasks using the same rules as when creating an individual task", "operationId" : "post-/crm/v3/objects/tasks/batch/create_create", "parameters" : [ ], "requestBody" : { @@ -398,6 +401,7 @@ "post" : { "tags" : [ "Batch" ], "summary" : "Update a batch of tasks by internal ID, or unique property values", + "description" : "update records identified by a unique property value as specified by the `idProperty` query param. `idProperty` query param refers to a property whose values are unique for the object.", "operationId" : "post-/crm/v3/objects/tasks/batch/update_update", "parameters" : [ ], "requestBody" : { @@ -452,7 +456,7 @@ "/" : { "get" : { "tags" : [ "Basic" ], - "summary" : "List", + "summary" : "List of the tasks", "description" : "Read a page of tasks. Control what is returned via the `properties` query param.", "operationId" : "get-/crm/v3/objects/tasks_getPage", "parameters" : [ { @@ -558,7 +562,7 @@ }, "post" : { "tags" : [ "Basic" ], - "summary" : "Create", + "summary" : "Create a task", "description" : "Create a task with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tasks is provided.", "operationId" : "post-/crm/v3/objects/tasks_create", "parameters" : [ ], @@ -660,6 +664,8 @@ "/search" : { "post" : { "tags" : [ "Search" ], + "summary" : "Search for tasks", + "description" : "Search for tasks based on filters, properties, sorting, and query parameters.", "operationId" : "post-/crm/v3/objects/tasks/search_doSearch", "parameters" : [ ], "requestBody" : { diff --git a/docs/spec/sanitations.md b/docs/spec/sanitations.md index af839b5..86a6070 100644 --- a/docs/spec/sanitations.md +++ b/docs/spec/sanitations.md @@ -1,6 +1,6 @@ _Author_:@ChathuraIshara \ _Created_:2025/02/14\ -_Updated_:2025/02/15\ +_Updated_:2025/02/17\ _Edition_: Swan Lake # Sanitation for OpenAPI specification @@ -20,21 +20,26 @@ These changes are done in order to improve the overall usability, and as workaro * Original: Paths included common prefix above in each endpoint. (eg: `/crm/v3/objects/tasks`) * Updated: Common prefix is now removed from the endpoints as it is included in the base URL. - * Original: `/crm/v3/objects/tasks` - * Updated: `/` * Reason: This change simplifies the API paths, making them shorter and more readable. 3. Update the date-time into datetime to make it compatible with the ballerina type conversions * Original: `"format": "date-time"` * Updated: `"format": "datetime"` -* Reason: The date-time format is not compatible with the openAPI generation tool. Therefore, it is updated to datetime to make it compatible with the generation tool. +* Reason: The `date-time` format is not compatible with the OpenAPI tool. Therefore, it is updated to `datetime` to make it compatible with the tool. + +4. Update API Summary and Description Fields + +* Original: Some API endpoints had one-word summaries, and some lacked description fields entirely. +* Updated: Changed one-word summaries to more meaningful summaries and added detailed description fields where they were missing. +* Reason: Improves clarity and provides better context for understanding the API. + ## OpenAPI cli command The following command was used to generate the Ballerina client from the OpenAPI specification. The command should be executed from the repository root directory. ```bash -bal openapi -i docs/spec/tasks.json --mode client --license docs/license.txt -o ballerina +bal openapi -i docs/spec/openapi.json --mode client --license docs/license.txt -o ballerina ``` Note: The license year is hardcoded to 2025, change if necessary.