public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonSimpleNotificationServiceConfig config = new AmazonSimpleNotificationServiceConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonSimpleNotificationServiceClient client = new AmazonSimpleNotificationServiceClient(creds, config); ListEndpointsByPlatformApplicationResponse resp = new ListEndpointsByPlatformApplicationResponse(); do { ListEndpointsByPlatformApplicationRequest req = new ListEndpointsByPlatformApplicationRequest { NextToken = resp.NextToken }; resp = client.ListEndpointsByPlatformApplication(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Endpoints) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
public static void SNSMobilePushAPIsListApplicationsEndpoints() { #region SNSMobilePushAPIsListApplicationsEndpoints var snsClient = new AmazonSimpleNotificationServiceClient(); var appsResponse = snsClient.ListPlatformApplications(); foreach (var app in appsResponse.PlatformApplications) { Console.WriteLine(); var appAttrsRequest = new GetPlatformApplicationAttributesRequest { PlatformApplicationArn = app.PlatformApplicationArn }; var appAttrsResponse = snsClient.GetPlatformApplicationAttributes(appAttrsRequest); var endpointsByAppRequest = new ListEndpointsByPlatformApplicationRequest { PlatformApplicationArn = app.PlatformApplicationArn }; var endpointsByAppResponse = snsClient.ListEndpointsByPlatformApplication( endpointsByAppRequest); Console.WriteLine("Application: " + app.PlatformApplicationArn); Console.WriteLine(" Properties: "); foreach (var attr in appAttrsResponse.Attributes) { Console.WriteLine(" " + attr.Key + ": " + attr.Value); } Console.WriteLine(" Endpoints: "); foreach (var endpoint in endpointsByAppResponse.Endpoints) { Console.WriteLine(" ARN: " + endpoint.EndpointArn); Console.WriteLine(" Attributes: "); foreach (var attr in endpoint.Attributes) { Console.WriteLine(" " + attr.Key + ": " + attr.Value); } } } #endregion Console.ReadLine(); }
protected async Task <List <string> > findTeamEndpoints(int teamId) { var endpoints = new List <string>(); ListEndpointsByPlatformApplicationRequest request = new ListEndpointsByPlatformApplicationRequest() { PlatformApplicationArn = GlobalConfig.Secrets.platformApplicationArn }; var result = await _client.ListEndpointsByPlatformApplicationAsync(request); var devices = findDevicesSubscribed(teamId); foreach (Endpoint endpoint in result.Endpoints) { if (endpoint.Attributes.GetValueOrDefault("Enabled").Equals("true", StringComparison.OrdinalIgnoreCase)) { EndpointUserData userData = readUserData(endpoint.Attributes.GetValueOrDefault("CustomUserData")); if (devices.Contains(userData.uniqueUserId)) { endpoints.Add(endpoint.EndpointArn); } } } return(endpoints); }
public Task <ListEndpointsByPlatformApplicationResponse> ListEndpointsByPlatformApplicationAsync(ListEndpointsByPlatformApplicationRequest request, CancellationToken cancellationToken = default(CancellationToken)) { throw new System.NotImplementedException(); }
public ListEndpointsByPlatformApplicationResponse ListEndpointsByPlatformApplication(ListEndpointsByPlatformApplicationRequest request) { throw new System.NotImplementedException(); }
/// <summary> /// Initiates the asynchronous execution of the ListEndpointsByPlatformApplication operation. /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListEndpointsByPlatformApplication operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <ListEndpointsByPlatformApplicationResponse> ListEndpointsByPlatformApplicationAsync(ListEndpointsByPlatformApplicationRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListEndpointsByPlatformApplicationRequestMarshaller(); var unmarshaller = ListEndpointsByPlatformApplicationResponseUnmarshaller.Instance; return(Invoke <IRequest, ListEndpointsByPlatformApplicationRequest, ListEndpointsByPlatformApplicationResponse>(request, marshaller, unmarshaller, signer, cancellationToken)); }
internal ListEndpointsByPlatformApplicationResponse ListEndpointsByPlatformApplication(ListEndpointsByPlatformApplicationRequest request) { var task = ListEndpointsByPlatformApplicationAsync(request); try { return(task.Result); } catch (AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return(null); } }
public void ListEndpointsByPlatformApplicationAsync(ListEndpointsByPlatformApplicationRequest request, AmazonServiceCallback <ListEndpointsByPlatformApplicationRequest, ListEndpointsByPlatformApplicationResponse> callback, AsyncOptions options = null) { throw new System.NotImplementedException(); }
internal ListEndpointsByPlatformApplicationResponse ListEndpointsByPlatformApplication(ListEndpointsByPlatformApplicationRequest request) { var marshaller = new ListEndpointsByPlatformApplicationRequestMarshaller(); var unmarshaller = ListEndpointsByPlatformApplicationResponseUnmarshaller.Instance; return(Invoke <ListEndpointsByPlatformApplicationRequest, ListEndpointsByPlatformApplicationResponse>(request, marshaller, unmarshaller)); }