本文整理汇总了C#中System.Pagination.GetNextUrl方法的典型用法代码示例。如果您正苦于以下问题:C# Pagination.GetNextUrl方法的具体用法?C# Pagination.GetNextUrl怎么用?C# Pagination.GetNextUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Pagination
的用法示例。
在下文中一共展示了Pagination.GetNextUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLibraryFolders
/// <summary>
/// Get all existing MyLibrary folders
/// </summary>
/// <param name="sortBy">Specifies how the list of folders is sorted</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param>
/// <param name="pag">Pagination object.</param>
/// <returns>Returns a collection of MyLibraryFolder objects.</returns>
public ResultSet<MyLibraryFolder> GetLibraryFolders(FoldersSortBy? sortBy, int? limit, Pagination pag)
{
string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.MyLibraryFolders, GetQueryParameters(new object[] { "sort_by", sortBy, "limit", limit })) : pag.GetNextUrl();
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var results = response.Get<ResultSet<MyLibraryFolder>>();
return results;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}
示例2: GetBounces
/// <summary>
/// Get a result set of bounces for a given campaign.
/// </summary>
/// <param name="campaignId">Campaign id.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="createdSince">Filter for bounces created since the supplied date in the collection</param>
/// <param name="pag">Pagination object.</param>
/// <returns>ResultSet containing a results array of @link BounceActivity.</returns>
private ResultSet<BounceActivity> GetBounces(string campaignId, int? limit, DateTime? createdSince, Pagination pag)
{
string url = (pag == null) ? ConstructUrl(Settings.Endpoints.Default.CampaignTrackingBounces, new object[] { campaignId }, new object[] { "limit", limit, "created_since", Extensions.ToISO8601String(createdSince) }) : pag.GetNextUrl();
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var results = response.Get<ResultSet<BounceActivity>>();
return results;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}
示例3: GetCampaigns
/// <summary>
/// Get a set of campaigns.
/// </summary>
/// <param name="status">Returns list of email campaigns with specified status.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="modifiedSince">limit campaigns to campaigns modified since the supplied date</param>
/// <param name="pag">Pagination object returned by a previous call to GetCampaigns</param>
/// <returns>Returns a ResultSet of campaigns.</returns>
public ResultSet<EmailCampaign> GetCampaigns(CampaignStatus? status, int? limit, DateTime? modifiedSince, Pagination pag)
{
string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.Campaigns, GetQueryParameters(new object[] { "status", status, "limit", limit, "modified_since", Extensions.ToISO8601String(modifiedSince) })) : pag.GetNextUrl();
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var results = response.Get<ResultSet<EmailCampaign>>();
return results;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}
示例4: GetAllEventSpots
/// <summary>
/// View all existing events
/// </summary>
/// <param name="accessToken">Constant Contact OAuth2 access token</param>
/// <param name="apiKey">The API key for the application</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 50</param>
/// <param name="pag">Pagination object</param>
/// <returns>ResultSet containing a results array of IndividualEvents</returns>
public ResultSet<IndividualEvent> GetAllEventSpots(string accessToken, string apiKey, int? limit, Pagination pag)
{
string url = (pag == null) ? String.Concat(Config.Endpoints.BaseUrl, Config.Endpoints.EventSpots, GetQueryParameters(new object[] { "limit", limit })) : pag.GetNextUrl();
CUrlResponse response = RestClient.Get(url, accessToken, apiKey);
if (response.HasData)
{
return response.Get<ResultSet<IndividualEvent>>();
}
else if (response.IsError)
{
throw new CtctException(response.GetErrorMessage());
}
return new ResultSet<IndividualEvent>();
}
示例5: GetAllEventSpots
/// <summary>
/// View all existing events
/// </summary>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 50</param>
/// <param name="pag">Pagination object</param>
/// <returns>ResultSet containing a results array of IndividualEvents</returns>
public ResultSet<IndividualEvent> GetAllEventSpots(int? limit, Pagination pag)
{
string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.EventSpots, GetQueryParameters(new object[] { "limit", limit })) : pag.GetNextUrl();
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var individualEventSet = response.Get<ResultSet<IndividualEvent>>();
return individualEventSet;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}
示例6: GetContacts
/// <summary>
/// Get an array of contacts.
/// </summary>
/// <param name="email">Match the exact email address.</param>
/// <param name="limit">Limit the number of returned values.</param>
/// <param name="modifiedSince">limit contact to contacts modified since the supplied date</param>
/// <param name="status">Match the exact contact status.</param>
/// <param name="pag">Pagination object.</param>
/// <returns>Returns a list of contacts.</returns>
private ResultSet<Contact> GetContacts(string email, int? limit, DateTime? modifiedSince, ContactStatus? status, Pagination pag)
{
// Construct access URL
string url = (pag == null) ? ConstructUrl(Settings.Endpoints.Default.Contacts, null, new object[] { "email", email, "limit", limit, "modified_since", Extensions.ToISO8601String(modifiedSince), "status", status }) : pag.GetNextUrl();
// Get REST response
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var results = response.Get<ResultSet<Contact>>();
return results;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}
示例7: GetLibraryFolders
/// <summary>
/// Get all existing MyLibrary folders
/// </summary>
/// <param name="accessToken">Access token.</param>
/// <param name="apiKey">The API key for the application</param>
/// <param name="sortBy">Specifies how the list of folders is sorted</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param>
/// <param name="pag">Pagination object.</param>
/// <returns>Returns a collection of MyLibraryFolder objects.</returns>
public ResultSet<MyLibraryFolder> GetLibraryFolders(string accessToken, string apiKey, FoldersSortBy? sortBy, int? limit, Pagination pag)
{
ResultSet<MyLibraryFolder> results = null;
string url = (pag == null) ? String.Concat(Config.Endpoints.BaseUrl, Config.Endpoints.MyLibraryFolders, GetQueryParameters(new object[] { "sort_by", sortBy, "limit", limit})) : pag.GetNextUrl();
CUrlResponse response = RestClient.Get(url, accessToken, apiKey);
if (response.IsError)
{
throw new CtctException(response.GetErrorMessage());
}
if (response.HasData)
{
results = response.Get<ResultSet<MyLibraryFolder>>();
}
return results;
}
示例8: GetBounces
/// <summary>
/// Get a result set of bounces for a given campaign.
/// </summary>
/// <param name="accessToken">Constant Contact OAuth2 access token.</param>
/// <param name="apiKey">The API key for the application</param>
/// <param name="campaignId">Campaign id.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="pag">Pagination object.</param>
/// <returns>ResultSet containing a results array of @link BounceActivity.</returns>
private ResultSet<BounceActivity> GetBounces(string accessToken, string apiKey, string campaignId, int? limit, Pagination pag)
{
ResultSet<BounceActivity> results = null;
string url = (pag == null) ? Config.ConstructUrl(Config.Endpoints.CampaignTrackingBounces, new object[] { campaignId }, new object[] { "limit", limit }) : pag.GetNextUrl();
CUrlResponse response = RestClient.Get(url, accessToken, apiKey);
if (response.IsError)
{
throw new CtctException(response.GetErrorMessage());
}
if (response.HasData)
{
results = Component.FromJSON<ResultSet<BounceActivity>>(response.Body);
}
return results;
}
示例9: GetCampaigns
/// <summary>
/// Get a set of campaigns.
/// </summary>
/// <param name="accessToken">Access token.</param>
/// <param name="apiKey">The API key for the application</param>
/// <param name="status">Returns list of email campaigns with specified status.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="modifiedSince">limit campaigns to campaigns modified since the supplied date</param>
/// <param name="pag">Pagination object returned by a previous call to GetCampaigns</param>
/// <returns>Returns a ResultSet of campaigns.</returns>
public ResultSet<EmailCampaign> GetCampaigns(string accessToken, string apiKey, CampaignStatus? status, int? limit, DateTime? modifiedSince, Pagination pag)
{
ResultSet<EmailCampaign> results = null;
string url = (pag == null) ? String.Concat(Config.Endpoints.BaseUrl, Config.Endpoints.Campaigns, GetQueryParameters(new object[] { "status", status, "limit", limit, "modified_since", Extensions.ToISO8601String(modifiedSince) })) : pag.GetNextUrl();
CUrlResponse response = RestClient.Get(url, accessToken, apiKey);
if (response.IsError)
{
throw new CtctException(response.GetErrorMessage());
}
if (response.HasData)
{
results = response.Get<ResultSet<EmailCampaign>>();
}
return results;
}
示例10: GetActivities
/// <summary>
/// Get all activities for a given contact.
/// </summary>
/// <param name="accessToken">Constant Contact OAuth2 access token.</param>
/// <param name="apiKey">The API key for the application</param>
/// <param name="contactId">Contact id.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="createdSince">Filter for activities created since the supplied date in the collection</param>
/// <param name="pag">Pagination object.</param>
/// <returns>ResultSet containing a results array of @link ContactActivity</returns>
public ResultSet<ContactActivity> GetActivities(string accessToken, string apiKey, string contactId, int? limit, DateTime? createdSince, Pagination pag)
{
ResultSet<ContactActivity> results = null;
string url = (pag == null) ? Config.ConstructUrl(Config.Endpoints.ContactTrackingActivities, new object[] { contactId }, new object[] { "limit", limit, "created_since", Extensions.ToISO8601String(createdSince) }) : pag.GetNextUrl();
CUrlResponse response = RestClient.Get(url, accessToken, apiKey);
if (response.IsError)
{
throw new CtctException(response.GetErrorMessage());
}
if (response.HasData)
{
results = Component.FromJSON<ResultSet<ContactActivity>>(response.Body);
}
return results;
}
示例11: GetActivities
/// <summary>
/// Get all activities for a given contact.
/// </summary>
/// <param name="contactId">Contact id.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="createdSince">Filter for activities created since the supplied date in the collection</param>
/// <param name="pag">Pagination object.</param>
/// <returns>ResultSet containing a results array of @link ContactActivity</returns>
public ResultSet<ContactActivity> GetActivities(string contactId, int? limit, DateTime? createdSince, Pagination pag)
{
if (string.IsNullOrEmpty(contactId))
{
throw new IllegalArgumentException(CTCT.Resources.Errors.ContactTrackingOrId);
}
string url = (pag == null) ? ConstructUrl(Settings.Endpoints.Default.ContactTrackingActivities, new object[] { contactId }, new object[] { "limit", limit, "created_since", Extensions.ToISO8601String(createdSince) }) : pag.GetNextUrl();
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var results = response.Get<ResultSet<ContactActivity>>();
return results;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}
示例12: GetContacts
/// <summary>
/// Get an array of contacts.
/// </summary>
/// <param name="accessToken">Constant Contact OAuth2 access token.</param>
/// <param name="apiKey">The API key for the application</param>
/// <param name="email">Match the exact email address.</param>
/// <param name="limit">Limit the number of returned values.</param>
/// <param name="modifiedSince">limit contact to contacts modified since the supplied date</param>
/// <param name="pag">Pagination object.</param>
/// <returns>Returns a list of contacts.</returns>
private ResultSet<Contact> GetContacts(string accessToken, string apiKey, string email, int? limit, DateTime? modifiedSince, Pagination pag)
{
ResultSet<Contact> results = null;
// Construct access URL
string url = (pag == null) ? Config.ConstructUrl(Config.Endpoints.Contacts, null, new object[] { "email", email, "limit", limit, "modified_since", Extensions.ToISO8601String(modifiedSince) }) : pag.GetNextUrl();
// Get REST response
CUrlResponse response = RestClient.Get(url, accessToken, apiKey);
if (response.IsError)
{
throw new CtctException(response.GetErrorMessage());
}
if (response.HasData)
{
// Convert from JSON
results = response.Get<ResultSet<Contact>>();
}
return results;
}
示例13: GetClicks
/// <summary>
/// Get clicks for the provided Pagination page.
/// </summary>
/// <param name="accessToken">Constant Contact OAuth2 access token.</param>
/// <param name="apiKey">The API key for the application</param>
/// <param name="createdSince">filter for activities created since the supplied date in the collection</param>
/// <param name="pag">Pagination object.</param>
/// <returns>ResultSet containing a results array of @link ClickActivity.</returns>
public ResultSet<ClickActivity> GetClicks(string accessToken, string apiKey, DateTime? createdSince, Pagination pag)
{
return GetClicks(accessToken, apiKey, pag.GetNextUrl());
}
示例14: GetContactsFromList
/// <summary>
/// Get all contacts from an individual list.
/// </summary>
/// <param name="listId">List id to retrieve contacts for.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="modifiedSince">limit contacts retrieved to contacts modified since the supplied date</param>
/// <param name="pag">Pagination object.</param>
/// <returns>Returns a list of contacts.</returns>
public ResultSet<Contact> GetContactsFromList(string listId, int? limit, DateTime? modifiedSince, Pagination pag)
{
if (string.IsNullOrEmpty(listId))
{
throw new IllegalArgumentException(CTCT.Resources.Errors.ListOrId);
}
string url = (pag == null) ? ConstructUrl(Settings.Endpoints.Default.ListContacts, new object[] { listId }, new object[] { "limit", limit, "modified_since", Extensions.ToISO8601String(modifiedSince) }) : pag.GetNextUrl();
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var contacts = response.Get<ResultSet<Contact>>();
return contacts;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}
示例15: GetBounces
/// <summary>
/// Get bounces for a given contact.
/// </summary>
/// <param name="contactId">Contact id.</param>
/// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
/// <param name="pag">Pagination object.</param>
/// <returns>ResultSet containing a results array of @link BounceActivity</returns>
private ResultSet<BounceActivity> GetBounces(string contactId, int? limit, Pagination pag)
{
string url = (pag == null) ? ConstructUrl(Settings.Endpoints.Default.ContactTrackingBounces, new object[] { contactId }, new object[] { "limit", limit }) : pag.GetNextUrl();
RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
try
{
var results = response.Get<ResultSet<BounceActivity>>();
return results;
}
catch (Exception ex)
{
throw new CtctException(ex.Message, ex);
}
}