Class: HubSpotSDK::Resources::Crm::Associations
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Associations
- Defined in:
- lib/hubspot_sdk/resources/crm/associations.rb,
lib/hubspot_sdk/resources/crm/associations/batch.rb
Defined Under Namespace
Classes: Batch
Instance Attribute Summary collapse
Instance Method Summary collapse
- #delete(to_object_id, object_type:, object_id_:, to_object_type:, request_options: {}) ⇒ nil
-
#initialize(client:) ⇒ Associations
constructor
private
A new instance of Associations.
-
#list(to_object_type, object_type:, object_id_:, after: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Crm::MultiAssociatedObjectWithLabel>
Some parameter documentations has been truncated, see Models::Crm::AssociationListParams for more details.
-
#request_high_usage_report(user_id, request_options: {}) ⇒ HubSpotSDK::Models::Crm::ReportCreationResponse
Requests a report of all objects in the portal which have a high usage of associations.
- #search(object_type, after:, filter_groups:, limit:, properties:, sorts:, query: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseWithTotalSimplePublicObject
- #update_association_labels(to_object_id, object_type:, object_id_:, to_object_type:, body:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::LabelsBetweenObjectPair
Constructor Details
#initialize(client:) ⇒ Associations
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 Associations.
199 200 201 202 |
# File 'lib/hubspot_sdk/resources/crm/associations.rb', line 199 def initialize(client:) @client = client @batch = HubSpotSDK::Resources::Crm::Associations::Batch.new(client: client) end |
Instance Attribute Details
#batch ⇒ HubSpotSDK::Resources::Crm::Associations::Batch (readonly)
8 9 10 |
# File 'lib/hubspot_sdk/resources/crm/associations.rb', line 8 def batch @batch end |
Instance Method Details
#delete(to_object_id, object_type:, object_id_:, to_object_type:, request_options: {}) ⇒ nil
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/hubspot_sdk/resources/crm/associations.rb', line 70 def delete(to_object_id, params) parsed, = HubSpotSDK::Crm::AssociationDeleteParams.dump_request(params) object_type = parsed.delete(:object_type) do raise ArgumentError.new("missing required path argument #{_1}") end object_id_ = parsed.delete(:object_id_) do raise ArgumentError.new("missing required path argument #{_1}") end to_object_type = parsed.delete(:to_object_type) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: [ "crm/objects/2026-03/%1$s/%2$s/associations/%3$s/%4$s", object_type, object_id_, to_object_type, to_object_id ], model: NilClass, options: ) end |
#list(to_object_type, object_type:, object_id_:, after: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Crm::MultiAssociatedObjectWithLabel>
Some parameter documentations has been truncated, see Models::Crm::AssociationListParams for more details.
Retrieve all associations between a specific record and an object type. Limit 500 per call.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/hubspot_sdk/resources/crm/associations.rb', line 33 def list(to_object_type, params) parsed, = HubSpotSDK::Crm::AssociationListParams.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 object_id_ = parsed.delete(:object_id_) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: [ "crm/objects/2026-03/%1$s/%2$s/associations/%3$s", object_type, object_id_, to_object_type ], query: query, page: HubSpotSDK::Internal::Page, model: HubSpotSDK::Crm::MultiAssociatedObjectWithLabel, options: ) end |
#request_high_usage_report(user_id, request_options: {}) ⇒ HubSpotSDK::Models::Crm::ReportCreationResponse
Requests a report of all objects in the portal which have a high usage of associations
109 110 111 112 113 114 115 116 |
# File 'lib/hubspot_sdk/resources/crm/associations.rb', line 109 def request_high_usage_report(user_id, params = {}) @client.request( method: :post, path: ["crm/associations/2026-03/usage/high-usage-report/%1$s", user_id], model: HubSpotSDK::Crm::ReportCreationResponse, options: params[:request_options] ) end |
#search(object_type, after:, filter_groups:, limit:, properties:, sorts:, query: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseWithTotalSimplePublicObject
139 140 141 142 143 144 145 146 147 148 |
# File 'lib/hubspot_sdk/resources/crm/associations.rb', line 139 def search(object_type, params) parsed, = HubSpotSDK::Crm::AssociationSearchParams.dump_request(params) @client.request( method: :post, path: ["crm/objects/2026-03/%1$s/search", object_type], body: parsed, model: HubSpotSDK::Crm::CollectionResponseWithTotalSimplePublicObject, options: ) end |
#update_association_labels(to_object_id, object_type:, object_id_:, to_object_type:, body:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::LabelsBetweenObjectPair
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/hubspot_sdk/resources/crm/associations.rb', line 167 def update_association_labels(to_object_id, params) parsed, = HubSpotSDK::Crm::AssociationUpdateAssociationLabelsParams.dump_request(params) object_type = parsed.delete(:object_type) do raise ArgumentError.new("missing required path argument #{_1}") end object_id_ = parsed.delete(:object_id_) do raise ArgumentError.new("missing required path argument #{_1}") end to_object_type = parsed.delete(:to_object_type) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: [ "crm/objects/2026-03/%1$s/%2$s/associations/%3$s/%4$s", object_type, object_id_, to_object_type, to_object_id ], body: parsed[:body], model: HubSpotSDK::Crm::LabelsBetweenObjectPair, options: ) end |