/// <summary>
        /// Sets the default message attributes asynchronously.
        /// </summary>
        /// <remarks>
        /// The MonthlySpendLimit attribute will be set at the account level only if there is no
        /// explicitly defined value already set in the AWS account. All other attributes will be
        /// set at the message level.
        /// </remarks>
        /// <returns>A <see cref="Task"/> representing an async operation.</returns>
        private async Task SetDefaultSmsAttributesAsync()
        {
            var getResponse = await _snsClient.GetSMSAttributesAsync(new GetSMSAttributesRequest());

            if (getResponse.Attributes.TryGetValue("MonthlySpendLimit", out var value) &&
                !String.IsNullOrWhiteSpace(value))
            {
                return; // Use exiting value if one already exists instead of setting our own.
            }

            var setRequest = new SetSMSAttributesRequest
            {
                Attributes =
                {
                    ["MonthlySpendLimit"] = _smsMonthlySpendLimit
                }
            };

            var setResponse = await _snsClient.SetSMSAttributesAsync(setRequest);

            if (setResponse.HttpStatusCode != System.Net.HttpStatusCode.OK)
            {
                Debug.WriteLine($"Error: Got HTTP status code {(int)setResponse.HttpStatusCode} when setting MonthlySpendLimit.");
            }
        }
 public Task <SetSMSAttributesResponse> SetSMSAttributesAsync(SetSMSAttributesRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new System.NotImplementedException();
 }
 public SetSMSAttributesResponse SetSMSAttributes(SetSMSAttributesRequest request)
 {
     throw new System.NotImplementedException();
 }
Example #4
0
 public void SetSMSAttributesAsync(SetSMSAttributesRequest request, AmazonServiceCallback <SetSMSAttributesRequest, SetSMSAttributesResponse> callback, AsyncOptions options = null)
 {
     throw new System.NotImplementedException();
 }
Example #5
0
 public Task <SetSMSAttributesResponse> SetSMSAttributesAsync(SetSMSAttributesRequest request, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }