Table of Contents

ClientConfigExtensions Class

Definition

Namespace
Savvyio.Extensions.SimpleQueueService
Assemblies
Savvyio.Extensions.SimpleQueueService.dll
Source
src/Savvyio.Extensions.SimpleQueueService/ClientConfigExtensions.cs

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

Name Description
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.

SimpleNotificationService(ClientConfig[])

Resolves an instance of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceConfig from the specified configurations.

SimpleQueueService(ClientConfig[])

Resolves an instance of Amazon.SQS.AmazonSQSConfig from the specified configurations.