R/sns_service.R

Defines functions service sns

Documented in sns

# This file is generated by make.paws. Please do not edit here.
#' @importFrom paws.common new_handlers new_service set_config merge_config
NULL

#' Amazon Simple Notification Service
#'
#' @description
#' Amazon Simple Notification Service (Amazon SNS) is a web service that
#' enables you to build distributed web-enabled applications. Applications
#' can use Amazon SNS to easily push real-time notification messages to
#' interested subscribers over multiple delivery protocols. For more
#' information about this product see the [Amazon SNS product
#' page](https://aws.amazon.com/sns/). For detailed information about
#' Amazon SNS features and their associated API calls, see the [Amazon SNS
#' Developer Guide](https://docs.aws.amazon.com/sns/latest/dg/).
#' 
#' For information on the permissions you need to use this API, see
#' [Identity and access management in Amazon
#' SNS](https://docs.aws.amazon.com/sns/latest/dg/) in the *Amazon SNS
#' Developer Guide.*
#' 
#' We also provide SDKs that enable you to access Amazon SNS from your
#' preferred programming language. The SDKs contain functionality that
#' automatically takes care of tasks such as: cryptographically signing
#' your service requests, retrying requests, and handling error responses.
#' For a list of available SDKs, go to [Tools for Amazon Web
#' Services](https://aws.amazon.com/developer/tools/).
#'
#' @param
#' config
#' Optional configuration of credentials, endpoint, and/or region.
#' \itemize{
#' \item{\strong{credentials}:} {\itemize{
#' \item{\strong{creds}:} {\itemize{
#' \item{\strong{access_key_id}:} {AWS access key ID}
#' \item{\strong{secret_access_key}:} {AWS secret access key}
#' \item{\strong{session_token}:} {AWS temporary session token}
#' }}
#' \item{\strong{profile}:} {The name of a profile to use. If not given, then the default profile is used.}
#' \item{\strong{anonymous}:} {Set anonymous credentials.}
#' \item{\strong{endpoint}:} {The complete URL to use for the constructed client.}
#' \item{\strong{region}:} {The AWS Region used in instantiating the client.}
#' }}
#' \item{\strong{close_connection}:} {Immediately close all HTTP connections.}
#' \item{\strong{timeout}:} {The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.}
#' \item{\strong{s3_force_path_style}:} {Set this to `true` to force the request to use path-style addressing, i.e. `http://s3.amazonaws.com/BUCKET/KEY`.}
#' \item{\strong{sts_regional_endpoint}:} {Set sts regional endpoint resolver to regional or legacy \url{https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html}}
#' }
#' @param
#' credentials
#' Optional credentials shorthand for the config parameter
#' \itemize{
#' \item{\strong{creds}:} {\itemize{
#' \item{\strong{access_key_id}:} {AWS access key ID}
#' \item{\strong{secret_access_key}:} {AWS secret access key}
#' \item{\strong{session_token}:} {AWS temporary session token}
#' }}
#' \item{\strong{profile}:} {The name of a profile to use. If not given, then the default profile is used.}
#' \item{\strong{anonymous}:} {Set anonymous credentials.}
#' }
#' @param
#' endpoint
#' Optional shorthand for complete URL to use for the constructed client.
#' @param
#' region
#' Optional shorthand for AWS Region used in instantiating the client.
#'
#' @section Service syntax:
#' ```
#' svc <- sns(
#'   config = list(
#'     credentials = list(
#'       creds = list(
#'         access_key_id = "string",
#'         secret_access_key = "string",
#'         session_token = "string"
#'       ),
#'       profile = "string",
#'       anonymous = "logical"
#'     ),
#'     endpoint = "string",
#'     region = "string",
#'     close_connection = "logical",
#'     timeout = "numeric",
#'     s3_force_path_style = "logical",
#'     sts_regional_endpoint = "string"
#'   ),
#'   credentials = list(
#'     creds = list(
#'       access_key_id = "string",
#'       secret_access_key = "string",
#'       session_token = "string"
#'     ),
#'     profile = "string",
#'     anonymous = "logical"
#'   ),
#'   endpoint = "string",
#'   region = "string"
#' )
#' ```
#'
#' @examples
#' \dontrun{
#' svc <- sns()
#' svc$add_permission(
#'   Foo = 123
#' )
#' }
#'
#' @section Operations:
#' \tabular{ll}{
#'  \link[=sns_add_permission]{add_permission} \tab Adds a statement to a topic's access control policy, granting access for the specified Amazon Web Services accounts to the specified actions\cr
#'  \link[=sns_check_if_phone_number_is_opted_out]{check_if_phone_number_is_opted_out} \tab Accepts a phone number and indicates whether the phone holder has opted out of receiving SMS messages from your Amazon Web Services account\cr
#'  \link[=sns_confirm_subscription]{confirm_subscription} \tab Verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier Subscribe action\cr
#'  \link[=sns_create_platform_application]{create_platform_application} \tab 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\cr
#'  \link[=sns_create_platform_endpoint]{create_platform_endpoint} \tab 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\cr
#'  \link[=sns_create_sms_sandbox_phone_number]{create_sms_sandbox_phone_number} \tab Adds a destination phone number to an Amazon Web Services account in the SMS sandbox and sends a one-time password (OTP) to that phone number\cr
#'  \link[=sns_create_topic]{create_topic} \tab Creates a topic to which notifications can be published\cr
#'  \link[=sns_delete_endpoint]{delete_endpoint} \tab Deletes the endpoint for a device and mobile app from Amazon SNS\cr
#'  \link[=sns_delete_platform_application]{delete_platform_application} \tab Deletes a platform application object for one of the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging)\cr
#'  \link[=sns_delete_sms_sandbox_phone_number]{delete_sms_sandbox_phone_number} \tab Deletes an Amazon Web Services account's verified or pending phone number from the SMS sandbox\cr
#'  \link[=sns_delete_topic]{delete_topic} \tab Deletes a topic and all its subscriptions\cr
#'  \link[=sns_get_data_protection_policy]{get_data_protection_policy} \tab Retrieves the specified inline DataProtectionPolicy document that is stored in the specified Amazon SNS topic\cr
#'  \link[=sns_get_endpoint_attributes]{get_endpoint_attributes} \tab Retrieves the endpoint attributes for a device on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS\cr
#'  \link[=sns_get_platform_application_attributes]{get_platform_application_attributes} \tab Retrieves the attributes of the platform application object for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging)\cr
#'  \link[=sns_get_sms_attributes]{get_sms_attributes} \tab Returns the settings for sending SMS messages from your Amazon Web Services account\cr
#'  \link[=sns_get_sms_sandbox_account_status]{get_sms_sandbox_account_status} \tab Retrieves the SMS sandbox status for the calling Amazon Web Services account in the target Amazon Web Services Region\cr
#'  \link[=sns_get_subscription_attributes]{get_subscription_attributes} \tab Returns all of the properties of a subscription\cr
#'  \link[=sns_get_topic_attributes]{get_topic_attributes} \tab Returns all of the properties of a topic\cr
#'  \link[=sns_list_endpoints_by_platform_application]{list_endpoints_by_platform_application} \tab Lists the endpoints and endpoint attributes for devices in a supported push notification service, such as GCM (Firebase Cloud Messaging) and APNS\cr
#'  \link[=sns_list_origination_numbers]{list_origination_numbers} \tab Lists the calling Amazon Web Services account's dedicated origination numbers and their metadata\cr
#'  \link[=sns_list_phone_numbers_opted_out]{list_phone_numbers_opted_out} \tab Returns a list of phone numbers that are opted out, meaning you cannot send SMS messages to them\cr
#'  \link[=sns_list_platform_applications]{list_platform_applications} \tab Lists the platform application objects for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging)\cr
#'  \link[=sns_list_sms_sandbox_phone_numbers]{list_sms_sandbox_phone_numbers} \tab Lists the calling Amazon Web Services account's current verified and pending destination phone numbers in the SMS sandbox\cr
#'  \link[=sns_list_subscriptions]{list_subscriptions} \tab Returns a list of the requester's subscriptions\cr
#'  \link[=sns_list_subscriptions_by_topic]{list_subscriptions_by_topic} \tab Returns a list of the subscriptions to a specific topic\cr
#'  \link[=sns_list_tags_for_resource]{list_tags_for_resource} \tab List all tags added to the specified Amazon SNS topic\cr
#'  \link[=sns_list_topics]{list_topics} \tab Returns a list of the requester's topics\cr
#'  \link[=sns_opt_in_phone_number]{opt_in_phone_number} \tab Use this request to opt in a phone number that is opted out, which enables you to resume sending SMS messages to the number\cr
#'  \link[=sns_publish]{publish} \tab Sends a message to an Amazon SNS topic, a text message (SMS message) directly to a phone number, or a message to a mobile platform endpoint (when you specify the TargetArn)\cr
#'  \link[=sns_publish_batch]{publish_batch} \tab Publishes up to ten messages to the specified topic\cr
#'  \link[=sns_put_data_protection_policy]{put_data_protection_policy} \tab Adds or updates an inline policy document that is stored in the specified Amazon SNS topic\cr
#'  \link[=sns_remove_permission]{remove_permission} \tab Removes a statement from a topic's access control policy\cr
#'  \link[=sns_set_endpoint_attributes]{set_endpoint_attributes} \tab 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\cr
#'  \link[=sns_set_platform_application_attributes]{set_platform_application_attributes} \tab Sets the attributes of the platform application object for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging)\cr
#'  \link[=sns_set_sms_attributes]{set_sms_attributes} \tab Use this request to set the default settings for sending SMS messages and receiving daily SMS usage reports\cr
#'  \link[=sns_set_subscription_attributes]{set_subscription_attributes} \tab Allows a subscription owner to set an attribute of the subscription to a new value\cr
#'  \link[=sns_set_topic_attributes]{set_topic_attributes} \tab Allows a topic owner to set an attribute of the topic to a new value\cr
#'  \link[=sns_subscribe]{subscribe} \tab Subscribes an endpoint to an Amazon SNS topic\cr
#'  \link[=sns_tag_resource]{tag_resource} \tab Add tags to the specified Amazon SNS topic\cr
#'  \link[=sns_unsubscribe]{unsubscribe} \tab Deletes a subscription\cr
#'  \link[=sns_untag_resource]{untag_resource} \tab Remove tags from the specified Amazon SNS topic\cr
#'  \link[=sns_verify_sms_sandbox_phone_number]{verify_sms_sandbox_phone_number} \tab Verifies a destination phone number with a one-time password (OTP) for the calling Amazon Web Services account
#' }
#'
#' @return
#' A client for the service. You can call the service's operations using
#' syntax like `svc$operation(...)`, where `svc` is the name you've assigned
#' to the client. The available operations are listed in the
#' Operations section.
#'
#' @rdname sns
#' @export
sns <- function(config = list(), credentials = list(), endpoint = NULL, region = NULL) {
  config <- merge_config(
    config,
    list(
      credentials = credentials,
      endpoint = endpoint,
      region = region
    )
  )
  svc <- .sns$operations
  svc <- set_config(svc, config)
  return(svc)
}

# Private API objects: metadata, handlers, interfaces, etc.
.sns <- list()

.sns$operations <- list()

.sns$metadata <- list(
  service_name = "sns",
  endpoints = list("*" = list(endpoint = "sns.{region}.amazonaws.com", global = FALSE), "cn-*" = list(endpoint = "sns.{region}.amazonaws.com.cn", global = FALSE), "us-iso-*" = list(endpoint = "sns.{region}.c2s.ic.gov", global = FALSE), "us-isob-*" = list(endpoint = "sns.{region}.sc2s.sgov.gov", global = FALSE)),
  service_id = "SNS",
  api_version = "2010-03-31",
  signing_name = "sns",
  json_version = "",
  target_prefix = ""
)

.sns$service <- function(config = list()) {
  handlers <- new_handlers("query", "v4")
  new_service(.sns$metadata, handlers, config)
}

Try the paws.application.integration package in your browser

Any scripts or data that you put into this service are public.

paws.application.integration documentation built on Sept. 12, 2023, 1:18 a.m.