Class ClientConfigExtensions
- Namespace
- Savvyio.Extensions.SimpleQueueService
- Assembly
- Savvyio.Extensions.SimpleQueueService.dll
Extension methods for the Amazon.Runtime.ClientConfig base class.
public static class ClientConfigExtensions
- Inheritance
-
ClientConfigExtensions
Examples
Use ClientConfigExtensions to validate and access the typed AWS client configurations for SQS and SNS from a ClientConfig[] array.
using Amazon.Runtime;
using Amazon.SQS;
using Savvyio.Extensions.SimpleQueueService;
namespace ExampleApp;
public class AwsClientConfigExample
{
public static void CheckConfigurations(ClientConfig[] configurations)
{
if (!configurations.IsValid())
{
throw new System.InvalidOperationException("AWS client configurations are invalid.");
}
var sqsConfig = configurations.SimpleQueueService();
var snsConfig = configurations.SimpleNotificationService();
}
}
Methods
IsValid(ClientConfig[])
Evaluates whether the specified configurations> is valid, e.g. if it has a length of 2 and each element is of type Amazon.SQS.AmazonSQSConfig or Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceConfig.
public static bool IsValid(this ClientConfig[] configurations)
Parameters
configurationsClientConfig[]The array of Amazon.Runtime.ClientConfig to extend.
Returns
- bool
trueif the specified configurations is valid; otherwise,false.
SimpleNotificationService(ClientConfig[])
Resolves an instance of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceConfig from the specified configurations.
public static AmazonSimpleNotificationServiceConfig SimpleNotificationService(this ClientConfig[] configurations)
Parameters
configurationsClientConfig[]The array of Amazon.Runtime.ClientConfig to extend.
Returns
- AmazonSimpleNotificationServiceConfig
A configured instance of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceConfig.
SimpleQueueService(ClientConfig[])
Resolves an instance of Amazon.SQS.AmazonSQSConfig from the specified configurations.
public static AmazonSQSConfig SimpleQueueService(this ClientConfig[] configurations)
Parameters
configurationsClientConfig[]The array of Amazon.Runtime.ClientConfig to extend.
Returns
- AmazonSQSConfig
A configured instance of Amazon.SQS.AmazonSQSConfig.