From 7f2cba322623600427a2284600d356cfc75ba8f6 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 9 Apr 2025 07:43:15 +0000 Subject: [PATCH 1/6] [AUTOMATED] Update OpenAPI spec --- docs/spec/openapi.json | 215 +++++++++++++++++++++-------------------- 1 file changed, 108 insertions(+), 107 deletions(-) diff --git a/docs/spec/openapi.json b/docs/spec/openapi.json index 7341fde..964e199 100644 --- a/docs/spec/openapi.json +++ b/docs/spec/openapi.json @@ -34,7 +34,7 @@ "parameters" : [ { "name" : "archived", "in" : "query", - "description" : "Whether to return only results that have been archived.", + "description" : "Whether to return only results that have been archived", "required" : false, "style" : "form", "explode" : true, @@ -75,7 +75,7 @@ "operationId" : "post-/crm-object-schemas/v3/schemas_create", "parameters" : [ ], "requestBody" : { - "description" : "Object schema definition, including properties and associations.", + "description" : "Object schema definition, including properties and associations", "content" : { "application/json" : { "schema" : { @@ -114,7 +114,7 @@ "parameters" : [ { "name" : "objectType", "in" : "path", - "description" : "Fully qualified name or object type ID of your schema.", + "description" : "Fully qualified name or object type ID of your schema", "required" : true, "style" : "simple", "explode" : false, @@ -155,7 +155,7 @@ "parameters" : [ { "name" : "objectType", "in" : "path", - "description" : "Fully qualified name or object type ID of your schema.", + "description" : "Fully qualified name or object type ID of your schema", "required" : true, "style" : "simple", "explode" : false, @@ -165,7 +165,7 @@ }, { "name" : "archived", "in" : "query", - "description" : "Whether to return only results that have been archived.", + "description" : "Whether to return only results that have been archived", "required" : false, "style" : "form", "explode" : true, @@ -195,7 +195,7 @@ "parameters" : [ { "name" : "objectType", "in" : "path", - "description" : "Fully qualified name or object type ID of your schema.", + "description" : "Fully qualified name or object type ID of your schema", "required" : true, "style" : "simple", "explode" : false, @@ -204,7 +204,7 @@ } } ], "requestBody" : { - "description" : "Attributes to update in your schema.", + "description" : "Attributes to update in your schema", "content" : { "application/json" : { "schema" : { @@ -243,7 +243,7 @@ "parameters" : [ { "name" : "objectType", "in" : "path", - "description" : "Fully qualified name or object type ID of your schema.", + "description" : "Fully qualified name or object type ID of your schema", "required" : true, "style" : "simple", "explode" : false, @@ -252,7 +252,7 @@ } } ], "requestBody" : { - "description" : "Attributes that define the association.", + "description" : "Attributes that define the association", "content" : { "application/json" : { "schema" : { @@ -291,7 +291,7 @@ "parameters" : [ { "name" : "objectType", "in" : "path", - "description" : "Fully qualified name or object type ID of your schema.", + "description" : "Fully qualified name or object type ID of your schema", "required" : true, "style" : "simple", "explode" : false, @@ -301,7 +301,7 @@ }, { "name" : "associationIdentifier", "in" : "path", - "description" : "Unique ID of the association to remove.", + "description" : "Unique ID of the association to remove", "required" : true, "style" : "simple", "explode" : false, @@ -331,14 +331,14 @@ "properties" : { "secondaryDisplayProperties" : { "type" : "array", - "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", + "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type", "items" : { "type" : "string" } }, "requiredProperties" : { "type" : "array", - "description" : "The names of properties that should be **required** when creating an object of this type.", + "description" : "The names of properties that should be **required** when creating an object of this type", "example" : [ "my_object_property" ], "items" : { "type" : "string" @@ -346,7 +346,7 @@ }, "searchableProperties" : { "type" : "array", - "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", + "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search", "example" : [ "my_object_property" ], "items" : { "type" : "string" @@ -357,7 +357,7 @@ }, "primaryDisplayProperty" : { "type" : "string", - "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", + "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type", "example" : "my_object_property" }, "description" : { @@ -370,7 +370,7 @@ "$ref" : "#/components/schemas/ObjectTypeDefinitionLabels" } }, - "description" : "Defines attributes to update on an object type.", + "description" : "Defines attributes to update on an object type", "example" : { "primaryDisplayProperty" : "my_object_property", "requiredProperties" : [ "my_object_property" ], @@ -395,7 +395,7 @@ "properties" : { "secondaryDisplayProperties" : { "type" : "array", - "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", + "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type", "items" : { "type" : "string" } @@ -417,13 +417,13 @@ }, "createdAt" : { "type" : "string", - "description" : "When the object type was created.", + "description" : "When the object type was created", "format" : "date-time", - "example" : "2020-02-20T18:07:11.390+00:00" + "example" : "2020-02-20T18:07:11.39Z" }, "requiredProperties" : { "type" : "array", - "description" : "The names of properties that should be **required** when creating an object of this type.", + "description" : "The names of properties that should be **required** when creating an object of this type", "example" : [ "my_object_property" ], "items" : { "type" : "string" @@ -431,7 +431,7 @@ }, "searchableProperties" : { "type" : "array", - "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", + "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search", "example" : [ "my_object_property" ], "items" : { "type" : "string" @@ -439,33 +439,33 @@ }, "portalId" : { "type" : "integer", - "description" : "The ID of the account that this object type is specific to.", + "description" : "The ID of the account that this object type is specific to", "format" : "int32", "example" : 12345678 }, "primaryDisplayProperty" : { "type" : "string", - "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", + "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type", "example" : "my_object_property" }, "name" : { "type" : "string", - "description" : "A unique name for this object. For internal use only.", + "description" : "A unique name for this object. For internal use only", "example" : "my_object" }, "id" : { "type" : "string", - "description" : "A unique ID for this object type. Will be defined as {meta-type}-{unique ID}.", + "description" : "A unique ID for this object type. Will be defined as {meta-type}-{unique ID}", "example" : "123456" }, "updatedAt" : { "type" : "string", - "description" : "When the object type was last updated.", + "description" : "When the object type was last updated", "format" : "date-time", - "example" : "2020-02-21T14:13:28.818+00:00" + "example" : "2020-02-21T14:13:28.818Z" } }, - "description" : "Defines an object type.", + "description" : "Defines an object type", "example" : { "id" : "123456", "createdAt" : "2020-02-20T18:07:11.390Z", @@ -488,28 +488,28 @@ "properties" : { "hidden" : { "type" : "boolean", - "description" : "Hidden options won't be shown in HubSpot.", + "description" : "Hidden options won't be shown in HubSpot", "example" : false }, "displayOrder" : { "type" : "integer", - "description" : "Options are shown in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values.", + "description" : "Options are shown in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values", "format" : "int32", "example" : 1 }, "description" : { "type" : "string", - "description" : "A description of the option.", + "description" : "A description of the option", "example" : "Choice number one" }, "label" : { "type" : "string", - "description" : "A human-readable option label that will be shown in HubSpot.", + "description" : "A human-readable option label that will be shown in HubSpot", "example" : "Option A" }, "value" : { "type" : "string", - "description" : "The internal value of the option, which must be used when setting the property value through the API.", + "description" : "The internal value of the option, which must be used when setting the property value through the API", "example" : "A" } }, @@ -601,7 +601,7 @@ }, "in" : { "type" : "string", - "description" : "The name of the field or parameter in which the error was found." + "description" : "The name of the field or parameter in which the error was found" }, "context" : { "type" : "object", @@ -631,46 +631,46 @@ }, "optionSortStrategy" : { "type" : "string", - "description" : "Controls how the property options will be sorted in the HubSpot UI.", + "description" : "Controls how the property options will be sorted in the HubSpot UI", "enum" : [ "DISPLAY_ORDER", "ALPHABETICAL" ] }, "displayOrder" : { "type" : "integer", - "description" : "The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values.", + "description" : "The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values", "format" : "int32", "example" : 2 }, "description" : { "type" : "string", - "description" : "A description of the property that will be shown as help text in HubSpot." + "description" : "A description of the property that will be shown as help text in HubSpot" }, "showCurrencySymbol" : { "type" : "boolean", - "description" : "Whether the property will display the currency symbol in the HubSpot UI." + "description" : "Whether the property will display the currency symbol in the HubSpot UI" }, "label" : { "type" : "string", - "description" : "A human-readable property label that will be shown in HubSpot.", + "description" : "A human-readable property label that will be shown in HubSpot", "example" : "My object property" }, "type" : { "type" : "string", - "description" : "The data type of the property.", + "description" : "The data type of the property", "example" : "enumeration", "enum" : [ "string", "number", "date", "datetime", "enumeration", "bool" ] }, "formField" : { "type" : "boolean", - "description" : "Whether the property can be used in a HubSpot form." + "description" : "Whether the property can be used in a HubSpot form" }, "groupName" : { "type" : "string", - "description" : "The name of the group this property belongs to.", + "description" : "The name of the group this property belongs to", "example" : "my_object_information" }, "referencedObjectType" : { "type" : "string", - "description" : "Defines the options this property will return, e.g. OWNER would return name of users on the portal." + "description" : "Defines the options this property will return, e.g. OWNER would return name of users on the portal" }, "textDisplayHint" : { "type" : "string", @@ -679,11 +679,11 @@ }, "name" : { "type" : "string", - "description" : "The internal property name, which must be used when referencing the property from the API." + "description" : "The internal property name, which must be used when referencing the property from the API" }, "options" : { "type" : "array", - "description" : "A list of available options for the property. This field is only required for enumerated properties.", + "description" : "A list of available options for the property. This field is only required for enumerated properties", "example" : [ { "label" : "Option A", "value" : "A", @@ -710,16 +710,16 @@ }, "hasUniqueValue" : { "type" : "boolean", - "description" : "Whether or not the property's value must be unique. Once set, this can't be changed.", + "description" : "Whether or not the property's value must be unique. Once set, this can't be changed", "example" : false }, "fieldType" : { "type" : "string", - "description" : "Controls how the property appears in HubSpot.", + "description" : "Controls how the property appears in HubSpot", "example" : "select" } }, - "description" : "Defines a property to create.", + "description" : "Defines a property to create", "example" : { "label" : "My object property", "type" : "enumeration", @@ -768,21 +768,21 @@ "properties" : { "fromObjectTypeId" : { "type" : "string", - "description" : "ID of the primary object type to link from.", + "description" : "ID of the primary object type to link from", "example" : "2-123456" }, "name" : { "type" : "string", - "description" : "A unique name for this association.", + "description" : "A unique name for this association", "example" : "my_object_to_contact" }, "toObjectTypeId" : { "type" : "string", - "description" : "ID of the target object type to link to.", + "description" : "ID of the target object type to link to", "example" : "contact" } }, - "description" : "Defines an association between two object types.", + "description" : "Defines an association between two object types", "example" : { "fromObjectTypeId" : "2-123456", "toObjectTypeId" : "contact", @@ -795,36 +795,36 @@ "properties" : { "createdAt" : { "type" : "string", - "description" : "When the association was defined.", + "description" : "When the association was defined", "format" : "date-time" }, "fromObjectTypeId" : { "type" : "string", - "description" : "ID of the primary object type to link from.", + "description" : "ID of the primary object type to link from", "example" : "2-123456" }, "name" : { "type" : "string", - "description" : "A unique name for this association.", + "description" : "A unique name for this association", "example" : "my_object_to_contact" }, "id" : { "type" : "string", - "description" : "A unique ID for this association.", + "description" : "A unique ID for this association", "example" : "105" }, "toObjectTypeId" : { "type" : "string", - "description" : "ID of the target object type to link to.", + "description" : "ID of the target object type to link to", "example" : "0-1" }, "updatedAt" : { "type" : "string", - "description" : "When the association was last updated.", + "description" : "When the association was last updated", "format" : "date-time" } }, - "description" : "Defines an association between two object types.", + "description" : "Defines an association between two object types", "example" : { "id" : "105", "fromObjectTypeId" : "2-123456", @@ -838,7 +838,7 @@ "properties" : { "associations" : { "type" : "array", - "description" : "Associations defined for a given object type.", + "description" : "Associations defined for a given object type", "example" : [ { "id" : "123", "name" : "my_object_to_contact", @@ -851,7 +851,7 @@ }, "secondaryDisplayProperties" : { "type" : "array", - "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", + "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type", "items" : { "type" : "string" } @@ -872,7 +872,7 @@ }, "fullyQualifiedName" : { "type" : "string", - "description" : "An assigned unique ID for the object, including portal ID and object name.", + "description" : "An assigned unique ID for the object, including portal ID and object name", "example" : "p7878787_my_object\"" }, "labels" : { @@ -883,13 +883,13 @@ }, "createdAt" : { "type" : "string", - "description" : "When the object schema was created.", + "description" : "When the object schema was created", "format" : "date-time", - "example" : "2020-02-20T18:07:11.390+00:00" + "example" : "2020-02-20T18:07:11.39Z" }, "requiredProperties" : { "type" : "array", - "description" : "The names of properties that should be **required** when creating an object of this type.", + "description" : "The names of properties that should be **required** when creating an object of this type", "example" : [ "my_object_property" ], "items" : { "type" : "string" @@ -897,7 +897,7 @@ }, "searchableProperties" : { "type" : "array", - "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", + "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search", "example" : [ "my_object_property" ], "items" : { "type" : "string" @@ -905,22 +905,22 @@ }, "primaryDisplayProperty" : { "type" : "string", - "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", + "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type", "example" : "my_object_property" }, "name" : { "type" : "string", - "description" : "A unique name for the schema's object type.", + "description" : "A unique name for the schema's object type", "example" : "my_object" }, "id" : { "type" : "string", - "description" : "A unique ID for this schema's object type. Will be defined as {meta-type}-{unique ID}.", + "description" : "A unique ID for this schema's object type. Will be defined as {meta-type}-{unique ID}", "example" : "123456" }, "properties" : { "type" : "array", - "description" : "Properties defined for this object type.", + "description" : "Properties defined for this object type", "example" : [ { "name" : "my_object_property", "type" : "string", @@ -941,12 +941,12 @@ }, "updatedAt" : { "type" : "string", - "description" : "When the object schema was last updated.", + "description" : "When the object schema was last updated", "format" : "date-time", - "example" : "2020-02-20T18:09:07.555+00:00" + "example" : "2020-02-20T18:09:07.555Z" } }, - "description" : "Defines an object schema, including its properties and associations.", + "description" : "Defines an object schema, including its properties and associations", "example" : { "id" : "123456", "createdAt" : "2020-02-20T18:07:11.390Z", @@ -989,14 +989,14 @@ "properties" : { "secondaryDisplayProperties" : { "type" : "array", - "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", + "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type", "items" : { "type" : "string" } }, "requiredProperties" : { "type" : "array", - "description" : "The names of properties that should be **required** when creating an object of this type.", + "description" : "The names of properties that should be **required** when creating an object of this type", "example" : [ "my_object_property" ], "items" : { "type" : "string" @@ -1004,19 +1004,19 @@ }, "searchableProperties" : { "type" : "array", - "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", + "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search", "items" : { "type" : "string" } }, "primaryDisplayProperty" : { "type" : "string", - "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", + "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type", "example" : "my_object_property" }, "name" : { "type" : "string", - "description" : "A unique name for this object. For internal use only.", + "description" : "A unique name for this object. For internal use only", "example" : "my_object" }, "description" : { @@ -1024,7 +1024,7 @@ }, "associatedObjects" : { "type" : "array", - "description" : "Associations defined for this object type.", + "description" : "Associations defined for this object type", "example" : [ "CONTACT" ], "items" : { "type" : "string" @@ -1032,7 +1032,7 @@ }, "properties" : { "type" : "array", - "description" : "Properties defined for this object type.", + "description" : "Properties defined for this object type", "example" : [ { "name" : "my_object_property", "label" : "My object property", @@ -1046,7 +1046,7 @@ "$ref" : "#/components/schemas/ObjectTypeDefinitionLabels" } }, - "description" : "Defines a new object type, its properties, and associations.", + "description" : "Defines a new object type, its properties, and associations", "example" : { "name" : "my_object", "labels" : { @@ -1078,7 +1078,7 @@ "example" : "My object" } }, - "description" : "Singular and plural labels for the object. Used in CRM display.", + "description" : "Singular and plural labels for the object. Used in CRM display", "example" : { "singular" : "My object", "plural" : "My objects" @@ -1090,28 +1090,28 @@ "properties" : { "hidden" : { "type" : "boolean", - "description" : "Hidden options will not be displayed in HubSpot.", + "description" : "Hidden options will not be displayed in HubSpot", "example" : false }, "displayOrder" : { "type" : "integer", - "description" : "Options are displayed in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values.", + "description" : "Options are displayed in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values", "format" : "int32", "example" : 1 }, "description" : { "type" : "string", - "description" : "A description of the option.", + "description" : "A description of the option", "example" : "Choice number one" }, "label" : { "type" : "string", - "description" : "A human-readable option label that will be shown in HubSpot.", + "description" : "A human-readable option label that will be shown in HubSpot", "example" : "Option A" }, "value" : { "type" : "string", - "description" : "The internal value of the option, which must be used when setting the property value through the API.", + "description" : "The internal value of the option, which must be used when setting the property value through the API", "example" : "A" } }, @@ -1133,26 +1133,26 @@ }, "displayOrder" : { "type" : "integer", - "description" : "The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values.", + "description" : "The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values", "format" : "int32", "example" : 2 }, "description" : { "type" : "string", - "description" : "A description of the property that will be shown as help text in HubSpot." + "description" : "A description of the property that will be shown as help text in HubSpot" }, "showCurrencySymbol" : { "type" : "boolean", - "description" : "Whether the property will display the currency symbol set in the account settings." + "description" : "Whether the property will display the currency symbol set in the account settings" }, "type" : { "type" : "string", - "description" : "The property data type.", + "description" : "The property data type", "example" : "enumeration" }, "hubspotDefined" : { "type" : "boolean", - "description" : "This will be true for default object properties built into HubSpot." + "description" : "This will be true for default object properties built into HubSpot" }, "createdAt" : { "type" : "string", @@ -1161,11 +1161,11 @@ }, "archived" : { "type" : "boolean", - "description" : "Whether or not the property is archived." + "description" : "Whether or not the property is archived" }, "options" : { "type" : "array", - "description" : "A list of valid options for the property. This field is required for enumerated properties, but will be empty for other property types.", + "description" : "A list of valid options for the property. This field is required for enumerated properties, but will be empty for other property types", "example" : [ { "label" : "Option A", "value" : "A", @@ -1185,16 +1185,16 @@ }, "hasUniqueValue" : { "type" : "boolean", - "description" : "Whether or not the property's value must be unique. Once set, this can't be changed.", + "description" : "Whether or not the property's value must be unique. Once set, this can't be changed", "example" : false }, "calculated" : { "type" : "boolean", - "description" : "For default properties, true indicates that the property is calculated by a HubSpot process. It has no effect for custom properties." + "description" : "For default properties, true indicates that the property is calculated by a HubSpot process. It has no effect for custom properties" }, "externalOptions" : { "type" : "boolean", - "description" : "For default properties, true indicates that the options are stored externally to the property settings." + "description" : "For default properties, true indicates that the options are stored externally to the property settings" }, "updatedAt" : { "type" : "string", @@ -1203,7 +1203,7 @@ }, "createdUserId" : { "type" : "string", - "description" : "The internal ID of the user who created the property in HubSpot. This field may not exist if the property was created outside of HubSpot." + "description" : "The internal ID of the user who created the property in HubSpot. This field may not exist if the property was created outside of HubSpot" }, "modificationMetadata" : { "$ref" : "#/components/schemas/PropertyModificationMetadata" @@ -1216,12 +1216,12 @@ }, "label" : { "type" : "string", - "description" : "A human-readable property label that will be shown in HubSpot.", + "description" : "A human-readable property label that will be shown in HubSpot", "example" : "My object property" }, "formField" : { "type" : "boolean", - "description" : "Whether or not the property can be used in a HubSpot form." + "description" : "Whether or not the property can be used in a HubSpot form" }, "dataSensitivity" : { "type" : "string", @@ -1229,21 +1229,21 @@ }, "archivedAt" : { "type" : "string", - "description" : "When the property was archived.", + "description" : "When the property was archived", "format" : "date-time" }, "groupName" : { "type" : "string", - "description" : "The name of the property group the property belongs to.", + "description" : "The name of the property group the property belongs to", "example" : "my_object_information" }, "referencedObjectType" : { "type" : "string", - "description" : "If this property is related to other object(s), they'll be listed here." + "description" : "If this property is related to other object(s), they'll be listed here" }, "name" : { "type" : "string", - "description" : "The internal property name, which must be used when referencing the property via the API.", + "description" : "The internal property name, which must be used when referencing the property via the API", "example" : "my_object_property" }, "calculationFormula" : { @@ -1251,12 +1251,12 @@ }, "fieldType" : { "type" : "string", - "description" : "Controls how the property appears in HubSpot.", + "description" : "Controls how the property appears in HubSpot", "example" : "select" }, "updatedUserId" : { "type" : "string", - "description" : "The internal user ID of the user who updated the property in HubSpot. This field may not exist if the property was updated outside of HubSpot." + "description" : "The internal user ID of the user who updated the property in HubSpot. This field may not exist if the property was updated outside of HubSpot" } }, "description" : "Defines a property", @@ -1319,7 +1319,8 @@ "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", - "in" : "header" + "in" : "header", + "x-ballerina-name" : "privateAppLegacy" } } }, From 15323b108019f05a1ec2e5a8b847f1cacfb192c7 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 9 Apr 2025 07:43:15 +0000 Subject: [PATCH 2/6] [AUTOMATED] Client Regeneration --- ballerina/client.bal | 102 ++++++--------- ballerina/types.bal | 299 +++++++++++++++++++++---------------------- ballerina/utils.bal | 43 ++++--- gradle.properties | 2 +- 4 files changed, 210 insertions(+), 236 deletions(-) diff --git a/ballerina/client.bal b/ballerina/client.bal index 31be7a9..aa5a5dd 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -23,124 +23,100 @@ 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-object-schemas/v3/schemas") 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); - } - } + public isolated function init(ConnectionConfig config, string serviceUrl = "https://api.hubapi.com") returns error? { + http:ClientConfiguration httpClientConfig = {httpVersion: config.httpVersion, http1Settings: config.http1Settings, http2Settings: config.http2Settings, timeout: config.timeout, forwarded: config.forwarded, followRedirects: config.followRedirects, poolConfig: config.poolConfig, cache: config.cache, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, cookieConfig: config.cookieConfig, responseLimits: config.responseLimits, secureSocket: config.secureSocket, proxy: config.proxy, socketConfig: config.socketConfig, validation: config.validation, laxDataBinding: config.laxDataBinding}; if config.auth is ApiKeysConfig { self.apiKeyConfig = (config.auth).cloneReadOnly(); } else { httpClientConfig.auth = config.auth; self.apiKeyConfig = (); } - http:Client httpEp = check new (serviceUrl, httpClientConfig); - self.clientEp = httpEp; - return; + self.clientEp = check new (serviceUrl, httpClientConfig); } - resource isolated function delete [string objectType](map headers = {}, *DeleteCrmObjectSchemasV3SchemasObjecttype_archiveQueries queries) returns http:Response|error { - string resourcePath = string `/${getEncodedUri(objectType)}`; + resource isolated function get crm\-object\-schemas/v3/schemas(map headers = {}, *GetCrmObjectSchemasV3SchemasGetAllQueries queries) returns CollectionResponseObjectSchemaNoPaging|error { + string resourcePath = string `/crm-object-schemas/v3/schemas`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } resourcePath = resourcePath + check getPathForQueryParam(queries); - map httpHeaders = getMapForHeaders(headerValues); - return self.clientEp->delete(resourcePath, headers = httpHeaders); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->get(resourcePath, httpHeaders); } - resource isolated function delete [string objectType]/associations/[string associationIdentifier](map headers = {}) returns http:Response|error { - string resourcePath = string `/${getEncodedUri(objectType)}/associations/${getEncodedUri(associationIdentifier)}`; + resource isolated function post crm\-object\-schemas/v3/schemas(ObjectSchemaEgg payload, map headers = {}) returns ObjectSchema|error { + string resourcePath = string `/crm-object-schemas/v3/schemas`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } - map httpHeaders = getMapForHeaders(headerValues); - return self.clientEp->delete(resourcePath, headers = httpHeaders); + 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); } - resource isolated function get .(map headers = {}, *GetCrmObjectSchemasV3Schemas_getallQueries queries) returns CollectionResponseObjectSchemaNoPaging|error { - string resourcePath = string ``; + resource isolated function get crm\-object\-schemas/v3/schemas/[string objectType](map headers = {}) returns ObjectSchema|error { + string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } - resourcePath = resourcePath + check getPathForQueryParam(queries); - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); return self.clientEp->get(resourcePath, httpHeaders); } - resource isolated function get [string objectType](map headers = {}) returns ObjectSchema|error { - string resourcePath = string `/${getEncodedUri(objectType)}`; + resource isolated function delete crm\-object\-schemas/v3/schemas/[string objectType](map headers = {}, *DeleteCrmObjectSchemasV3SchemasObjectTypeArchiveQueries queries) returns error? { + string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } - map httpHeaders = getMapForHeaders(headerValues); - return self.clientEp->get(resourcePath, httpHeaders); + resourcePath = resourcePath + check getPathForQueryParam(queries); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->delete(resourcePath, headers = httpHeaders); } - resource isolated function patch [string objectType](ObjectTypeDefinitionPatch payload, map headers = {}) returns ObjectTypeDefinition|error { - string resourcePath = string `/${getEncodedUri(objectType)}`; + resource isolated function patch crm\-object\-schemas/v3/schemas/[string objectType](ObjectTypeDefinitionPatch payload, map headers = {}) returns ObjectTypeDefinition|error { + string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } - map httpHeaders = getMapForHeaders(headerValues); + 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); } - resource isolated function post .(ObjectSchemaEgg payload, map headers = {}) returns ObjectSchema|error { - string resourcePath = string ``; + resource isolated function post crm\-object\-schemas/v3/schemas/[string objectType]/associations(AssociationDefinitionEgg payload, map headers = {}) returns AssociationDefinition|error { + string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}/associations`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } - map httpHeaders = getMapForHeaders(headerValues); + 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); } - resource isolated function post [string objectType]/associations(AssociationDefinitionEgg payload, map headers = {}) returns AssociationDefinition|error { - string resourcePath = string `/${getEncodedUri(objectType)}/associations`; + resource isolated function delete crm\-object\-schemas/v3/schemas/[string objectType]/associations/[string associationIdentifier](map headers = {}) returns error? { + string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}/associations/${getEncodedUri(associationIdentifier)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy; + headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; } - map httpHeaders = getMapForHeaders(headerValues); - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - return self.clientEp->post(resourcePath, request, httpHeaders); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->delete(resourcePath, headers = httpHeaders); } } diff --git a/ballerina/types.bal b/ballerina/types.bal index bfd0a87..a5a862d 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -1,18 +1,34 @@ -// AUTO-GENERATED FILE. +// AUTO-GENERATED FILE. DO NOT MODIFY. // This file is auto-generated by the Ballerina OpenAPI tool. +// Copyright (c) 2024, 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; -# Defines attributes to update on an object type. +# Defines attributes to update on an object type public type ObjectTypeDefinitionPatch record { - # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type. + # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type string[] secondaryDisplayProperties?; - # The names of properties that should be **required** when creating an object of this type. + # The names of properties that should be **required** when creating an object of this type string[] requiredProperties?; - # Names of properties that will be indexed for this object type in by HubSpot's product search. + # Names of properties that will be indexed for this object type in by HubSpot's product search string[] searchableProperties?; boolean clearDescription?; - # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type. + # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type string primaryDisplayProperty?; string description?; boolean restorable?; @@ -23,193 +39,165 @@ public type CollectionResponseObjectSchemaNoPaging record { ObjectSchema[] results; }; -# Defines an object type. +# Defines an object type public type ObjectTypeDefinition record { - # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type. + # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type string[] secondaryDisplayProperties?; string objectTypeId?; string description?; string fullyQualifiedName?; ObjectTypeDefinitionLabels labels; boolean archived?; - # When the object type was created. + # When the object type was created string createdAt?; - # The names of properties that should be **required** when creating an object of this type. + # The names of properties that should be **required** when creating an object of this type string[] requiredProperties; - # Names of properties that will be indexed for this object type in by HubSpot's product search. + # Names of properties that will be indexed for this object type in by HubSpot's product search string[] searchableProperties?; - # The ID of the account that this object type is specific to. + # The ID of the account that this object type is specific to int:Signed32 portalId?; - # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type. + # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type string primaryDisplayProperty?; - # A unique name for this object. For internal use only. + # A unique name for this object. For internal use only string name; - # A unique ID for this object type. Will be defined as {meta-type}-{unique ID}. + # A unique ID for this object type. Will be defined as {meta-type}-{unique ID} string id; - # When the object type was last updated. + # When the object type was last updated string updatedAt?; }; -# Represents the Queries record for the operation: get-/crm-object-schemas/v3/schemas_getAll -public type GetCrmObjectSchemasV3Schemas_getallQueries record { - # Whether to return only results that have been archived. +# Represents the Queries record for the operation: delete-/crm-object-schemas/v3/schemas/{objectType}_archive +public type DeleteCrmObjectSchemasV3SchemasObjectTypeArchiveQueries record { + # Whether to return only results that have been archived boolean archived = false; }; # Defines a enumeration property option public type OptionInput record { - # Hidden options won't be shown in HubSpot. + # Hidden options won't be shown in HubSpot boolean hidden; - # Options are shown in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values. + # Options are shown in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values int:Signed32 displayOrder; - # A description of the option. + # A description of the option string description?; - # A human-readable option label that will be shown in HubSpot. + # A human-readable option label that will be shown in HubSpot string label; - # The internal value of the option, which must be used when setting the property value through the API. + # The internal value of the option, which must be used when setting the property value through the API string value; }; -# Represents the Queries record for the operation: delete-/crm-object-schemas/v3/schemas/{objectType}_archive -public type DeleteCrmObjectSchemasV3SchemasObjecttype_archiveQueries record { - # Whether to return only results that have been archived. +# Represents the Queries record for the operation: get-/crm-object-schemas/v3/schemas_getAll +public type GetCrmObjectSchemasV3SchemasGetAllQueries record { + # Whether to return only results that have been archived boolean archived = false; }; -# 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 PropertyModificationMetadata record { + # + boolean readOnlyOptions?; + # + boolean readOnlyValue; + # + boolean readOnlyDefinition; + # + boolean archivable; +}; -# Defines a property to create. +# Defines a property to create public type ObjectTypePropertyCreate record { boolean hidden?; - # Controls how the property options will be sorted in the HubSpot UI. + # Controls how the property options will be sorted in the HubSpot UI "DISPLAY_ORDER"|"ALPHABETICAL" optionSortStrategy?; - # The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values. + # The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values int:Signed32 displayOrder?; - # A description of the property that will be shown as help text in HubSpot. + # A description of the property that will be shown as help text in HubSpot string description?; - # Whether the property will display the currency symbol in the HubSpot UI. + # Whether the property will display the currency symbol in the HubSpot UI boolean showCurrencySymbol?; - # A human-readable property label that will be shown in HubSpot. + # A human-readable property label that will be shown in HubSpot string label; - # The data type of the property. + # The data type of the property "string"|"number"|"date"|"datetime"|"enumeration"|"bool" 'type; - # Whether the property can be used in a HubSpot form. + # Whether the property can be used in a HubSpot form boolean formField?; - # The name of the group this property belongs to. + # The name of the group this property belongs to string groupName?; - # Defines the options this property will return, e.g. OWNER would return name of users on the portal. + # Defines the options this property will return, e.g. OWNER would return name of users on the portal string referencedObjectType?; # Controls how text properties are formatted in the HubSpot UI "unformatted_single_line"|"multi_line"|"email"|"phone_number"|"domain_name"|"ip_address"|"physical_address"|"postal_code" textDisplayHint?; - # The internal property name, which must be used when referencing the property from the API. + # The internal property name, which must be used when referencing the property from the API string name; - # A list of available options for the property. This field is only required for enumerated properties. + # A list of available options for the property. This field is only required for enumerated properties OptionInput[] options?; # Allow users to search for information entered to this field (limited to 3 properties) boolean searchableInGlobalSearch?; # Controls how numeric properties are formatted in the HubSpot UI "unformatted"|"formatted"|"currency"|"percentage"|"duration"|"probability" numberDisplayHint?; - # Whether or not the property's value must be unique. Once set, this can't be changed. + # Whether or not the property's value must be unique. Once set, this can't be changed boolean hasUniqueValue?; - # Controls how the property appears in HubSpot. + # Controls how the property appears in HubSpot string fieldType; }; -public type PropertyModificationMetadata record { - # - boolean readOnlyOptions?; - # - boolean readOnlyValue; - # - boolean readOnlyDefinition; - # - boolean archivable; -}; - -# Defines an association between two object types. +# Defines an association between two object types public type AssociationDefinitionEgg record { - # ID of the primary object type to link from. + # ID of the primary object type to link from string fromObjectTypeId; - # A unique name for this association. + # A unique name for this association string name?; - # ID of the target object type to link to. + # ID of the target object type to link to string toObjectTypeId; }; -# Defines an association between two object types. +# Defines an association between two object types public type AssociationDefinition record { - # When the association was defined. + # When the association was defined string createdAt?; - # ID of the primary object type to link from. + # ID of the primary object type to link from string fromObjectTypeId; - # A unique name for this association. + # A unique name for this association string name?; - # A unique ID for this association. + # A unique ID for this association string id; - # ID of the target object type to link to. + # ID of the target object type to link to string toObjectTypeId; - # When the association was last updated. + # When the association was last updated string updatedAt?; }; -# Defines an object schema, including its properties and associations. +# Defines an object schema, including its properties and associations public type ObjectSchema record { - # Associations defined for a given object type. + # Associations defined for a given object type AssociationDefinition[] associations; - # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type. + # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type string[] secondaryDisplayProperties?; int:Signed32 createdByUserId?; string objectTypeId?; string description?; int:Signed32 updatedByUserId?; - # An assigned unique ID for the object, including portal ID and object name. + # An assigned unique ID for the object, including portal ID and object name string fullyQualifiedName?; ObjectTypeDefinitionLabels labels; boolean archived?; - # When the object schema was created. + # When the object schema was created string createdAt?; - # The names of properties that should be **required** when creating an object of this type. + # The names of properties that should be **required** when creating an object of this type string[] requiredProperties; - # Names of properties that will be indexed for this object type in by HubSpot's product search. + # Names of properties that will be indexed for this object type in by HubSpot's product search string[] searchableProperties?; - # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type. + # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type string primaryDisplayProperty?; - # A unique name for the schema's object type. + # A unique name for the schema's object type string name; - # A unique ID for this schema's object type. Will be defined as {meta-type}-{unique ID}. + # A unique ID for this schema's object type. Will be defined as {meta-type}-{unique ID} string id; - # Properties defined for this object type. + # Properties defined for this object type Property[] properties; - # When the object schema was last updated. + # When the object schema was last updated string updatedAt?; }; -# 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 AnydataDefault record {| - *http:DefaultStatusCodeResponse; - anydata body; -|}; - # OAuth2 Refresh Token Grant Configs public type OAuth2RefreshTokenGrantConfig record {| *http:OAuth2RefreshTokenGrantConfig; @@ -217,7 +205,7 @@ public type OAuth2RefreshTokenGrantConfig record {| string refreshUrl = "https://api.hubapi.com/oauth/v1/token"; |}; -# Singular and plural labels for the object. Used in CRM display. +# Singular and plural labels for the object. Used in CRM display public type ObjectTypeDefinitionLabels record { # The word for multiple objects. (There’s no way to change this later.) string plural?; @@ -225,94 +213,94 @@ public type ObjectTypeDefinitionLabels record { string singular?; }; -# Defines a new object type, its properties, and associations. +# The options available when a property is an enumeration +public type Option record { + # Hidden options will not be displayed in HubSpot + boolean hidden; + # Options are displayed in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values + int:Signed32 displayOrder?; + # A description of the option + string description?; + # A human-readable option label that will be shown in HubSpot + string label; + # The internal value of the option, which must be used when setting the property value through the API + string value; +}; + +# Defines a new object type, its properties, and associations public type ObjectSchemaEgg record { - # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type. + # The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type string[] secondaryDisplayProperties?; - # The names of properties that should be **required** when creating an object of this type. + # The names of properties that should be **required** when creating an object of this type string[] requiredProperties; - # Names of properties that will be indexed for this object type in by HubSpot's product search. + # Names of properties that will be indexed for this object type in by HubSpot's product search string[] searchableProperties?; - # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type. + # The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type string primaryDisplayProperty?; - # A unique name for this object. For internal use only. + # A unique name for this object. For internal use only string name; string description?; - # Associations defined for this object type. + # Associations defined for this object type string[] associatedObjects; - # Properties defined for this object type. + # Properties defined for this object type ObjectTypePropertyCreate[] properties; ObjectTypeDefinitionLabels labels; }; -# The options available when a property is an enumeration -public type Option record { - # Hidden options will not be displayed in HubSpot. - boolean hidden; - # Options are displayed in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values. - int:Signed32 displayOrder?; - # A description of the option. - string description?; - # A human-readable option label that will be shown in HubSpot. - string label; - # The internal value of the option, which must be used when setting the property value through the API. - string value; -}; - # Defines a property public type Property record { boolean hidden?; - # The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values. + # The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values int:Signed32 displayOrder?; - # A description of the property that will be shown as help text in HubSpot. + # A description of the property that will be shown as help text in HubSpot string description; - # Whether the property will display the currency symbol set in the account settings. + # Whether the property will display the currency symbol set in the account settings boolean showCurrencySymbol?; - # The property data type. + # The property data type string 'type; - # This will be true for default object properties built into HubSpot. + # This will be true for default object properties built into HubSpot boolean hubspotDefined?; # When the property was created string createdAt?; - # Whether or not the property is archived. + # Whether or not the property is archived boolean archived?; - # A list of valid options for the property. This field is required for enumerated properties, but will be empty for other property types. + # A list of valid options for the property. This field is required for enumerated properties, but will be empty for other property types Option[] options; - # Whether or not the property's value must be unique. Once set, this can't be changed. + # Whether or not the property's value must be unique. Once set, this can't be changed boolean hasUniqueValue?; - # For default properties, true indicates that the property is calculated by a HubSpot process. It has no effect for custom properties. + # For default properties, true indicates that the property is calculated by a HubSpot process. It has no effect for custom properties boolean calculated?; - # For default properties, true indicates that the options are stored externally to the property settings. + # For default properties, true indicates that the options are stored externally to the property settings boolean externalOptions?; - # + # string updatedAt?; - # The internal ID of the user who created the property in HubSpot. This field may not exist if the property was created outside of HubSpot. + # The internal ID of the user who created the property in HubSpot. This field may not exist if the property was created outside of HubSpot string createdUserId?; PropertyModificationMetadata modificationMetadata?; string[] sensitiveDataCategories?; - # A human-readable property label that will be shown in HubSpot. + # A human-readable property label that will be shown in HubSpot string label; - # Whether or not the property can be used in a HubSpot form. + # Whether or not the property can be used in a HubSpot form boolean formField?; "non_sensitive"|"sensitive"|"highly_sensitive" dataSensitivity?; - # When the property was archived. + # When the property was archived string archivedAt?; - # The name of the property group the property belongs to. + # The name of the property group the property belongs to string groupName; - # If this property is related to other object(s), they'll be listed here. + # If this property is related to other object(s), they'll be listed here string referencedObjectType?; - # The internal property name, which must be used when referencing the property via the API. + # The internal property name, which must be used when referencing the property via the API string name; string calculationFormula?; - # Controls how the property appears in HubSpot. + # Controls how the property appears in HubSpot string fieldType; - # The internal user ID of the user who updated the property in HubSpot. This field may not exist if the property was updated outside of HubSpot. + # The internal user ID of the user who updated the property in HubSpot. This field may not exist if the property was updated outside of HubSpot string updatedUserId?; }; # Provides API key configurations needed when communicating with a remote HTTP endpoint. public type ApiKeysConfig record {| - string private\-app\-legacy; + string privateAppLegacy; |}; # Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint. @@ -323,29 +311,38 @@ public type ConnectionConfig record {| # The HTTP version understood by the client http:HttpVersion httpVersion = http:HTTP_2_0; # Configurations related to HTTP/1.x protocol - ClientHttp1Settings http1Settings?; + http:ClientHttp1Settings http1Settings = {}; # Configurations related to HTTP/2 protocol - http:ClientHttp2Settings http2Settings?; + http:ClientHttp2Settings http2Settings = {}; # The maximum time to wait (in seconds) for a response before closing the connection - decimal timeout = 60; + decimal timeout = 30; # The choice of setting `forwarded`/`x-forwarded` header string forwarded = "disable"; + # Configurations associated with Redirection + http:FollowRedirects followRedirects?; # Configurations associated with request pooling http:PoolConfiguration poolConfig?; # HTTP caching related configurations - http:CacheConfig cache?; + http:CacheConfig cache = {}; # Specifies the way of handling compression (`accept-encoding`) header http:Compression compression = http:COMPRESSION_AUTO; # Configurations associated with the behaviour of the Circuit Breaker http:CircuitBreakerConfig circuitBreaker?; # Configurations associated with retrying http:RetryConfig retryConfig?; + # Configurations associated with cookies + http:CookieConfig cookieConfig?; # Configurations associated with inbound response size limits - http:ResponseLimitConfigs responseLimits?; + http:ResponseLimitConfigs responseLimits = {}; # SSL/TLS-related options http:ClientSecureSocket secureSocket?; # Proxy server related options http:ProxyConfig proxy?; + # Provides settings related to client socket configuration + http:ClientSocketConfig socketConfig = {}; # Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default boolean validation = true; + # Enables relaxed data binding on the client side. When enabled, `nil` values are treated as optional, + # and absent fields are handled as `nilable` types. Enabled by default. + boolean laxDataBinding = true; |}; diff --git a/ballerina/utils.bal b/ballerina/utils.bal index db366d6..3cbf6df 100644 --- a/ballerina/utils.bal +++ b/ballerina/utils.bal @@ -1,6 +1,23 @@ -// AUTO-GENERATED FILE. +// AUTO-GENERATED FILE. DO NOT MODIFY. // This file is auto-generated by the Ballerina OpenAPI tool. +// Copyright (c) 2024, 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; @@ -170,12 +187,13 @@ isolated function getEncodedUri(anydata value) returns string { # + 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 queryParam.length() > 0 { + if queriesMap.length() > 0 { param.push("?"); - foreach var [key, value] in queryParam.entries() { + foreach var [key, value] in queriesMap.entries() { if value is () { - _ = queryParam.remove(key); + _ = queriesMap.remove(key); continue; } Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : defaultEncoding; @@ -199,20 +217,3 @@ isolated function getPathForQueryParam(map queryParam, map en string restOfPath = string:'join("", ...param); return restOfPath; } - -# Generate header map for given header values. -# -# + headerParam - Headers map -# + return - Returns generated map or error at failure of client initialization -isolated function getMapForHeaders(map headerParam) returns map { - map headerMap = {}; - foreach var [key, value] in headerParam.entries() { - if value is SimpleBasicType[] { - headerMap[key] = from SimpleBasicType data in value - select data.toString(); - } else { - headerMap[key] = value.toString(); - } - } - return headerMap; -} diff --git a/gradle.properties b/gradle.properties index 46290c9..f8e339e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,4 @@ version=1.0.0-SNAPSHOT releasePluginVersion=2.8.0 ballerinaGradlePluginVersion=2.2.4 -ballerinaLangVersion=2201.10.0 +ballerinaLangVersion=2201.12.2 From 5e6e75f3fce4745ccfa40ce904ad0292a2873236 Mon Sep 17 00:00:00 2001 From: DimuthuMadushan Date: Wed, 9 Apr 2025 15:21:39 +0530 Subject: [PATCH 3/6] [Automated] Update the toml files --- ballerina/Ballerina.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 58e2d67..23ba7dc 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -2,7 +2,7 @@ distribution = "2201.10.0" org = "ballerinax" name = "hubspot.crm.obj.schemas" -version = "1.0.0" +version = "2.0.0" license = ["Apache-2.0"] authors = ["Ballerina"] keywords = ["schema", "hubspot", "object"] @@ -10,6 +10,3 @@ repository = "https://github.com/ballerina-platform/module-ballerinax-hubspot.cr [build-options] observabilityIncluded = true - -[platform.java17] -graalvmCompatible = true From 47cad50d06f35a845828ba852734ff9379143b32 Mon Sep 17 00:00:00 2001 From: DimuthuMadushan Date: Wed, 9 Apr 2025 15:55:44 +0530 Subject: [PATCH 4/6] Update the spec --- ballerina/client.bal | 29 ++++++++++++++------------- build-config/resources/Ballerina.toml | 3 --- docs/spec/openapi.json | 10 ++++----- gradle.properties | 4 ++-- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/ballerina/client.bal b/ballerina/client.bal index aa5a5dd..9ed55ed 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -23,6 +23,7 @@ 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` @@ -39,8 +40,8 @@ public isolated client class Client { self.clientEp = check new (serviceUrl, httpClientConfig); } - resource isolated function get crm\-object\-schemas/v3/schemas(map headers = {}, *GetCrmObjectSchemasV3SchemasGetAllQueries queries) returns CollectionResponseObjectSchemaNoPaging|error { - string resourcePath = string `/crm-object-schemas/v3/schemas`; + resource isolated function get .(map headers = {}, *GetCrmObjectSchemasV3SchemasGetAllQueries queries) returns CollectionResponseObjectSchemaNoPaging|error { + string resourcePath = string `/`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; @@ -50,8 +51,8 @@ public isolated client class Client { return self.clientEp->get(resourcePath, httpHeaders); } - resource isolated function post crm\-object\-schemas/v3/schemas(ObjectSchemaEgg payload, map headers = {}) returns ObjectSchema|error { - string resourcePath = string `/crm-object-schemas/v3/schemas`; + resource isolated function post .(ObjectSchemaEgg payload, map headers = {}) returns ObjectSchema|error { + string resourcePath = string `/`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; @@ -63,8 +64,8 @@ public isolated client class Client { return self.clientEp->post(resourcePath, request, httpHeaders); } - resource isolated function get crm\-object\-schemas/v3/schemas/[string objectType](map headers = {}) returns ObjectSchema|error { - string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}`; + resource isolated function get [string objectType](map headers = {}) returns ObjectSchema|error { + string resourcePath = string `/${getEncodedUri(objectType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; @@ -73,8 +74,8 @@ public isolated client class Client { return self.clientEp->get(resourcePath, httpHeaders); } - resource isolated function delete crm\-object\-schemas/v3/schemas/[string objectType](map headers = {}, *DeleteCrmObjectSchemasV3SchemasObjectTypeArchiveQueries queries) returns error? { - string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}`; + resource isolated function delete [string objectType](map headers = {}, *DeleteCrmObjectSchemasV3SchemasObjectTypeArchiveQueries queries) returns error? { + string resourcePath = string `/${getEncodedUri(objectType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; @@ -84,8 +85,8 @@ public isolated client class Client { return self.clientEp->delete(resourcePath, headers = httpHeaders); } - resource isolated function patch crm\-object\-schemas/v3/schemas/[string objectType](ObjectTypeDefinitionPatch payload, map headers = {}) returns ObjectTypeDefinition|error { - string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}`; + resource isolated function patch [string objectType](ObjectTypeDefinitionPatch payload, map headers = {}) returns ObjectTypeDefinition|error { + string resourcePath = string `/${getEncodedUri(objectType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; @@ -97,8 +98,8 @@ public isolated client class Client { return self.clientEp->patch(resourcePath, request, httpHeaders); } - resource isolated function post crm\-object\-schemas/v3/schemas/[string objectType]/associations(AssociationDefinitionEgg payload, map headers = {}) returns AssociationDefinition|error { - string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}/associations`; + resource isolated function post [string objectType]/associations(AssociationDefinitionEgg payload, map headers = {}) returns AssociationDefinition|error { + string resourcePath = string `/${getEncodedUri(objectType)}/associations`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; @@ -110,8 +111,8 @@ public isolated client class Client { return self.clientEp->post(resourcePath, request, httpHeaders); } - resource isolated function delete crm\-object\-schemas/v3/schemas/[string objectType]/associations/[string associationIdentifier](map headers = {}) returns error? { - string resourcePath = string `/crm-object-schemas/v3/schemas/${getEncodedUri(objectType)}/associations/${getEncodedUri(associationIdentifier)}`; + resource isolated function delete [string objectType]/associations/[string associationIdentifier](map headers = {}) returns error? { + string resourcePath = string `/${getEncodedUri(objectType)}/associations/${getEncodedUri(associationIdentifier)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app-legacy"] = self.apiKeyConfig?.privateAppLegacy; diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index 32e44cd..47d713c 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -10,6 +10,3 @@ repository = "https://github.com/ballerina-platform/module-ballerinax-hubspot.cr [build-options] observabilityIncluded = true - -[platform.java17] -graalvmCompatible = true diff --git a/docs/spec/openapi.json b/docs/spec/openapi.json index 964e199..34364f3 100644 --- a/docs/spec/openapi.json +++ b/docs/spec/openapi.json @@ -19,13 +19,13 @@ "x-hubspot-introduction" : "Use the custom objects schema API to define new types of CRM records in your account. After setting up an object schema, you'll then be able to create custom records under that object both in HubSpot and using the custom object records API." }, "servers" : [ { - "url" : "https://api.hubapi.com" + "url" : "https://api.hubapi.com/crm-object-schemas/v3/schemas" } ], "tags" : [ { "name" : "Core" } ], "paths" : { - "/crm-object-schemas/v3/schemas" : { + "/" : { "get" : { "tags" : [ "Core" ], "summary" : "Get all schemas", @@ -105,7 +105,7 @@ } ] } }, - "/crm-object-schemas/v3/schemas/{objectType}" : { + "/{objectType}" : { "get" : { "tags" : [ "Core" ], "summary" : "Get an existing schema", @@ -234,7 +234,7 @@ } ] } }, - "/crm-object-schemas/v3/schemas/{objectType}/associations" : { + "/{objectType}/associations" : { "post" : { "tags" : [ "Core" ], "summary" : "Create an association", @@ -282,7 +282,7 @@ } ] } }, - "/crm-object-schemas/v3/schemas/{objectType}/associations/{associationIdentifier}" : { + "/{objectType}/associations/{associationIdentifier}" : { "delete" : { "tags" : [ "Core" ], "summary" : "Remove an association", diff --git a/gradle.properties b/gradle.properties index f8e339e..5b88d03 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.caching=true group=io.ballerina.lib -version=1.0.0-SNAPSHOT +version=2.0.0-SNAPSHOT releasePluginVersion=2.8.0 -ballerinaGradlePluginVersion=2.2.4 +ballerinaGradlePluginVersion=3.0.0 ballerinaLangVersion=2201.12.2 From 4e7ed1b3b454a8ede08ea2e3aca1b0ce2d249e06 Mon Sep 17 00:00:00 2001 From: DimuthuMadushan Date: Wed, 9 Apr 2025 15:57:44 +0530 Subject: [PATCH 5/6] [Automated] Update the toml files --- ballerina/Dependencies.toml | 46 ++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 876bd3a..71eea86 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.12.2" [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -22,7 +22,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.10.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -33,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -41,16 +41,25 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "1.1.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -61,12 +70,13 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.4" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -93,7 +103,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.3" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -110,7 +120,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -208,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -219,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.1" +version = "2.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -230,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -246,7 +256,7 @@ modules = [ [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -254,7 +264,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.10.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -263,7 +273,7 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -286,7 +296,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.5.0" +version = "2.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -294,7 +304,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -317,7 +327,7 @@ modules = [ [[package]] org = "ballerinax" name = "hubspot.crm.obj.schemas" -version = "1.0.0" +version = "2.0.0" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "io"}, From 6317ff9c28ea0713fb2d5ab46b7e893bef0bca3d Mon Sep 17 00:00:00 2001 From: DimuthuMadushan Date: Wed, 9 Apr 2025 15:58:12 +0530 Subject: [PATCH 6/6] Fix test failures --- ballerina/tests/tests.bal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ballerina/tests/tests.bal b/ballerina/tests/tests.bal index d10981d..0d4b13e 100644 --- a/ballerina/tests/tests.bal +++ b/ballerina/tests/tests.bal @@ -112,8 +112,8 @@ isolated function testDeleteSchema() returns error? { string objId = "testid"; // Make DELETE request to delete the schema - http:Response response = check hpClient->/[objId].delete(); - test:assertEquals(response.statusCode, 204); + error? response = check hpClient->/[objId].delete(); + test:assertEquals(response, ()); } // Test: Update Schema - Updates an existing schema by ID @@ -174,6 +174,6 @@ isolated function testDeleteAssosiation() returns error? { string assId = "testid"; // Make DELETE request to delete the schema - http:Response response = check hpClient->/[objId]/associations/[assId].delete(); - test:assertEquals(response.statusCode, 204); + error? response = check hpClient->/[objId]/associations/[assId].delete(); + test:assertEquals(response, ()); }