Skip to content

Commit

Permalink
Change segmentId signature to long
Browse files Browse the repository at this point in the history
  • Loading branch information
Gh0stWalk3r committed Aug 18, 2019
1 parent c14b47e commit 00c281e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/GregsStack.PushCrew.Net.Api/IPushCrewClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public interface IPushCrewClient
Task<SendMessageResponse> SendSubscriberAsync(SendMessageRequest request, string subscriberId);
Task<NotificationStatusResponse> CheckNotificationRequestStatusAsync(string id);
Task<ScheduleMessageResponse> ScheduleAllSubscribersAsync(ScheduleMessageRequest request);
Task<ScheduleMessageResponse> ScheduleSegmentAsync(ScheduleMessageRequest request, string segmentId);
Task<ScheduleMessageResponse> ScheduleSegmentAsync(ScheduleMessageRequest request, long segmentId);
Task<SegmentResponse> AddSegmentAsync(string name);
Task<SegmentsResponse> ListSegmentsAsync();
Task<SegmentResponse> AddSubscribersToSegmentAsync(string segmentId, ICollection<string> subscriberList);
Task<SubscribersResponse> ListSubscribersInSegmentAsync(string segmentId, int page = 1, int perPage = 1024);
Task<SegmentResponse> AddSubscribersToSegmentAsync(long segmentId, ICollection<string> subscriberList);
Task<SubscribersResponse> ListSubscribersInSegmentAsync(long segmentId, int page = 1, int perPage = 1024);
Task<SubscribersResponse> ListSegmentsOfSubscriberAsync(string subscriberId);
Task<StatusResponse> RemoveSubscribersAsync(long segmentId, RemoveSubscriberRequest removeSubscriberRequest);
Task<StatusResponse> DeleteSegmentAsync(long segmentId);
Expand Down
6 changes: 3 additions & 3 deletions src/GregsStack.PushCrew.Net.Api/PushCrewClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public async Task<ScheduleMessageResponse> ScheduleAllSubscribersAsync(ScheduleM
return await this.PostAsync<ScheduleMessageRequest, ScheduleMessageResponse>(request, relativeUri);
}

public async Task<ScheduleMessageResponse> ScheduleSegmentAsync(ScheduleMessageRequest request, string segmentId)
public async Task<ScheduleMessageResponse> ScheduleSegmentAsync(ScheduleMessageRequest request, long segmentId)
{
var relativeUri = $"send/segment/{segmentId}";
return await this.PostAsync<ScheduleMessageRequest, ScheduleMessageResponse>(request, relativeUri);
Expand All @@ -109,7 +109,7 @@ public async Task<SegmentsResponse> ListSegmentsAsync()
return await this.GetAsync<SegmentsResponse>(relativeUri);
}

public async Task<SegmentResponse> AddSubscribersToSegmentAsync(string segmentId, ICollection<string> subscriberList)
public async Task<SegmentResponse> AddSubscribersToSegmentAsync(long segmentId, ICollection<string> subscriberList)
{
var relativeUri = $"segments/{segmentId}/subscribers";

Expand All @@ -123,7 +123,7 @@ public async Task<SegmentResponse> AddSubscribersToSegmentAsync(string segmentId
return await this.PostAsync<SendMessageSubscribersRequest, SegmentResponse>(subscriberRequest, relativeUri);
}

public async Task<SubscribersResponse> ListSubscribersInSegmentAsync(string segmentId, int page = 1, int perPage = 1024)
public async Task<SubscribersResponse> ListSubscribersInSegmentAsync(long segmentId, int page = 1, int perPage = 1024)
{
var relativeUri = $"segments/{segmentId}/subscribers?page={page}&per_page={perPage}";
return await this.GetAsync<SubscribersResponse>(relativeUri);
Expand Down
4 changes: 2 additions & 2 deletions src/GregsStack.PushCrew.Net.Api/Response/Models/Segment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace GregsStack.PushCrew.Net.Api.Response.Models

public class Segment
{
public string Id { get; set; }
public long Id { get; set; }

public string Name { get; set; }

public Segment(string id, string name)
public Segment(long id, string name)
{
this.Id = id;
this.Name = name ?? throw new ArgumentNullException(nameof(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class SegmentResponse : StatusResponse
/// To identify the segment newly created.
/// The same ID is used to add/remove subscribers to/from the segment through the API.
/// </summary>
public string SegmentId { get; set; }
public long SegmentId { get; set; }

/// <summary>
/// Present in case of failure. Used to denote reason of failure.
Expand Down

0 comments on commit 00c281e

Please sign in to comment.