コード例 #1
0
ファイル: Tickets.cs プロジェクト: mozts2005/ZendeskApi_v2
 public async Task<GroupTicketExportResponse> GetInrementalTicketExportAsync(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return await GenericPagedGetAsync<GroupTicketExportResponse>(_incremental_export + startTime.UtcDateTime.GetEpoch());
 }
コード例 #2
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public GroupTicketResponse GetAllTickets(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(_tickets + ".json", sideLoadOptions);
     return GenericPagedGet<GroupTicketResponse>(resource, perPage, page);
 }
コード例 #3
0
ファイル: Tickets.cs プロジェクト: HorevIvan/ZendeskApi_v2
 public IndividualTicketResponse GetTicket(long id, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}.json", _tickets, id), sideLoadOptions);
     return GenericGet<IndividualTicketResponse>(string.Format("{0}/{1}.json", _tickets, id));
 }
コード例 #4
0
ファイル: Tickets.cs プロジェクト: mozts2005/ZendeskApi_v2
        /// <summary>
        /// Gets the tickets that have changed since a certain time.
        /// </summary>
        /// <param name="startTime">Return tickets that have changed since this time.</param>
        /// <param name="sideLoadOptions">Retrieve related records as part of this request.</param>
        /// <returns>Tickets that have changed since the given startTime.</returns>
        /// <remarks>
        /// The incremental api will return a maximum of 1000 items.  If the ticket count in the
        /// result is 1000, use the nextPage value of the result to request the next set of items.
        /// Keep repeating the request using the nextPage value until the number of tickets in the
        /// response is less than 1000.
        /// </remarks>
        public GroupTicketExportResponse GetIncrementalTicketExport(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            var resource =
                GetResourceStringWithSideLoadOptionsParam(
                    _incremental_export + startTime.UtcDateTime.GetEpoch(),
                    sideLoadOptions);

            return GenericGet<GroupTicketExportResponse>(resource);
        }
コード例 #5
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public async Task<GroupTicketResponse> GetTicketsByExternalIdAsync(string externalId, int? perPage = null, int? page = null, string sortCol = null, bool? sortAscending = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(_tickets + ".json?external_id=" + externalId, sideLoadOptions);
     return await GenericPagedSortedGetAsync<GroupTicketResponse>(resource, perPage, page, sortCol, sortAscending);
 }
コード例 #6
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public async Task <GroupTicketResponse> GetMultipleTicketsAsync(IEnumerable <long> ids, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/show_many.json?ids={1}", _tickets, ids.ToCsv()), sideLoadOptions);

            return(await GenericGetAsync <GroupTicketResponse>(resource));
        }
コード例 #7
0
 public GroupTicketExportResponse __TestOnly__GetIncrementalTicketExport(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return(GenericGet <GroupTicketExportResponse>("incremental/tickets/sample.json?start_time=" + startTime.UtcDateTime.GetEpoch()));
 }
コード例 #8
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public async Task<GroupTicketResponse> GetTicketsWhereUserIsCopiedAsync(long userId, int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("users/{0}/tickets/ccd.json", userId), sideLoadOptions);
     return await GenericPagedGetAsync<GroupTicketResponse>(resource, perPage, page);
 }
コード例 #9
0
 public GroupTicketExportResponse GetInrementalTicketExport(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return(GenericGet <GroupTicketExportResponse>(_incremental_export + startTime.UtcDateTime.GetEpoch()));
 }
コード例 #10
0
        /// <summary>
        /// Gets the tickets that have changed since a certain time.
        /// </summary>
        /// <param name="startTime">Return tickets that have changed since this time.</param>
        /// <param name="sideLoadOptions">Retrieve related records as part of this request.</param>
        /// <returns>Tickets that have changed since the given startTime.</returns>
        /// <remarks>
        /// The incremental api will return a maximum of 1000 items.  If the ticket count in the
        /// result is 1000, use the nextPage value of the result to request the next set of items.
        /// Keep repeating the request using the nextPage value until the number of tickets in the
        /// response is less than 1000.
        /// </remarks>
        public GroupTicketExportResponse GetIncrementalTicketExport(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            var resource =
                GetResourceStringWithSideLoadOptionsParam(
                    _incremental_export + startTime.UtcDateTime.GetEpoch(),
                    sideLoadOptions);

            return(GenericGet <GroupTicketExportResponse>(resource));
        }
コード例 #11
0
        public GroupTicketResponse GetMultipleTickets(IEnumerable <long> ids, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam($"{_tickets}/show_many.json?ids={ids.ToCsv()}", sideLoadOptions);

            return(GenericGet <GroupTicketResponse>(resource));
        }
