Class: HubSpotSDK::Resources::Crm::Properties
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Properties
- Defined in:
- lib/hubspot_sdk/resources/crm/properties.rb,
lib/hubspot_sdk/resources/crm/properties/batch.rb,
lib/hubspot_sdk/resources/crm/properties/groups.rb
Defined Under Namespace
Instance Attribute Summary collapse
- #batch ⇒ HubSpotSDK::Resources::Crm::Properties::Batch readonly
- #groups ⇒ HubSpotSDK::Resources::Crm::Properties::Groups readonly
Instance Method Summary collapse
-
#create(object_type, field_type:, group_name:, label:, name:, type:, calculation_formula: nil, currency_property_name: nil, data_sensitivity: nil, description: nil, display_order: nil, external_options: nil, form_field: nil, has_unique_value: nil, hidden: nil, number_display_hint: nil, options: nil, referenced_object_type: nil, show_currency_symbol: nil, request_options: {}) ⇒ HubSpotSDK::Models::Property
Create and return a copy of a new property for the specified object type.
-
#delete(property_name, object_type:, request_options: {}) ⇒ nil
Move a property identified by propertyName to the recycling bin.
-
#get(property_name, object_type:, archived: nil, data_sensitivity: nil, locale: nil, properties: nil, request_options: {}) ⇒ HubSpotSDK::Models::Property
Read a property identified by propertyName.
-
#initialize(client:) ⇒ Properties
constructor
private
A new instance of Properties.
-
#list(object_type, archived: nil, data_sensitivity: nil, locale: nil, properties: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponsePropertyNoPaging
Read all existing properties for the specified object type and HubSpot account.
-
#update(property_name, object_type:, calculation_formula: nil, currency_property_name: nil, description: nil, display_order: nil, field_type: nil, form_field: nil, group_name: nil, hidden: nil, label: nil, number_display_hint: nil, options: nil, show_currency_symbol: nil, type: nil, request_options: {}) ⇒ HubSpotSDK::Models::Property
Some parameter documentations has been truncated, see Models::Crm::PropertyUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Properties
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 Properties.
206 207 208 209 210 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 206 def initialize(client:) @client = client @batch = HubSpotSDK::Resources::Crm::Properties::Batch.new(client: client) @groups = HubSpotSDK::Resources::Crm::Properties::Groups.new(client: client) end |
Instance Attribute Details
#batch ⇒ HubSpotSDK::Resources::Crm::Properties::Batch (readonly)
8 9 10 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 8 def batch @batch end |
#groups ⇒ HubSpotSDK::Resources::Crm::Properties::Groups (readonly)
11 12 13 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 11 def groups @groups end |
Instance Method Details
#create(object_type, field_type:, group_name:, label:, name:, type:, calculation_formula: nil, currency_property_name: nil, data_sensitivity: nil, description: nil, display_order: nil, external_options: nil, form_field: nil, has_unique_value: nil, hidden: nil, number_display_hint: nil, options: nil, referenced_object_type: nil, show_currency_symbol: nil, request_options: {}) ⇒ HubSpotSDK::Models::Property
Create and return a copy of a new property for the specified object type.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 41 def create(object_type, params) parsed, = HubSpotSDK::Crm::PropertyCreateParams.dump_request(params) @client.request( method: :post, path: ["crm/properties/2026-03/%1$s", object_type], body: parsed, model: HubSpotSDK::Property, options: ) end |
#delete(property_name, object_type:, request_options: {}) ⇒ nil
Move a property identified by propertyName to the recycling bin.
152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 152 def delete(property_name, params) parsed, = HubSpotSDK::Crm::PropertyDeleteParams.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/properties/2026-03/%1$s/%2$s", object_type, property_name], model: NilClass, options: ) end |
#get(property_name, object_type:, archived: nil, data_sensitivity: nil, locale: nil, properties: nil, request_options: {}) ⇒ HubSpotSDK::Models::Property
Read a property identified by propertyName.
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 187 def get(property_name, params) parsed, = HubSpotSDK::Crm::PropertyGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) object_type = parsed.delete(:object_type) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["crm/properties/2026-03/%1$s/%2$s", object_type, property_name], query: query.transform_keys(data_sensitivity: "dataSensitivity"), model: HubSpotSDK::Property, options: ) end |
#list(object_type, archived: nil, data_sensitivity: nil, locale: nil, properties: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponsePropertyNoPaging
Read all existing properties for the specified object type and HubSpot account.
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 129 def list(object_type, params = {}) parsed, = HubSpotSDK::Crm::PropertyListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["crm/properties/2026-03/%1$s", object_type], query: query.transform_keys(data_sensitivity: "dataSensitivity"), model: HubSpotSDK::Crm::CollectionResponsePropertyNoPaging, options: ) end |
#update(property_name, object_type:, calculation_formula: nil, currency_property_name: nil, description: nil, display_order: nil, field_type: nil, form_field: nil, group_name: nil, hidden: nil, label: nil, number_display_hint: nil, options: nil, show_currency_symbol: nil, type: nil, request_options: {}) ⇒ HubSpotSDK::Models::Property
Some parameter documentations has been truncated, see Models::Crm::PropertyUpdateParams for more details.
Perform a partial update of a property identified by { propertyName }. Provided fields will be overwritten.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/hubspot_sdk/resources/crm/properties.rb', line 95 def update(property_name, params) parsed, = HubSpotSDK::Crm::PropertyUpdateParams.dump_request(params) object_type = parsed.delete(:object_type) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["crm/properties/2026-03/%1$s/%2$s", object_type, property_name], body: parsed, model: HubSpotSDK::Property, options: ) end |