Class: HubSpotSDK::Resources::Crm::Objects::Tickets
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Crm::Objects::Tickets
- Defined in:
- lib/hubspot_sdk/resources/crm/objects/tickets.rb,
lib/hubspot_sdk/resources/crm/objects/tickets/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 ticket with the given properties and return a copy of the object, including the ID.
-
#delete(ticket_id, request_options: {}) ⇒ nil
Move an Object identified by ‘ticketId` to the recycling bin.
-
#get(ticket_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::TicketGetParams for more details.
-
#initialize(client:) ⇒ Tickets
constructor
private
A new instance of Tickets.
-
#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::TicketListParams for more details.
-
#merge(object_id_to_merge:, primary_object_id:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Merge two tickets, combining them into one ticket record.
-
#search(after:, filter_groups:, limit:, properties:, sorts:, query: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseWithTotalSimplePublicObject
Search for tickets by filtering on properties, searching through associations, and sorting results.
-
#update(ticket_id, properties:, id_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Some parameter documentations has been truncated, see Models::Crm::Objects::TicketUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Tickets
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 Tickets.
234 235 236 237 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 234 def initialize(client:) @client = client @batch = HubSpotSDK::Resources::Crm::Objects::Tickets::Batch.new(client: client) end |
Instance Attribute Details
#batch ⇒ HubSpotSDK::Resources::Crm::Objects::Tickets::Batch (readonly)
9 10 11 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 9 def batch @batch end |
Instance Method Details
#create(associations:, properties:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Create a ticket with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard tickets is provided.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 26 def create(params) parsed, = HubSpotSDK::Crm::Objects::TicketCreateParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/tickets", body: parsed, model: HubSpotSDK::Crm::SimplePublicObject, options: ) end |
#delete(ticket_id, request_options: {}) ⇒ nil
Move an Object identified by ‘ticketId` to the recycling bin.
122 123 124 125 126 127 128 129 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 122 def delete(ticket_id, params = {}) @client.request( method: :delete, path: ["crm/objects/2026-03/tickets/%1$s", ticket_id], model: NilClass, options: params[:request_options] ) end |
#get(ticket_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::TicketGetParams for more details.
Read an Object identified by ‘ticketId`. `ticketId` 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.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 158 def get(ticket_id, params = {}) parsed, = HubSpotSDK::Crm::Objects::TicketGetParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["crm/objects/2026-03/tickets/%1$s", ticket_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::TicketListParams for more details.
Read a page of tickets. Control what is returned via the ‘properties` query param.
99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 99 def list(params = {}) parsed, = HubSpotSDK::Crm::Objects::TicketListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "crm/objects/2026-03/tickets", query: query.transform_keys(properties_with_history: "propertiesWithHistory"), page: HubSpotSDK::Internal::Page, model: HubSpotSDK::Crm::SimplePublicObjectWithAssociations, options: ) end |
#merge(object_id_to_merge:, primary_object_id:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Merge two tickets, combining them into one ticket record.
186 187 188 189 190 191 192 193 194 195 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 186 def merge(params) parsed, = HubSpotSDK::Crm::Objects::TicketMergeParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/tickets/merge", body: parsed, model: HubSpotSDK::Crm::SimplePublicObject, options: ) end |
#search(after:, filter_groups:, limit:, properties:, sorts:, query: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::CollectionResponseWithTotalSimplePublicObject
Search for tickets by filtering on properties, searching through associations, and sorting results. Learn more about [CRM search](developers.hubspot.com/docs/guides/api/crm/search#make-a-search-request).
220 221 222 223 224 225 226 227 228 229 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 220 def search(params) parsed, = HubSpotSDK::Crm::Objects::TicketSearchParams.dump_request(params) @client.request( method: :post, path: "crm/objects/2026-03/tickets/search", body: parsed, model: HubSpotSDK::Crm::CollectionResponseWithTotalSimplePublicObject, options: ) end |
#update(ticket_id, properties:, id_property: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObject
Some parameter documentations has been truncated, see Models::Crm::Objects::TicketUpdateParams for more details.
Perform a partial update of an Object identified by ‘ticketId`or optionally a unique property value as specified by the `idProperty` query param. `ticketId` 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.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/hubspot_sdk/resources/crm/objects/tickets.rb', line 60 def update(ticket_id, params) query_params = [:id_property] parsed, = HubSpotSDK::Crm::Objects::TicketUpdateParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :patch, path: ["crm/objects/2026-03/tickets/%1$s", ticket_id], query: query.transform_keys(id_property: "idProperty"), body: parsed.except(*query_params), model: HubSpotSDK::Crm::SimplePublicObject, options: ) end |