Class: Merge::Ticketing::TicketsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/ticketing/tickets/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ Merge::Ticketing::TicketsClient

Parameters:



31
32
33
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 31

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientMerge::RequestClient (readonly)



27
28
29
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 27

def request_client
  @request_client
end

Instance Method Details

#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse

Creates a ‘Ticket` object with the given values.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.create(model: {  })

Parameters:

  • is_debug_mode (Boolean) (defaults to: nil)

    Whether to include debug fields (such as log file links) in the response.

  • run_async (Boolean) (defaults to: nil)

    Whether or not third-party updates should be run asynchronously.

  • model (Hash)

    Request of type Merge::Ticketing::TicketRequest, as a Hash

    • :name (String)

    • :assignees (Array<Merge::Ticketing::TicketRequestAssigneesItem>)

    • :assigned_teams (Array<Merge::Ticketing::TicketRequestAssignedTeamsItem>)

    • :creator (Hash)

    • :due_date (DateTime)

    • :status (Merge::Ticketing::TicketStatusEnum)

    • :description (String)

    • :collections (Array<Merge::Ticketing::TicketRequestCollectionsItem>)

    • :ticket_type (String)

    • :account (Hash)

    • :contact (Hash)

    • :parent_ticket (Hash)

    • :attachments (Array<Merge::Ticketing::TicketRequestAttachmentsItem>)

    • :access_level (Merge::Ticketing::TicketAccessLevelEnum)

    • :tags (Array<String>)

    • :roles (Array<String>)

    • :completed_at (DateTime)

    • :ticket_url (String)

    • :priority (Merge::Ticketing::PriorityEnum)

    • :integration_params (Hash=> Object)

    • :linked_account_params (Hash=> Object)

    • :remote_fields (Array<Merge::Ticketing::RemoteFieldRequest>)

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 192

def create(model:, is_debug_mode: nil, run_async: nil, request_options: nil)
  response = @request_client.conn.post do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "is_debug_mode": is_debug_mode,
      "run_async": run_async
    }.compact
    req.body = { **(request_options&.additional_body_parameters || {}), model: model }.compact
    req.url "#{@request_client.get_url(request_options: 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, creator_id: nil, cursor: nil, due_after: nil, due_before: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: 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.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")

Parameters:

  • account_id (String) (defaults to: nil)

    If provided, will only return tickets for this account.

  • assignee_ids (String) (defaults to: nil)

    If provided, will only return tickets assigned to the assignee_ids; multiple assignee_ids can be separated by commas.

  • collection_ids (String) (defaults to: nil)

    If provided, will only return tickets assigned to the collection_ids; multiple collection_ids can be separated by commas.

  • completed_after (DateTime) (defaults to: nil)

    If provided, will only return tickets completed after this datetime.

  • completed_before (DateTime) (defaults to: nil)

    If provided, will only return tickets completed before this datetime.

  • contact_id (String) (defaults to: nil)

    If provided, will only return tickets for this contact.

  • created_after (DateTime) (defaults to: nil)

    If provided, will only return objects created after this datetime.

  • created_before (DateTime) (defaults to: nil)

    If provided, will only return objects created before this datetime.

  • creator_id (String) (defaults to: nil)

    If provided, will only return tickets created by this creator_id.

  • cursor (String) (defaults to: nil)

    The pagination cursor value.

  • due_after (DateTime) (defaults to: nil)

    If provided, will only return tickets due after this datetime.

  • due_before (DateTime) (defaults to: nil)

    If provided, will only return tickets due before this datetime.

  • expand (Merge::Ticketing::Tickets::TicketsListRequestExpand) (defaults to: nil)

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

  • include_deleted_data (Boolean) (defaults to: nil)

    Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).

  • include_remote_data (Boolean) (defaults to: nil)

    Whether to include the original data Merge fetched from the third-party to produce these models.

  • include_remote_fields (Boolean) (defaults to: nil)

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

  • include_shell_data (Boolean) (defaults to: nil)

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

  • modified_after (DateTime) (defaults to: nil)

    If provided, only objects synced by Merge after this date time will be returned.

  • modified_before (DateTime) (defaults to: nil)

    If provided, only objects synced by Merge before this date time will be returned.

  • page_size (Integer) (defaults to: nil)

    Number of results to return per page.

  • parent_ticket_id (String) (defaults to: nil)

    If provided, will only return sub tickets of the parent_ticket_id.

  • priority (Merge::Ticketing::Tickets::TicketsListRequestPriority) (defaults to: nil)

    If provided, will only return tickets of this priority.

    • ‘URGENT` - URGENT

    • ‘HIGH` - HIGH

    • ‘NORMAL` - NORMAL

    • ‘LOW` - LOW

  • remote_created_after (DateTime) (defaults to: nil)

    If provided, will only return tickets created in the third party platform after this datetime.

  • remote_created_before (DateTime) (defaults to: nil)

    If provided, will only return tickets created in the third party platform before this datetime.

  • remote_fields (Merge::Ticketing::Tickets::TicketsListRequestRemoteFields) (defaults to: nil)

    Deprecated. Use show_enum_origins.

  • remote_id (String) (defaults to: nil)

    The API provider’s ID for the given object.

  • remote_updated_after (DateTime) (defaults to: nil)

    If provided, will only return tickets updated in the third party platform after this datetime.

  • remote_updated_before (DateTime) (defaults to: nil)

    If provided, will only return tickets updated in the third party platform before this datetime.

  • show_enum_origins (Merge::Ticketing::Tickets::TicketsListRequestShowEnumOrigins) (defaults to: nil)

    A comma separated list of enum field names for which you’d like the original values to be returned, instead of Merge’s normalized enum values. [Learn e](help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)

  • status (String) (defaults to: nil)

    If provided, will only return tickets of this status.

  • tags (String) (defaults to: nil)

    If provided, will only return tickets matching the tags; multiple tags can be separated by commas.

  • ticket_type (String) (defaults to: nil)

    If provided, will only return tickets of this type.

  • ticket_url (String) (defaults to: nil)

    If provided, will only return tickets where the URL matches or contains the substring

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



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
152
153
154
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 101

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, creator_id: nil, cursor: nil, due_after: nil, due_before: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: 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.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "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,
      "creator_id": creator_id,
      "cursor": cursor,
      "due_after": due_after,
      "due_before": due_before,
      "expand": expand,
      "include_deleted_data": include_deleted_data,
      "include_remote_data": include_remote_data,
      "include_remote_fields": include_remote_fields,
      "include_shell_data": include_shell_data,
      "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": tags,
      "ticket_type": ticket_type,
      "ticket_url": ticket_url
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: 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.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.meta_patch_retrieve(id: "id")

Parameters:

Returns:



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 388

def meta_patch_retrieve(id:, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    unless request_options.nil? || request_options&.additional_query_parameters.nil?
      req.params = { **(request_options&.additional_query_parameters || {}) }.compact
    end
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: request_options)}/ticketing/v1/tickets/meta/patch/#{id}"
  end
  Merge::Ticketing::MetaResponse.from_json(json_object: response.body)
end

#meta_post_retrieve(collection_id: nil, ticket_type: nil, request_options: nil) ⇒ Merge::Ticketing::MetaResponse

Returns metadata for ‘Ticket` POSTs.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.meta_post_retrieve

