using Amazon.SimpleNotificationService.Model; using Amazon.Sns.Wrapper.Models; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Amazon.Sns.Wrapper.Interfaces { public interface IMobilePushNotification { /// /// Creates a platform application object for one of the supported push notification /// services, such as APNS and GCM (Firebase Cloud Messaging), to which devices and /// mobile apps may register. /// /// Name of Platform Application /// Platform type /// Properties/Attributes of Platform Application /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// Returns Platform Application Arn Task CreatePlatformApplicationAsync(string name, NotificationPlatform platform, Dictionary attributes, CancellationToken cancellationToken = default); /// /// Creates an endpoint for a device and mobile app on one of the supported push /// notification services, such as GCM (Firebase Cloud Messaging) and APNS. /// CreatePlatformEndpoint /// requires the /// PlatformApplicationArn /// that is returned from /// CreatePlatformApplication /// . You can use the returned /// EndpointArn /// to send a message to a mobile app or by the /// Subscribe /// action for subscription to a topic. The /// CreatePlatformEndpoint /// action is idempotent, so if the requester already owns an endpoint with the same /// device token and attributes, that endpoint's ARN is returned without creating /// a new endpoint. For more information, see Using Amazon SNS Mobile Push Notifications. /// When using /// CreatePlatformEndpoint /// with Baidu, two attributes must be provided: ChannelId and UserId. The token /// field must also contain the ChannelId. For more information, see Creating an /// Amazon SNS Endpoint for Baidu. /// /// Platform Application Arn /// Token /// Description /// Attributes for an Endpoint /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// Returns Platform Endpoint Arn Task CreatePlatformEndpointAsync(string platformApplicationArn, string token, string description, Dictionary attributes, CancellationToken cancellationToken = default); /// /// Deletes a platform application object for one of the supported push notification /// services, such as APNS and GCM (Firebase Cloud Messaging). For more information, /// see Using Amazon SNS Mobile Push Notifications. /// /// Platform Application Arn /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// Returns true if Platform Application is delerted sucessfully Task DeletePlatformApplicationAsync(string platformApplicationArn, CancellationToken cancellationToken = default); /// /// Deletes the endpoint for a device and mobile app from Amazon SNS. This action /// is idempotent. For more information, see Using Amazon SNS Mobile Push Notifications. /// When you delete an endpoint that is also subscribed to a topic, then you must /// also unsubscribe the endpoint from the topic. /// /// Platform Endpoint Arn /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// Returns true if Platform Endpoint is delerted sucessfully Task DeleteEndpointAsync(string endpointArn, CancellationToken cancellationToken = default); /// /// Retrieves the attributes of the platform application object for the supported /// push notification services, such as APNS and GCM (Firebase Cloud Messaging). /// For more information, see Using Amazon SNS Mobile Push Notifications. /// /// Platform Application Arn /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// list of Properties/Attributes of Platform Application Task> GetPlatformApplicationAttributesAsync(string platformApplicationArn, CancellationToken cancellationToken = default); /// /// Retrieves the endpoint attributes for a device on one of the supported push notification /// services, such as GCM (Firebase Cloud Messaging) and APNS. For more information, /// see Using Amazon SNS Mobile Push Notifications. /// /// Platform Endpoint Arn /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// list of Properties/Attributes of Platform Endpoint Task> GetEndpointAttributesAsync(string endpointArn, CancellationToken cancellationToken = default); /// /// Sets the attributes of the platform application object for the supported push /// notification services, such as APNS and GCM (Firebase Cloud Messaging). For more /// information, see Using Amazon SNS Mobile Push Notifications. For information /// on configuring attributes for message delivery status, see Using Amazon SNS Application /// Attributes for Message Delivery Status. /// /// Platform Aplication Arn /// Properties or Attributes to be attached /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// Returns true if the attributes are set sucessfully to platform Application Task SetPlatformApplicationAttributesAsync(string platformApplicationArn, Dictionary attributes, CancellationToken cancellationToken = default); /// /// Sets the attributes for an endpoint for a device on one of the supported push /// notification services, such as GCM (Firebase Cloud Messaging) and APNS. For more /// information, see Using Amazon SNS Mobile Push Notifications. /// /// Platform Endpoint Arn /// Properties or Attributes /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// Returns true if the attributes are set sucessfully to platform Endpoint Task SetEndpointAttributesAsync(string endpointArn, Dictionary attributes, CancellationToken cancellationToken = default); /// /// Lists the platform application objects for the supported push notification services, /// such as APNS and GCM (Firebase Cloud Messaging). The results for /// ListPlatformApplications /// are paginated and return a limited list of applications, up to 100. If additional /// records are available after the first page results, then a NextToken string will /// be returned. To receive the next pages as well, specify maxrecords parameter /// For more information, see Using Amazon SNS Mobile Push Notifications. /// This action is throttled at 15 transactions per second (TPS). /// /// Maximum Records to be returned /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// List of Platform Applications Task> ListPlatformApplicationsAsync(int maxRecords = 100, CancellationToken cancellationToken = default); /// /// Lists the endpoints and endpoint attributes for devices in a supported push notification /// service, such as GCM (Firebase Cloud Messaging) and APNS /// ListEndpointsByPlatformApplication /// are paginated and return a limited list of applications, up to 100. If additional /// records are available after the first page results, then a NextToken string will /// be returned. To receive the next pages as well, specify maxrecords parameter /// For more information, see Using Amazon SNS Mobile Push Notifications. /// This action is throttled at 15 transactions per second (TPS). /// /// Platform Application Arn /// Max Records /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// List of Platform Endpoints of an application Task> ListEndpointsByPlatformApplicationAsync(string platformApplicationArn, int maxRecords = 100, CancellationToken cancellationToken = default); } }