Skip to content

Commit

Permalink
Fix incorrect data type for identifiers in Resource methods #214
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Jan 16, 2018
1 parent a422047 commit 28f874f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Source/StrongGrid/Resources/Contacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public async Task UpdateAsync(
/// <returns>
/// An array of <see cref="Contact" />.
/// </returns>
public Task<Contact[]> SearchAsync(IEnumerable<SearchCondition> conditions, int? listId = null, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task<Contact[]> SearchAsync(IEnumerable<SearchCondition> conditions, long? listId = null, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
var data = new JObject();
if (listId.HasValue) data.Add("list_id", listId.Value);
Expand Down
4 changes: 2 additions & 2 deletions Source/StrongGrid/Resources/CustomFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ internal CustomFields(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The <see cref="CustomFieldMetadata">metadata</see> about the field.
/// </returns>
public Task<CustomFieldMetadata> GetAsync(int fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task<CustomFieldMetadata> GetAsync(long fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
return _client
.GetAsync($"{_endpoint}/{fieldId}")
Expand All @@ -96,7 +96,7 @@ internal CustomFields(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The async task.
/// </returns>
public Task DeleteAsync(int fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task DeleteAsync(long fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
return _client
.DeleteAsync($"{_endpoint}/{fieldId}")
Expand Down
2 changes: 1 addition & 1 deletion Source/StrongGrid/Resources/IContacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Task UpdateAsync(
/// <returns>
/// An array of <see cref="Contact" />.
/// </returns>
Task<Contact[]> SearchAsync(IEnumerable<SearchCondition> conditions, int? listId = null, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task<Contact[]> SearchAsync(IEnumerable<SearchCondition> conditions, long? listId = null, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Retrieve the lists that a recipient is on.
Expand Down
4 changes: 2 additions & 2 deletions Source/StrongGrid/Resources/ICustomFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface ICustomFields
/// <returns>
/// The <see cref="CustomFieldMetadata">metadata</see> about the field.
/// </returns>
Task<CustomFieldMetadata> GetAsync(int fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task<CustomFieldMetadata> GetAsync(long fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Delete a custom field.
Expand All @@ -52,7 +52,7 @@ public interface ICustomFields
/// <returns>
/// The async task.
/// </returns>
Task DeleteAsync(int fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task DeleteAsync(long fieldId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Retrieve the reserved fields.
Expand Down
10 changes: 5 additions & 5 deletions Source/StrongGrid/Resources/ISuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public interface ISuppressions
/// <returns>
/// An array of string representing the email addresses
/// </returns>
Task<string[]> GetUnsubscribedAddressesAsync(int groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task<string[]> GetUnsubscribedAddressesAsync(long groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Add recipient address to the suppressions list for a given group.
Expand All @@ -57,7 +57,7 @@ public interface ISuppressions
/// <returns>
/// The async task.
/// </returns>
Task AddAddressToUnsubscribeGroupAsync(int groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task AddAddressToUnsubscribeGroupAsync(long groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Add recipient addresses to the suppressions list for a given group.
Expand All @@ -70,7 +70,7 @@ public interface ISuppressions
/// <returns>
/// The async task.
/// </returns>
Task AddAddressToUnsubscribeGroupAsync(int groupId, IEnumerable<string> emails, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task AddAddressToUnsubscribeGroupAsync(long groupId, IEnumerable<string> emails, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Delete a recipient email from the suppressions list for a group.
Expand All @@ -82,7 +82,7 @@ public interface ISuppressions
/// <returns>
/// The async task.
/// </returns>
Task RemoveAddressFromSuppressionGroupAsync(int groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task RemoveAddressFromSuppressionGroupAsync(long groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Check if a recipient address is in the given suppression group.
Expand All @@ -94,6 +94,6 @@ public interface ISuppressions
/// <returns>
/// <c>true</c> if the email address is in the global suppression group; otherwise, <c>false</c>.
/// </returns>
Task<bool> IsSuppressedAsync(int groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task<bool> IsSuppressedAsync(long groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
6 changes: 3 additions & 3 deletions Source/StrongGrid/Resources/IUnsubscribeGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public interface IUnsubscribeGroups
/// <returns>
/// The <see cref="SuppressionGroup" />.
/// </returns>
Task<SuppressionGroup> GetAsync(int groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task<SuppressionGroup> GetAsync(long groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Create a new suppression group.
Expand All @@ -70,7 +70,7 @@ public interface IUnsubscribeGroups
/// <returns>
/// The <see cref="SuppressionGroup" />.
/// </returns>
Task<SuppressionGroup> UpdateAsync(int groupId, Parameter<string> name = default(Parameter<string>), Parameter<string> description = default(Parameter<string>), string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task<SuppressionGroup> UpdateAsync(long groupId, Parameter<string> name = default(Parameter<string>), Parameter<string> description = default(Parameter<string>), string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Delete a suppression group.
Expand All @@ -81,6 +81,6 @@ public interface IUnsubscribeGroups
/// <returns>
/// The async task.
/// </returns>
Task DeleteAsync(int groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
Task DeleteAsync(long groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
10 changes: 5 additions & 5 deletions Source/StrongGrid/Resources/Suppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ internal Suppressions(Pathoschild.Http.Client.IClient client)
/// <returns>
/// An array of string representing the email addresses
/// </returns>
public Task<string[]> GetUnsubscribedAddressesAsync(int groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task<string[]> GetUnsubscribedAddressesAsync(long groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
return _client
.GetAsync($"{_endpoint}/groups/{groupId}/suppressions")
Expand All @@ -106,7 +106,7 @@ internal Suppressions(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The async task.
/// </returns>
public Task AddAddressToUnsubscribeGroupAsync(int groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task AddAddressToUnsubscribeGroupAsync(long groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
return AddAddressToUnsubscribeGroupAsync(groupId, new[] { email }, onBehalfOf, cancellationToken);
}
Expand All @@ -122,7 +122,7 @@ internal Suppressions(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The async task.
/// </returns>
public Task AddAddressToUnsubscribeGroupAsync(int groupId, IEnumerable<string> emails, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task AddAddressToUnsubscribeGroupAsync(long groupId, IEnumerable<string> emails, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
var data = new JObject(new JProperty("recipient_emails", JArray.FromObject(emails.ToArray())));
return _client
Expand All @@ -143,7 +143,7 @@ internal Suppressions(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The async task.
/// </returns>
public Task RemoveAddressFromSuppressionGroupAsync(int groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task RemoveAddressFromSuppressionGroupAsync(long groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
return _client
.DeleteAsync($"{_endpoint}/groups/{groupId}/suppressions/{email}")
Expand All @@ -162,7 +162,7 @@ internal Suppressions(Pathoschild.Http.Client.IClient client)
/// <returns>
/// <c>true</c> if the email address is in the global suppression group; otherwise, <c>false</c>.
/// </returns>
public async Task<bool> IsSuppressedAsync(int groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<bool> IsSuppressedAsync(long groupId, string email, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
var data = new JObject
{
Expand Down
6 changes: 3 additions & 3 deletions Source/StrongGrid/Resources/UnsubscribeGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ internal UnsubscribeGroups(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The <see cref="SuppressionGroup" />.
/// </returns>
public Task<SuppressionGroup> GetAsync(int groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task<SuppressionGroup> GetAsync(long groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
return _client
.GetAsync($"{_endpoint}/{groupId}")
Expand Down Expand Up @@ -131,7 +131,7 @@ internal UnsubscribeGroups(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The <see cref="SuppressionGroup" />.
/// </returns>
public Task<SuppressionGroup> UpdateAsync(int groupId, Parameter<string> name = default(Parameter<string>), Parameter<string> description = default(Parameter<string>), string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task<SuppressionGroup> UpdateAsync(long groupId, Parameter<string> name = default(Parameter<string>), Parameter<string> description = default(Parameter<string>), string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
var data = new JObject();
if (name.HasValue) data.Add("name", name.Value);
Expand All @@ -154,7 +154,7 @@ internal UnsubscribeGroups(Pathoschild.Http.Client.IClient client)
/// <returns>
/// The async task.
/// </returns>
public Task DeleteAsync(int groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
public Task DeleteAsync(long groupId, string onBehalfOf = null, CancellationToken cancellationToken = default(CancellationToken))
{
return _client
.DeleteAsync($"{_endpoint}/{groupId}")
Expand Down

0 comments on commit 28f874f

Please sign in to comment.