Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete classes from core (final) #3431

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 0 additions & 128 deletions sdk/src/Core/AWSConfigs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ public static partial class AWSConfigs

// Deprecated configs
internal static string _awsRegion = GetConfig(AWSRegionKey);
internal static LoggingOptions _logging = GetLoggingSetting();
internal static ResponseLoggingOption _responseLogging = GetConfigEnum<ResponseLoggingOption>(ResponseLoggingKey);
internal static bool _logMetrics = GetConfigBool(LogMetricsKey);
internal static string _awsProfileName = GetConfig(AWSProfileNameKey);
internal static string _awsAccountsLocation = GetConfig(AWSProfilesLocationKey);
internal static bool _useSdkCache = GetConfigBool(UseSdkCacheKey, defaultValue: true);
Expand Down Expand Up @@ -123,33 +120,13 @@ public static TimeSpan? ManualClockCorrection
/// by determining the correct server time and reissuing the
/// request with the correct time.
/// Default value of this field is True.
/// <seealso cref="ClockOffset"/> will be updated with the calculated
/// offset even if this field is set to false, though requests
/// will not be corrected or retried.
/// Ignored if <seealso cref="ManualClockCorrection"/> is set.
/// </summary>
public static bool CorrectForClockSkew
{
get { return _rootConfig.CorrectForClockSkew; }
set { _rootConfig.CorrectForClockSkew = value; }
}

/// <summary>
/// The calculated clock skew correction, if there is one.
/// This field will be set if a service call resulted in an exception
/// and the SDK has determined that there is a difference between local
/// and server times.
///
/// If <seealso cref="CorrectForClockSkew"/> is set to true, this
/// value will be set to the correction, but it will not be used by the
/// SDK and clock skew errors will not be retried.
/// </summary>
[Obsolete("This value is deprecated in favor of IClientConfig.ClockOffset, use CorrectClockSkew.GetClockCorrectionForEndpoint(string endpoint) instead.")]
public static TimeSpan ClockOffset
{
get;
internal set;
}
#endregion

#region Region
Expand Down Expand Up @@ -215,7 +192,6 @@ public static string AWSProfileName

/// <summary>
/// Key for the AWSProfilesLocation property.
/// <seealso cref="Amazon.AWSConfigs.LogMetrics"/>
/// </summary>
public const string AWSProfilesLocationKey = "AWSProfilesLocation";

Expand Down Expand Up @@ -244,110 +220,6 @@ public static string AWSProfilesLocation

#endregion

#region Logging

/// <summary>
/// Key for the Logging property.
/// <seealso cref="Amazon.AWSConfigs.Logging"/>
/// </summary>
public const string LoggingKey = "AWSLogging";

/// <summary>
/// Configures how the SDK should log events, if at all.
/// Changes to this setting will only take effect in newly-constructed clients.
///
/// The setting can be configured through App.config, for example:
/// <code>
/// &lt;appSettings&gt;
/// &lt;add key="AWSLogging" value="log4net"/&gt;
/// &lt;/appSettings&gt;
/// </code>
/// </summary>
[Obsolete("This property is obsolete. Use LoggingConfig.LogTo instead.")]
public static LoggingOptions Logging
{
get { return _rootConfig.Logging.LogTo; }
set { _rootConfig.Logging.LogTo = value; }
}

private static LoggingOptions GetLoggingSetting()
{
string value = GetConfig(LoggingKey);
if (string.IsNullOrEmpty(value))
return LoggingOptions.None;

string[] settings = value.Split(validSeparators, StringSplitOptions.RemoveEmptyEntries);
if (settings == null || settings.Length == 0)
return LoggingOptions.None;

LoggingOptions totalSetting = LoggingOptions.None;
foreach (string setting in settings)
{
LoggingOptions l = ParseEnum<LoggingOptions>(setting);
totalSetting |= l;
}
return totalSetting;
}

#endregion

#region Response Logging

/// <summary>
/// Key for the ResponseLogging property.
///
/// <seealso cref="Amazon.AWSConfigs.ResponseLogging"/>
/// </summary>
public const string ResponseLoggingKey = "AWSResponseLogging";

/// <summary>
/// Configures when the SDK should log service responses.
/// Changes to this setting will take effect immediately.
///
/// The setting can be configured through App.config, for example:
/// <code>
/// &lt;appSettings&gt;
/// &lt;add key="AWSResponseLogging" value="OnError"/&gt;
/// &lt;/appSettings&gt;
/// </code>
/// </summary>
[Obsolete("This property is obsolete. Use LoggingConfig.LogResponses instead.")]
public static ResponseLoggingOption ResponseLogging
{
get { return _rootConfig.Logging.LogResponses; }
set { _rootConfig.Logging.LogResponses = value; }
}

#endregion

#region Log Metrics

