Class: HubSpotSDK::Resources::Crm::ObjectSchemas
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::ObjectSchemas
- Defined in:
- lib/hubspot_sdk/resources/crm/object_schemas.rb,
lib/hubspot_sdk/resources/crm/object_schemas/batch.rb
Defined Under Namespace
Classes: Batch
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(allows_sensitive_properties:, associated_objects:, labels:, name:, properties:, required_properties:, searchable_properties:, secondary_display_properties:, description: nil, primary_display_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::ObjectSchema
Some parameter documentations has been truncated, see Models::Crm::ObjectSchemaCreateParams for more details.
-
#create_association(object_type, from_object_type_id:, to_object_type_id:, name: nil, request_options: {}) ⇒ HubSpotSDK::Models::AssociationDefinition
Create a new association between the specified object type and another object type.
-
#delete(object_type, archived: nil, request_options: {}) ⇒ nil
Remove a custom object schema from the account using its object type ID or fully qualified name.
-
#delete_association(association_identifier, object_type:, request_options: {}) ⇒ nil
Remove an association between two object types identified by the association identifier and object type.
-
#get(object_type, include_association_definitions: nil, include_audit_metadata: nil, include_property_definitions: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::ObjectSchema
Retrieve details of a custom object schema, including its properties and associations, using the object type ID or fully qualified name.
-
#initialize(client:) ⇒ ObjectSchemas
constructor
private
A new instance of ObjectSchemas.
-
#list(archived: nil, include_association_definitions: nil, include_audit_metadata: nil, include_property_definitions: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseObjectSchemaNoPaging
Retrieve all custom object schemas, with options to include property definitions, association definitions, and audit metadata.
-
#update(object_type, clear_description:, allows_sensitive_properties: nil, description: nil, labels: nil, primary_display_property: nil, required_properties: nil, restorable: nil, searchable_properties: nil, secondary_display_properties: nil, request_options: {}) ⇒ HubSpotSDK::Models::ObjectTypeDefinition
Update attributes of a custom object schema, such as properties and labels, using the object type ID or fully qualified name.
Constructor Details
#initialize(client:) ⇒ ObjectSchemas
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ObjectSchemas.
234 235 236 237 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 234 def initialize(client:) @client = client @batch = HubSpotSDK::Resources::Crm::ObjectSchemas::Batch.new(client: client) end |
Instance Attribute Details
#batch ⇒ HubSpotSDK::Resources::Crm::ObjectSchemas::Batch (readonly)
8 9 10 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 8 def batch @batch end |
Instance Method Details
#create(allows_sensitive_properties:, associated_objects:, labels:, name:, properties:, required_properties:, searchable_properties:, secondary_display_properties:, description: nil, primary_display_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::ObjectSchema
Some parameter documentations has been truncated, see Models::Crm::ObjectSchemaCreateParams for more details.
Create a new custom object schema by defining its properties and associations.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 42 def create(params) parsed, = HubSpotSDK::Crm::ObjectSchemaCreateParams.dump_request(params) @client.request( method: :post, path: "crm-object-schemas/2026-03/schemas", body: parsed, model: HubSpotSDK::Crm::ObjectSchema, options: ) end |
#create_association(object_type, from_object_type_id:, to_object_type_id:, name: nil, request_options: {}) ⇒ HubSpotSDK::Models::AssociationDefinition
Create a new association between the specified object type and another object type. This operation requires the definition of the association attributes, such as the primary and target object type IDs.
159 160 161 162 163 164 165 166 167 168 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 159 def create_association(object_type, params) parsed, = HubSpotSDK::Crm::ObjectSchemaCreateAssociationParams.dump_request(params) @client.request( method: :post, path: ["crm-object-schemas/2026-03/schemas/%1$s/associations", object_type], body: parsed, model: HubSpotSDK::AssociationDefinition, options: ) end |
#delete(object_type, archived: nil, request_options: {}) ⇒ nil
Remove a custom object schema from the account using its object type ID or fully qualified name.
132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 132 def delete(object_type, params = {}) parsed, = HubSpotSDK::Crm::ObjectSchemaDeleteParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["crm-object-schemas/2026-03/schemas/%1$s", object_type], query: query, model: NilClass, options: ) end |
#delete_association(association_identifier, object_type:, request_options: {}) ⇒ nil
Remove an association between two object types identified by the association identifier and object type. This operation is irreversible and will permanently delete the specified association.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 183 def delete_association(association_identifier, params) parsed, = HubSpotSDK::Crm::ObjectSchemaDeleteAssociationParams.dump_request(params) object_type = parsed.delete(:object_type) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: [ "crm-object-schemas/2026-03/schemas/%1$s/associations/%2$s", object_type, association_identifier ], model: NilClass, options: ) end |
#get(object_type, include_association_definitions: nil, include_audit_metadata: nil, include_property_definitions: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::ObjectSchema
Retrieve details of a custom object schema, including its properties and associations, using the object type ID or fully qualified name.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 215 def get(object_type, params = {}) parsed, = HubSpotSDK::Crm::ObjectSchemaGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["crm-object-schemas/2026-03/schemas/%1$s", object_type], query: query.transform_keys( include_association_definitions: "includeAssociationDefinitions", include_audit_metadata: "includeAuditMetadata", include_property_definitions: "includePropertyDefinitions" ), model: HubSpotSDK::Crm::ObjectSchema, options: ) end |
#list(archived: nil, include_association_definitions: nil, include_audit_metadata: nil, include_property_definitions: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseObjectSchemaNoPaging
Retrieve all custom object schemas, with options to include property definitions, association definitions, and audit metadata.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 102 def list(params = {}) parsed, = HubSpotSDK::Crm::ObjectSchemaListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "crm-object-schemas/2026-03/schemas", query: query.transform_keys( include_association_definitions: "includeAssociationDefinitions", include_audit_metadata: "includeAuditMetadata", include_property_definitions: "includePropertyDefinitions" ), model: HubSpotSDK::Crm::CollectionResponseObjectSchemaNoPaging, options: ) end |
#update(object_type, clear_description:, allows_sensitive_properties: nil, description: nil, labels: nil, primary_display_property: nil, required_properties: nil, restorable: nil, searchable_properties: nil, secondary_display_properties: nil, request_options: {}) ⇒ HubSpotSDK::Models::ObjectTypeDefinition
Update attributes of a custom object schema, such as properties and labels, using the object type ID or fully qualified name.
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/hubspot_sdk/resources/crm/object_schemas.rb', line 73 def update(object_type, params) parsed, = HubSpotSDK::Crm::ObjectSchemaUpdateParams.dump_request(params) @client.request( method: :patch, path: ["crm-object-schemas/2026-03/schemas/%1$s", object_type], body: parsed, model: HubSpotSDK::ObjectTypeDefinition, options: ) end |