Parameters:

  • collection_id (String) (defaults to: nil)

    If provided, will only return tickets for this collection.

  • ticket_type (String) (defaults to: nil)

    If provided, will only return tickets for this ticket type.

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 422

def meta_post_retrieve(collection_id: nil, ticket_type: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "collection_id": collection_id,
      "ticket_type": ticket_type
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: 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`.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.partial_update(id: "id", model: {  })

Parameters:

  • id (String)
  • is_debug_mode (Boolean) (defaults to: nil)

    Whether to include debug fields (such as log file links) in the response.

  • run_async (Boolean) (defaults to: nil)

    Whether or not third-party updates should be run asynchronously.

  • model (Hash)

    Request of type Merge::Ticketing::PatchedTicketRequest, as a Hash

    • :name (String)

    • :assignees (Array<String>)

    • :assigned_teams (Array<String>)

    • :creator (String)

    • :due_date (DateTime)

    • :status (Merge::Ticketing::TicketStatusEnum)

    • :description (String)

    • :collections (Array<String>)

    • :ticket_type (String)

    • :account (String)

    • :contact (String)

    • :parent_ticket (String)

    • :access_level (Merge::Ticketing::TicketAccessLevelEnum)

    • :tags (Array<String>)

    • :roles (Array<String>)

    • :ticket_url (String)

    • :priority (Merge::Ticketing::PriorityEnum)

    • :completed_at (DateTime)

    • :integration_params (Hash=> Object)

    • :linked_account_params (Hash=> Object)

    • :remote_fields (Array<Merge::Ticketing::RemoteFieldRequest>)

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 301

def partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil)
  response = @request_client.conn.patch do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "is_debug_mode": is_debug_mode,
      "run_async": run_async
    }.compact
    req.body = { **(request_options&.additional_body_parameters || {}), model: model }.compact
    req.url "#{@request_client.get_url(request_options: request_options)}/ticketing/v1/tickets/#{id}"
  end
  Merge::Ticketing::TicketResponse.from_json(json_object: response.body)
end

#remote_field_classes_list(cursor: nil, ids: nil, include_deleted_data: nil, include_remote_data: nil, include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedRemoteFieldClassList

Returns a list of ‘RemoteFieldClass` objects.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.remote_field_classes_list(cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")

Parameters:

  • cursor (String) (defaults to: nil)

    The pagination cursor value.

  • ids (String) (defaults to: nil)

    If provided, will only return remote field classes with the ‘ids` in this list

  • include_deleted_data (Boolean) (defaults to: nil)

    Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).

  • include_remote_data (Boolean) (defaults to: nil)

    Whether to include the original data Merge fetched from the third-party to produce these models.

  • include_shell_data (Boolean) (defaults to: nil)

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

  • is_common_model_field (Boolean) (defaults to: nil)

    If provided, will only return remote field classes with this is_common_model_field value

  • is_custom (Boolean) (defaults to: nil)

    If provided, will only return remote fields classes with this is_custom value

  • page_size (Integer) (defaults to: nil)

    Number of results to return per page.

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 470

def remote_field_classes_list(cursor: nil, ids: nil, include_deleted_data: nil, include_remote_data: nil,
                              include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "cursor": cursor,
      "ids": ids,
      "include_deleted_data": include_deleted_data,
      "include_remote_data": include_remote_data,
      "include_shell_data": include_shell_data,
      "is_common_model_field": is_common_model_field,
      "is_custom": is_custom,
      "page_size": page_size
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: 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, include_shell_data: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Ticketing::Ticket

Returns a ‘Ticket` object with the given `id`.

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.retrieve(id: "id")

Parameters:

Returns:



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 237

def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil,
             remote_fields: nil, show_enum_origins: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "expand": expand,
      "include_remote_data": include_remote_data,
      "include_remote_fields": include_remote_fields,
      "include_shell_data": include_shell_data,
      "remote_fields": remote_fields,
      "show_enum_origins": show_enum_origins
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: request_options)}/ticketing/v1/tickets/#{id}"
  end
  Merge::Ticketing::Ticket.from_json(json_object: response.body)