/// <summary>
/// Key for the LogMetrics property.
/// <seealso cref="Amazon.AWSConfigs.LogMetrics"/>
/// </summary>
public const string LogMetricsKey = "AWSLogMetrics";

/// <summary>
/// Configures if the SDK should log performance metrics.
/// This setting configures the default LogMetrics property for all clients/configs.
/// Changes to this setting will only take effect in newly-constructed clients.
///
/// The setting can be configured through App.config, for example:
/// <code>
/// &lt;appSettings&gt;
/// &lt;add key="AWSLogMetrics" value="true"/&gt;
/// &lt;/appSettings&gt;
/// </code>
/// </summary>
[Obsolete("This property is obsolete. Use LoggingConfig.LogMetrics instead.")]
public static bool LogMetrics
{
get { return _rootConfig.Logging.LogMetrics; }
set { _rootConfig.Logging.LogMetrics = value; }
}

#endregion

#region SDK Cache

Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Core/AWSSDK.Core.NetStandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>

<NoWarn>$(NoWarn);CS1591;CA1822</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<SignAssembly>True</SignAssembly>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<SignAssembly>True</SignAssembly>

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand Down
17 changes: 0 additions & 17 deletions sdk/src/Core/Amazon.Auth/AccessControlPolicy/ConditionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,6 @@ public static Condition NewCondition(string key, bool value)
return new Condition("Bool", key, value.ToString().ToLowerInvariant());
}

/// <summary>
/// This method is deprecated. Invoking this method results in non-UTC DateTimes
/// not being marshalled correctly. Use NewConditionUtc instead.
/// Constructs a new access policy condition that compares the current time
/// (on the AWS servers) to the specified date.
/// </summary>
/// <param name="type">The type of comparison to perform. For example,
/// DateComparisonType.DateLessThan will cause this policy
/// condition to evaluate to true if the current date is less than
/// the date specified in the second argument.</param>
/// <param name="date">The date to compare against.</param>
[Obsolete("Invoking this method results in non-UTC DateTimes not being marshalled correctly. Use NewConditionUtc instead.", false)]
public static Condition NewCondition(DateComparisonType type, DateTime date)
{
return new Condition(type.ToString(), CURRENT_TIME_CONDITION_KEY, date.ToString(AWSSDKUtils.ISO8601DateFormat, CultureInfo.InvariantCulture));
}

/// <summary>
/// Constructs a new access policy condition that compares the current time
/// (on the AWS servers) to the specified date.
Expand Down
26 changes: 0 additions & 26 deletions sdk/src/Core/Amazon.Runtime/AmazonServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,6 @@ protected virtual void Initialize()

#region Invoke methods

[Obsolete("Invoke taking marshallers is obsolete. Use Invoke taking InvokeOptionsBase instead.")]
protected TResponse Invoke<TRequest, TResponse>(TRequest request,
IMarshaller<IRequest, AmazonWebServiceRequest> marshaller, ResponseUnmarshaller unmarshaller)
where TRequest : AmazonWebServiceRequest
where TResponse : AmazonWebServiceResponse
{
var options = new InvokeOptions();
options.RequestMarshaller = marshaller;
options.ResponseUnmarshaller = unmarshaller;
return Invoke<TResponse>(request, options);
}

protected TResponse Invoke<TResponse>(AmazonWebServiceRequest request, InvokeOptionsBase options)
where TResponse : AmazonWebServiceResponse
Expand All @@ -232,21 +221,6 @@ protected TResponse Invoke<TResponse>(AmazonWebServiceRequest request, InvokeOpt

#if AWS_ASYNC_API

[Obsolete("InvokeAsync taking marshallers is obsolete. Use InvokeAsync taking InvokeOptionsBase instead.")]
protected System.Threading.Tasks.Task<TResponse> InvokeAsync<TRequest, TResponse>(
TRequest request,
IMarshaller<IRequest, AmazonWebServiceRequest> marshaller,
ResponseUnmarshaller unmarshaller,
System.Threading.CancellationToken cancellationToken)
where TRequest: AmazonWebServiceRequest
where TResponse : AmazonWebServiceResponse, new()
{
var options = new InvokeOptions();
options.RequestMarshaller = marshaller;
options.ResponseUnmarshaller = unmarshaller;
return InvokeAsync<TResponse>(request, options, cancellationToken);
}

protected System.Threading.Tasks.Task<TResponse> InvokeAsync<TResponse>(
AmazonWebServiceRequest request,
InvokeOptionsBase options,
Expand Down
12 changes: 1 addition & 11 deletions sdk/src/Core/Amazon.Runtime/CapacityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,7 @@ public bool TryAcquireCapacity(RetryCapacity retryCapacity, CapacityType capacit
}
}

/// <summary>
/// This method calls a method to release capacity back
/// based on whether it was a successful response or a successful retry response. This is invoked by a retry request response.
/// </summary>
/// <param name="isRetryRequest">if this request is a retry, use a different capacity cost</param>
/// <param name="retryCapacity">Contains the RetryCapacity object for the said ServiceURL.</param>
[Obsolete("This method is no longer used in favor of allowing the caller to specify the type of capacity to release.")]
public void TryReleaseCapacity(bool isRetryRequest, RetryCapacity retryCapacity)
{
ReleaseCapacity(isRetryRequest ? CapacityType.Retry : CapacityType.Increment, retryCapacity);
}


/// <summary>
/// This method calls a method to release capacity back
Expand Down
51 changes: 4 additions & 47 deletions sdk/src/Core/Amazon.Runtime/ClientConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public abstract partial class ClientConfig : IClientConfig
private string signatureVersion = "4";
private string clientAppId = null;
private SigningAlgorithm signatureMethod = SigningAlgorithm.HmacSHA256;
private bool readEntireResponse = false;
private bool logResponse = false;
private int bufferSize = AWSSDKUtils.DefaultBufferSize;
private long progressUpdateInterval = AWSSDKUtils.DefaultProgressUpdateInterval;
Expand Down Expand Up @@ -387,15 +386,7 @@ public bool UseHttp
set { this.useHttp = value; }
}