コード例 #12
0
        public GroupCommentResponse GetTicketComments(long ticketId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam($"{_tickets}/{ticketId}/comments.json", sideLoadOptions);

            return(GenericPagedGet <GroupCommentResponse>(resource, perPage, page));
        }
コード例 #13
0
        public IndividualTicketResponse GetTicket(long id, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam($"{_tickets}/{id}.json", sideLoadOptions);

            return(GenericGet <IndividualTicketResponse>(resource));
        }
コード例 #14
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public GroupTicketResponse GetTicketsByOrganizationID(long id, int pageNumber, int itemsPerPage, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/{2}.json", _organizations, id, _tickets), sideLoadOptions);
     return GenericPagedGet<GroupTicketResponse>(resource, itemsPerPage, pageNumber);
 }
コード例 #15
0
        public async Task <GroupTicketResponse> GetTicketsByViewIDAsync(long viewId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam($"{_views}/{viewId}/{_tickets}.json", sideLoadOptions);

            return(await GenericPagedGetAsync <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #16
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public async Task<GroupTicketResponse> GetTicketsByOrganizationIDAsync(long id, int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/{2}.json", _organizations, id, _tickets), sideLoadOptions);
     return await GenericPagedGetAsync<GroupTicketResponse>(resource, perPage, page);
 }
コード例 #17
0
        public async Task <GroupTicketResponse> GetAssignedTicketsByUserIDAsync(long userId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam($"users/{userId}/tickets/assigned.json", sideLoadOptions);

            return(await GenericPagedGetAsync <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #18
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public async Task<GroupCommentResponse> GetTicketCommentsAsync(long ticketId, int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/comments.json", _tickets, ticketId), sideLoadOptions);
     return await GenericPagedGetAsync<GroupCommentResponse>(resource, perPage, page);
 }
コード例 #19
0
 public async Task <GroupTicketExportResponse> GetInrementalTicketExportAsync(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return(await GenericPagedGetAsync <GroupTicketExportResponse>(_incremental_export + startTime.UtcDateTime.GetEpoch()));
 }
コード例 #20
0
        public GroupTicketResponse GetTicketsWhereUserIsCopied(long userId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam($"users/{userId}/tickets/ccd.json", sideLoadOptions);

            return(GenericPagedGet <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #21
0
 /// <summary>
 /// Since the other method can only be called once every 5 minutes it is not sutable for Automated tests.
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="sideLoadOptions"></param>
 /// <returns></returns>
 public async Task <GroupTicketExportResponse> __TestOnly__GetInrementalTicketExportAsync(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return(await GenericPagedGetAsync <GroupTicketExportResponse>("incremental/tickets/sample.json?start_time=" + startTime.UtcDateTime.GetEpoch()));
 }
コード例 #22
0
ファイル: Tickets.cs プロジェクト: HorevIvan/ZendeskApi_v2
 public GroupTicketResponse GetTicketsByOrganizationID(long id, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/{2}.json", _organizations, id, _tickets), sideLoadOptions);
     return GenericGet<GroupTicketResponse>(string.Format("{0}/{1}/{2}.json", _organizations, id, _tickets));
 }
コード例 #23
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public GroupTicketResponse GetAllTickets(int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(_tickets + ".json", sideLoadOptions);

            return(GenericPagedGet <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #24
0
ファイル: Tickets.cs プロジェクト: mozts2005/ZendeskApi_v2
 public GroupTicketExportResponse GetInrementalTicketExport(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return GenericGet<GroupTicketExportResponse>(_incremental_export + startTime.UtcDateTime.GetEpoch());
 }
コード例 #25
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public GroupTicketResponse GetTicketsByViewID(long viewId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/{2}.json", _views, viewId, _tickets), sideLoadOptions);

            return(GenericPagedGet <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #26
0
ファイル: Tickets.cs プロジェクト: mozts2005/ZendeskApi_v2
 public GroupTicketExportResponse __TestOnly__GetIncrementalTicketExport(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return GenericGet<GroupTicketExportResponse>("incremental/tickets/sample.json?start_time=" + startTime.UtcDateTime.GetEpoch());
 }
コード例 #27
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public GroupTicketResponse GetTicketsByOrganizationID(long id, int pageNumber, int itemsPerPage, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/{2}.json", _organizations, id, _tickets), sideLoadOptions);

            return(GenericPagedGet <GroupTicketResponse>(resource, itemsPerPage, pageNumber));
        }
コード例 #28
0
ファイル: Tickets.cs プロジェクト: mozts2005/ZendeskApi_v2
 /// <summary>
 /// Since the other method can only be called once every 5 minutes it is not sutable for Automated tests.
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="sideLoadOptions"></param>
 /// <returns></returns>
 public async Task<GroupTicketExportResponse> __TestOnly__GetInrementalTicketExportAsync(DateTimeOffset startTime, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     return await GenericPagedGetAsync<GroupTicketExportResponse>("incremental/tickets/sample.json?start_time=" + startTime.UtcDateTime.GetEpoch());
 }
コード例 #29
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public GroupTicketResponse GetTicketsByUserID(long userId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("users/{0}/tickets/requested.json", userId), sideLoadOptions);

            return(GenericPagedGet <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #30
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public GroupTicketResponse GetTicketsByViewID(long viewId, int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/{2}.json", _views, viewId, _tickets), sideLoadOptions);
     return GenericPagedGet<GroupTicketResponse>(resource, perPage, page);
 }
コード例 #31
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public async Task <GroupTicketResponse> GetTicketsByOrganizationIDAsync(long id, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/{2}.json", _organizations, id, _tickets), sideLoadOptions);

            return(await GenericPagedGetAsync <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #32
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public GroupTicketResponse GetTicketsByUserID(long userId, int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("users/{0}/tickets/requested.json", userId), sideLoadOptions);
     return GenericPagedGet<GroupTicketResponse>(resource, perPage, page);
 }
コード例 #33
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public async Task <GroupTicketResponse> GetRecentTicketsAsync(int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam("tickets/recent.json", sideLoadOptions);

            return(await GenericPagedGetAsync <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #34
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public async Task<GroupTicketResponse> GetRecentTicketsAsync(int? perPage = null, int? page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam("tickets/recent.json", sideLoadOptions);
     return await GenericPagedGetAsync<GroupTicketResponse>(resource, perPage, page);
 }
コード例 #35
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public async Task <GroupTicketResponse> GetTicketsWhereUserIsCopiedAsync(long userId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("users/{0}/tickets/ccd.json", userId), sideLoadOptions);

            return(await GenericPagedGetAsync <GroupTicketResponse>(resource, perPage, page));
        }
コード例 #36
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public async Task<IndividualTicketResponse> GetTicketAsync(long id, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}.json", _tickets, id), sideLoadOptions);
     return await GenericGetAsync<IndividualTicketResponse>(resource);
 }
コード例 #37
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public async Task <IndividualTicketResponse> GetTicketAsync(long id, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}.json", _tickets, id), sideLoadOptions);

            return(await GenericGetAsync <IndividualTicketResponse>(resource));
        }
コード例 #38
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
 public async Task<GroupTicketResponse> GetMultipleTicketsAsync(IEnumerable<long> ids, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
 {
     string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/show_many.json?ids={1}", _tickets, ids.ToCsv()), sideLoadOptions);
     return await GenericGetAsync<GroupTicketResponse>(resource);
 }
コード例 #39
0
ファイル: Tickets.cs プロジェクト: mattnis/ZendeskApi_v2
        public async Task <GroupCommentResponse> GetTicketCommentsAsync(long ticketId, int?perPage = null, int?page = null, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam(string.Format("{0}/{1}/comments.json", _tickets, ticketId), sideLoadOptions);

            return(await GenericPagedGetAsync <GroupCommentResponse>(resource, perPage, page));
        }
コード例 #40
0
ファイル: Tickets.cs プロジェクト: yyuc/ZendeskApi_v2
        private string GetResourceStringWithSideLoadOptionsParam(string resource, TicketSideLoadOptionsEnum sideLoadOptions)
        {
            if (sideLoadOptions != TicketSideLoadOptionsEnum.None)
            {
                if (sideLoadOptions.HasFlag(TicketSideLoadOptionsEnum.None))
                    sideLoadOptions &= ~TicketSideLoadOptionsEnum.None;

                string sideLoads = sideLoadOptions.ToString().ToLower().Replace(" ", "");
                resource += (resource.Contains("?") ? "&" : "?") + "include=" + sideLoads;
                return resource;
            }

            return resource;
        }
コード例 #41
0
        public GroupTicketResponse GetTicketsByOrganizationID(long id, TicketSideLoadOptionsEnum sideLoadOptions = TicketSideLoadOptionsEnum.None)
        {
            string resource = GetResourceStringWithSideLoadOptionsParam($"{_organizations}/{id}/{_tickets}.json", sideLoadOptions);

            return(GenericGet <GroupTicketResponse>(resource));
        }