Class: HubSpotSDK::Resources::Crm::Objects::LineItems
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Objects::LineItems
- Defined in:
- lib/hubspot_sdk/resources/crm/objects/line_items.rb,
lib/hubspot_sdk/resources/crm/objects/line_items/batch.rb
Defined Under Namespace
Classes: Batch
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(associations:, properties:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Create a line item with the given properties and return a copy of the object, including the ID.
-
#delete(line_item_id, request_options: {}) ⇒ nil
Move an Object identified by ‘lineItemId` to the recycling bin.
-
#get(line_item_id, archived: nil, associations: nil, id_property: nil, properties: nil, properties_with_history: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObjectWithAssociations
Some parameter documentations has been truncated, see Models::Crm::Objects::LineItemGetParams for more details.
-
#initialize(client:) ⇒ LineItems
constructor
private
A new instance of LineItems.
-
#list(after: nil, archived: nil, associations: nil, limit: nil, properties: nil, properties_with_history: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Crm::SimplePublicObjectWithAssociations>
Some parameter documentations has been truncated, see Models::Crm::Objects::LineItemListParams for more details.
-
#search(after:, filter_groups:, limit:, properties:, sorts:, query: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseWithTotalSimplePublicObject
Execute a search for line items based on filters, properties, and sorting options provided in the request body.
-
#update(line_item_id, properties:, id_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Some parameter documentations has been truncated, see Models::Crm::Objects::LineItemUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ LineItems
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 LineItems.
212 213 214 215 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 212 def initialize(client:) @client = client @batch = HubSpotSDK::Resources::Crm::Objects::LineItems::Batch.new(client: client) end |
Instance Attribute Details
#batch ⇒ HubSpotSDK::Resources::Crm::Objects::LineItems::Batch (readonly)
9 10 11 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 9 def batch @batch end |
Instance Method Details
#create(associations:, properties:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Create a line item with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard line items is provided.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 26 def create(params) parsed, = HubSpotSDK::Crm::Objects::LineItemCreateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/line_items", body: parsed, model: HubSpotSDK::Crm::SimplePublicObject, options: ) end |
#delete(line_item_id, request_options: {}) ⇒ nil
Move an Object identified by ‘lineItemId` to the recycling bin.
123 124 125 126 127 128 129 130 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 123 def delete(line_item_id, params = {}) @client.request( method: :delete, path: ["crm/objects/2026-03/line_items/%1$s", line_item_id], model: NilClass, options: params[:request_options] ) end |
#get(line_item_id, archived: nil, associations: nil, id_property: nil, properties: nil, properties_with_history: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObjectWithAssociations
Some parameter documentations has been truncated, see Models::Crm::Objects::LineItemGetParams for more details.
Read an Object identified by ‘lineItemId`. `lineItemId` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 159 def get(line_item_id, params = {}) parsed, = HubSpotSDK::Crm::Objects::LineItemGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["crm/objects/2026-03/line_items/%1$s", line_item_id], query: query.transform_keys( id_property: "idProperty", properties_with_history: "propertiesWithHistory" ), model: HubSpotSDK::Crm::SimplePublicObjectWithAssociations, options: ) end |
#list(after: nil, archived: nil, associations: nil, limit: nil, properties: nil, properties_with_history: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Crm::SimplePublicObjectWithAssociations>
Some parameter documentations has been truncated, see Models::Crm::Objects::LineItemListParams for more details.
Read a page of line items. Control what is returned via the ‘properties` query param.
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 100 def list(params = {}) parsed, = HubSpotSDK::Crm::Objects::LineItemListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "crm/objects/2026-03/line_items", query: query.transform_keys(properties_with_history: "propertiesWithHistory"), page: HubSpotSDK::Internal::Page, model: HubSpotSDK::Crm::SimplePublicObjectWithAssociations, options: ) end |
#search(after:, filter_groups:, limit:, properties:, sorts:, query: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseWithTotalSimplePublicObject
Execute a search for line items based on filters, properties, and sorting options provided in the request body. This endpoint allows you to retrieve line items that match specific conditions, facilitating targeted data retrieval in CRM operations.
198 199 200 201 202 203 204 205 206 207 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 198 def search(params) parsed, = HubSpotSDK::Crm::Objects::LineItemSearchParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/line_items/search", body: parsed, model: HubSpotSDK::Crm::CollectionResponseWithTotalSimplePublicObject, options: ) end |
#update(line_item_id, properties:, id_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Some parameter documentations has been truncated, see Models::Crm::Objects::LineItemUpdateParams for more details.
Perform a partial update of an Object identified by ‘lineItemId`or optionally a unique property value as specified by the `idProperty` query param. `lineItemId` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/hubspot_sdk/resources/crm/objects/line_items.rb', line 61 def update(line_item_id, params) query_params = [:id_property] parsed, = HubSpotSDK::Crm::Objects::LineItemUpdateParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :patch, path: ["crm/objects/2026-03/line_items/%1$s", line_item_id], query: query.transform_keys(id_property: "idProperty"), body: parsed.except(*query_params), model: HubSpotSDK::Crm::SimplePublicObject, options: ) end |