/// <summary>
/// Given this client configuration, return a DNS suffix for service endpoint url.
/// </summary>
[Obsolete("This operation is obsoleted because as of version 3.7.100 endpoint is resolved using a newer system that uses request level parameters to resolve the endpoint, use the service-specific client.DetermineServiceOperationEndPoint method instead.")]
public virtual string DetermineDnsSuffix()
{
var endpoint = regionEndpoint.GetEndpointForService(this);
return endpoint.DnsSuffix;
}


internal static string GetUrl(IClientConfig config, RegionEndpoint regionEndpoint)
{
Expand Down Expand Up @@ -499,19 +490,7 @@ public bool LogResponse
set { this.logResponse = value; }
}

/// <summary>
/// Gets and sets the ReadEntireResponse property.
/// NOTE: This property does not effect response processing and is deprecated.
/// To enable response logging, the ClientConfig.LogResponse and AWSConfigs.LoggingConfig
/// properties can be used.
/// </summary>
[Obsolete("This property does not effect response processing and is deprecated." +
"To enable response logging, the ClientConfig.LogResponse and AWSConfigs.LoggingConfig.LogResponses properties can be used.")]
public bool ReadEntireResponse
{
get { return this.readEntireResponse; }
set { this.readEntireResponse = value; }
}


/// <summary>
/// Gets and Sets the BufferSize property.
Expand Down Expand Up @@ -949,31 +928,9 @@ public virtual void Validate()
#endif
}

/// <summary>
/// Returns the current UTC now after clock correction for AWSConfigs.ManualClockCorrection.
/// </summary>
[Obsolete("Please use CorrectClockSkew.GetCorrectedUtcNowForEndpoint(string endpoint) instead.", false)]
public DateTime CorrectedUtcNow
{
get
{
// Passing null will cause GetCorrectedUtcNowForEndpoint to skip calculating ClockSkew based on
// endpoint and only use ManualClockCorrection if is set.
return CorrectClockSkew.GetCorrectedUtcNowForEndpoint(null);
}
}

/// <summary>
/// Wrapper around <seealso cref="AWSConfigs.ManualClockCorrection"/>
/// </summary>
[Obsolete("Please use CorrectClockSkew.GetClockCorrectionForEndpoint(string endpoint) instead.", false)]
public TimeSpan ClockOffset
{
get
{
return AWSConfigs.ManualClockCorrection.GetValueOrDefault();
}
}



/// <summary>
/// Gets and sets the DisableHostPrefixInjection flag. If true, host prefix injection will be disabled for this client, the default value of this flag is false.
Expand Down
3 changes: 0 additions & 3 deletions sdk/src/Core/Amazon.Runtime/CorrectClockSkew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ internal static void SetClockCorrectionForEndpoint(string endpoint, TimeSpan cor
try
{
clockCorrectionDictionary[endpoint] = correction;
#pragma warning disable CS0618 // Type or member is obsolete
AWSConfigs.ClockOffset = correction;
#pragma warning restore CS0618 // Type or member is obsolete
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ private void RegisterProfileInternal(CredentialProfile profile)

private void UpdateConfigSectionsFromProfile(CredentialProfile profile, Dictionary<string, string> profileDictionary)
{
if (_configFile == null || !_configFile.TryGetSection(profile.Name, out var configProperties))
if (_configFile == null || !_configFile.TryGetSection(profile.Name, false, false, out var configProperties, out _))
return;

var configPropertiesNames = configProperties.Keys.ToArray();
Expand Down
Loading