end

#viewers_list(ticket_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_shell_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedViewerList

Returns a list of ‘Viewer` objects that point to a User id or Team id that is

either an assignee or viewer on a `Ticket` with the given id. [Learn
(https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls)

Examples:

api = Merge::Client.new(
  base_url: "https://api.example.com",
  environment: Merge::Environment::PRODUCTION,
  api_key: "YOUR_AUTH_TOKEN"
)
api.ticketing.tickets.viewers_list(ticket_id: "ticket_id", cursor: "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw")

Parameters:

  • ticket_id (String)
  • cursor (String) (defaults to: nil)

    The pagination cursor value.

  • expand (Merge::Ticketing::Tickets::TicketsViewersListRequestExpand) (defaults to: nil)

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

  • include_deleted_data (Boolean) (defaults to: nil)

    Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).

  • include_remote_data (Boolean) (defaults to: nil)

    Whether to include the original data Merge fetched from the third-party to produce these models.

  • include_shell_data (Boolean) (defaults to: nil)

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

  • page_size (Integer) (defaults to: nil)

    Number of results to return per page.

  • request_options (Merge::RequestOptions) (defaults to: nil)

Returns:



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 348

def viewers_list(ticket_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil,
                 include_shell_data: nil, page_size: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
    req.headers["X-Account-Token"] = request_options. unless request_options&..nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "cursor": cursor,
      "expand": expand,
      "include_deleted_data": include_deleted_data,
      "include_remote_data": include_remote_data,
      "include_shell_data": include_shell_data,
      "page_size": page_size
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: request_options)}/ticketing/v1/tickets/#{ticket_id}/viewers"
  end
  Merge::Ticketing::PaginatedViewerList.from_json(json_object: response.body)
end