/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; namespace Amazon { /// /// Root AWS config section /// internal class AWSSection { public LoggingSection Logging { get; set; } public CSMSection CSMConfig { get; set; } public string EndpointDefinition { get; set; } public string Region { get; set; } public bool? UseSdkCache { get; set; } public bool? CorrectForClockSkew { get; set; } public ProxySection Proxy { get; set; } public string ProfileName { get; set; } public string ProfilesLocation { get; set; } public string ApplicationName { get; set; } private IDictionary _serviceSections = null; public IDictionary ServiceSections { get { if (_serviceSections == null) _serviceSections = new Dictionary(StringComparer.Ordinal); return _serviceSections; } set { _serviceSections = value; } } } /// /// Settings for configuring a proxy for the SDK to use. /// internal class ProxySection { public const string hostSection = "host"; public const string portSection = "port"; public const string usernameSection = "username"; public const string passwordSection = "password"; /// /// Gets and sets the host name or IP address of the proxy server. /// public string Host { get; set; } /// /// Gets and sets the port number of the proxy. /// public int? Port { get; set; } /// /// Gets and sets the username to authenticate with the proxy server. /// public string Username { get; set; } /// /// Gets and sets the password to authenticate with the proxy server. /// public string Password { get; set; } } /// /// Logging section /// internal class LoggingSection { public const string logToKey = "logTo"; public const string logResponsesKey = "logResponses"; public const string logMetricsKey = "logMetrics"; public const string logMetricsFormatKey = "logMetricsFormat"; public const string logMetricsCustomFormatterKey = "logMetricsCustomFormatter"; public const string logResponsesSizeLimitKey = "logResponsesSizeLimit"; public LoggingOptions LogTo { get; set; } public ResponseLoggingOption LogResponses { get; set; } public int? LogResponsesSizeLimit { get; set; } public bool? LogMetrics { get; set; } public LogMetricsFormatOption LogMetricsFormat { get; set; } public Type LogMetricsCustomFormatter { get; set; } } /// /// CSM section /// internal class CSMSection { public const string csmEnabledKey = "csmEnabled"; public const string csmClientIdKey = "csmClientId"; public const string csmPortKey = "csmPort"; public bool? CSMEnabled { get; set; } public int? CSMPort { get; set; } public string CSMClientId { get; set; } } }