Skip to content

Commit

Permalink
Update Tickets.cs (#572)
Browse files Browse the repository at this point in the history
* Update Tickets.cs

Added paging options to GetAllTicketMetrics and GetAllTicketMetricsAsync.
Zendesk Documentation : https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_metrics/

* Update Tickets.cs

---------

Co-authored-by: Elizabeth Schneider <[email protected]>
  • Loading branch information
Sharky99x and mozts2005 authored Jun 2, 2023
1 parent 77b0ce7 commit 430d1bd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ZendeskApi_v2/Requests/Tickets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public interface ITickets : ICore

bool DeleteManySuspendedTickets(IEnumerable<long> ids);

GroupTicketMetricResponse GetAllTicketMetrics();
GroupTicketMetricResponse GetAllTicketMetrics(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None);

IndividualTicketMetricResponse GetTicketMetricsForTicket(long ticket_id);

Expand Down Expand Up @@ -262,7 +262,7 @@ public interface ITickets : ICore

Task<bool> DeleteTicketFormAsync(long id);

Task<GroupTicketMetricResponse> GetAllTicketMetricsAsync();
Task<GroupTicketMetricResponse> GetAllTicketMetricsAsync(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None);

Task<IndividualTicketMetricResponse> GetTicketMetricsForTicketAsync(long ticket_id);

Expand Down Expand Up @@ -681,9 +681,10 @@ public bool DeleteManySuspendedTickets(IEnumerable<long> ids)

#region TicketMetrics

public GroupTicketMetricResponse GetAllTicketMetrics()
public GroupTicketMetricResponse GetAllTicketMetrics(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
{
return GenericGet<GroupTicketMetricResponse>($"{_ticket_metrics}.json");
var resource = GetResourceStringWithSideLoadOptionsParam($"{_ticket_metrics}.json", sideLoadOptions);
return GenericPagedGet<GroupTicketMetricResponse>(resource, perPage, page);
}

public IndividualTicketMetricResponse GetTicketMetricsForTicket(long ticket_id)
Expand Down Expand Up @@ -1053,9 +1054,10 @@ public async Task<JobStatusResponse> MergeTicketsAsync(long targetTicketId, IEnu

#region TicketMetrics

public Task<GroupTicketMetricResponse> GetAllTicketMetricsAsync()
public async Task<GroupTicketMetricResponse> GetAllTicketMetricsAsync(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
{
return GenericGetAsync<GroupTicketMetricResponse>($"{_ticket_metrics}.json");
var resource = GetResourceStringWithSideLoadOptionsParam($"{_ticket_metrics}.json", sideLoadOptions);
return await GenericPagedGetAsync<GroupTicketMetricResponse>(resource, perPage, page);
}

public Task<IndividualTicketMetricResponse> GetTicketMetricsForTicketAsync(long ticket_id)
Expand Down

0 comments on commit 430d1bd

Please sign in to comment.