Skip to content

Commit 430d1bd

Browse files
Sharky99xmozts2005
andauthored
Update Tickets.cs (#572)
* 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 <elizabeth@speedy-geek.com>
1 parent 77b0ce7 commit 430d1bd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/ZendeskApi_v2/Requests/Tickets.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public interface ITickets : ICore
141141

142142
bool DeleteManySuspendedTickets(IEnumerable<long> ids);
143143

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

146146
IndividualTicketMetricResponse GetTicketMetricsForTicket(long ticket_id);
147147

@@ -262,7 +262,7 @@ public interface ITickets : ICore
262262

263263
Task<bool> DeleteTicketFormAsync(long id);
264264

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

267267
Task<IndividualTicketMetricResponse> GetTicketMetricsForTicketAsync(long ticket_id);
268268

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

682682
#region TicketMetrics
683683

684-
public GroupTicketMetricResponse GetAllTicketMetrics()
684+
public GroupTicketMetricResponse GetAllTicketMetrics(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
685685
{
686-
return GenericGet<GroupTicketMetricResponse>($"{_ticket_metrics}.json");
686+
var resource = GetResourceStringWithSideLoadOptionsParam($"{_ticket_metrics}.json", sideLoadOptions);
687+
return GenericPagedGet<GroupTicketMetricResponse>(resource, perPage, page);
687688
}
688689

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

10541055
#region TicketMetrics
10551056

1056-
public Task<GroupTicketMetricResponse> GetAllTicketMetricsAsync()
1057+
public async Task<GroupTicketMetricResponse> GetAllTicketMetricsAsync(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
10571058
{
1058-
return GenericGetAsync<GroupTicketMetricResponse>($"{_ticket_metrics}.json");
1059+
var resource = GetResourceStringWithSideLoadOptionsParam($"{_ticket_metrics}.json", sideLoadOptions);
1060+
return await GenericPagedGetAsync<GroupTicketMetricResponse>(resource, perPage, page);
10591061
}
10601062

10611063
public Task<IndividualTicketMetricResponse> GetTicketMetricsForTicketAsync(long ticket_id)

0 commit comments

Comments
 (0)