Class: Merge::Ticketing::TicketsClient
- Inherits:
-
Object
- Object
- Merge::Ticketing::TicketsClient
- Defined in:
- lib/merge_ruby_client/ticketing/tickets/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#collaborators_list(parent_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedUserList
Returns a list of ‘User` objects.
-
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Creates a ‘Ticket` object with the given values.
- #initialize(request_client:) ⇒ Merge::Ticketing::TicketsClient constructor
-
#list(account_id: nil, assignee_ids: nil, collection_ids: nil, completed_after: nil, completed_before: nil, contact_id: nil, created_after: nil, created_before: nil, cursor: nil, due_after: nil, due_before: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, page_size: nil, parent_ticket_id: nil, priority: nil, remote_created_after: nil, remote_created_before: nil, remote_fields: nil, remote_id: nil, remote_updated_after: nil, remote_updated_before: nil, show_enum_origins: nil, status: nil, tags: nil, ticket_type: nil, ticket_url: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedTicketList
Returns a list of ‘Ticket` objects.
-
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` PATCHs.
-
#meta_post_retrieve(request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` POSTs.
-
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Updates a ‘Ticket` object with the given `id`.
-
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
-
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Ticketing::Ticket
Returns a ‘Ticket` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Ticketing::TicketsClient
32 33 34 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 32 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::RequestClient (readonly)
28 29 30 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 28 def request_client @request_client end |
Instance Method Details
#collaborators_list(parent_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedUserList
Returns a list of ‘User` objects.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 329 def collaborators_list(parent_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, page_size: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "cursor": cursor, "expand": , "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "page_size": page_size }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets/#{parent_id}/collaborators" end Merge::Ticketing::PaginatedUserList.from_json(json_object: response.body) end |
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Creates a ‘Ticket` object with the given values.
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 186 def create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets" end Merge::Ticketing::TicketResponse.from_json(json_object: response.body) end |
#list(account_id: nil, assignee_ids: nil, collection_ids: nil, completed_after: nil, completed_before: nil, contact_id: nil, created_after: nil, created_before: nil, cursor: nil, due_after: nil, due_before: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, page_size: nil, parent_ticket_id: nil, priority: nil, remote_created_after: nil, remote_created_before: nil, remote_fields: nil, remote_id: nil, remote_updated_after: nil, remote_updated_before: nil, show_enum_origins: nil, status: nil, tags: nil, ticket_type: nil, ticket_url: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedTicketList
Returns a list of ‘Ticket` objects.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 100 def list(account_id: nil, assignee_ids: nil, collection_ids: nil, completed_after: nil, completed_before: nil, contact_id: nil, created_after: nil, created_before: nil, cursor: nil, due_after: nil, due_before: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, page_size: nil, parent_ticket_id: nil, priority: nil, remote_created_after: nil, remote_created_before: nil, remote_fields: nil, remote_id: nil, remote_updated_after: nil, remote_updated_before: nil, show_enum_origins: nil, status: nil, tags: nil, ticket_type: nil, ticket_url: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "account_id": account_id, "assignee_ids": assignee_ids, "collection_ids": collection_ids, "completed_after": completed_after, "completed_before": completed_before, "contact_id": contact_id, "created_after": created_after, "created_before": created_before, "cursor": cursor, "due_after": due_after, "due_before": due_before, "expand": , "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "modified_after": modified_after, "modified_before": modified_before, "page_size": page_size, "parent_ticket_id": parent_ticket_id, "priority": priority, "remote_created_after": remote_created_after, "remote_created_before": remote_created_before, "remote_fields": remote_fields, "remote_id": remote_id, "remote_updated_after": remote_updated_after, "remote_updated_before": remote_updated_before, "show_enum_origins": show_enum_origins, "status": status, "tags": , "ticket_type": ticket_type, "ticket_url": ticket_url }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets" end Merge::Ticketing::PaginatedTicketList.from_json(json_object: response.body) end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` PATCHs.
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 368 def (id:, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets/meta/patch/#{id}" end Merge::Ticketing::MetaResponse.from_json(json_object: response.body) end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` POSTs.
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 400 def (request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets/meta/post" end Merge::Ticketing::MetaResponse.from_json(json_object: response.body) end |
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Updates a ‘Ticket` object with the given `id`.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 289 def partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets/#{id}" end Merge::Ticketing::TicketResponse.from_json(json_object: response.body) end |
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 439 def remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, is_common_model_field: nil, page_size: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "cursor": cursor, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "is_common_model_field": is_common_model_field, "page_size": page_size }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets/remote-field-classes" end Merge::Ticketing::PaginatedRemoteFieldClassList.from_json(json_object: response.body) end |
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Ticketing::Ticket
Returns a ‘Ticket` object with the given `id`.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 229 def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "expand": , "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "remote_fields": remote_fields, "show_enum_origins": show_enum_origins }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets/#{id}" end Merge::Ticketing::Ticket.from_json(json_object: response.body) end |