Skip to content

Commit 0c5879b

Browse files
authored
Remove obsolete classes from core (final) (#3431)
* refactor: remove obsolete classes from core and refactor.
1 parent 6a79434 commit 0c5879b

File tree

53 files changed

+86
-4251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+86
-4251
lines changed

sdk/src/Core/AWSConfigs.cs

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ public static partial class AWSConfigs
8080

8181
// Deprecated configs
8282
internal static string _awsRegion = GetConfig(AWSRegionKey);
83-
internal static LoggingOptions _logging = GetLoggingSetting();
84-
internal static ResponseLoggingOption _responseLogging = GetConfigEnum<ResponseLoggingOption>(ResponseLoggingKey);
85-
internal static bool _logMetrics = GetConfigBool(LogMetricsKey);
8683
internal static string _awsProfileName = GetConfig(AWSProfileNameKey);
8784
internal static string _awsAccountsLocation = GetConfig(AWSProfilesLocationKey);
8885
internal static bool _useSdkCache = GetConfigBool(UseSdkCacheKey, defaultValue: true);
@@ -123,33 +120,13 @@ public static TimeSpan? ManualClockCorrection
123120
/// by determining the correct server time and reissuing the
124121
/// request with the correct time.
125122
/// Default value of this field is True.
126-
/// <seealso cref="ClockOffset"/> will be updated with the calculated
127-
/// offset even if this field is set to false, though requests
128-
/// will not be corrected or retried.
129123
/// Ignored if <seealso cref="ManualClockCorrection"/> is set.
130124
/// </summary>
131125
public static bool CorrectForClockSkew
132126
{
133127
get { return _rootConfig.CorrectForClockSkew; }
134128
set { _rootConfig.CorrectForClockSkew = value; }
135129
}
136-
137-
/// <summary>
138-
/// The calculated clock skew correction, if there is one.
139-
/// This field will be set if a service call resulted in an exception
140-
/// and the SDK has determined that there is a difference between local
141-
/// and server times.
142-
///
143-
/// If <seealso cref="CorrectForClockSkew"/> is set to true, this
144-
/// value will be set to the correction, but it will not be used by the
145-
/// SDK and clock skew errors will not be retried.
146-
/// </summary>
147-
[Obsolete("This value is deprecated in favor of IClientConfig.ClockOffset, use CorrectClockSkew.GetClockCorrectionForEndpoint(string endpoint) instead.")]
148-
public static TimeSpan ClockOffset
149-
{
150-
get;
151-
internal set;
152-
}
153130
#endregion
154131

155132
#region Region
@@ -215,7 +192,6 @@ public static string AWSProfileName
215192

216193
/// <summary>
217194
/// Key for the AWSProfilesLocation property.
218-
/// <seealso cref="Amazon.AWSConfigs.LogMetrics"/>
219195
/// </summary>
220196
public const string AWSProfilesLocationKey = "AWSProfilesLocation";
221197

@@ -244,110 +220,6 @@ public static string AWSProfilesLocation
244220

245221
#endregion
246222

247-
#region Logging
248-
249-
/// <summary>
250-
/// Key for the Logging property.
251-
/// <seealso cref="Amazon.AWSConfigs.Logging"/>
252-
/// </summary>
253-
public const string LoggingKey = "AWSLogging";
254-
255-
/// <summary>
256-
/// Configures how the SDK should log events, if at all.
257-
/// Changes to this setting will only take effect in newly-constructed clients.
258-
///
259-
/// The setting can be configured through App.config, for example:
260-
/// <code>
261-
/// &lt;appSettings&gt;
262-
/// &lt;add key="AWSLogging" value="log4net"/&gt;
263-
/// &lt;/appSettings&gt;
264-
/// </code>
265-
/// </summary>
266-
[Obsolete("This property is obsolete. Use LoggingConfig.LogTo instead.")]
267-
public static LoggingOptions Logging
268-
{
269-
get { return _rootConfig.Logging.LogTo; }
270-
set { _rootConfig.Logging.LogTo = value; }
271-
}
272-
273-
private static LoggingOptions GetLoggingSetting()
274-
{
275-
string value = GetConfig(LoggingKey);
276-
if (string.IsNullOrEmpty(value))
277-
return LoggingOptions.None;
278-
279-
string[] settings = value.Split(validSeparators, StringSplitOptions.RemoveEmptyEntries);
280-
if (settings == null || settings.Length == 0)
281-
return LoggingOptions.None;
282-
283-
LoggingOptions totalSetting = LoggingOptions.None;
284-
foreach (string setting in settings)
285-
{
286-
LoggingOptions l = ParseEnum<LoggingOptions>(setting);
287-
totalSetting |= l;
288-
}
289-
return totalSetting;
290-
}
291-
292-
#endregion
293-
294-
#region Response Logging
295-
296-
/// <summary>
297-
/// Key for the ResponseLogging property.
298-
///
299-
/// <seealso cref="Amazon.AWSConfigs.ResponseLogging"/>
300-
/// </summary>
301-
public const string ResponseLoggingKey = "AWSResponseLogging";
302-
303-
/// <summary>
304-
/// Configures when the SDK should log service responses.
305-
/// Changes to this setting will take effect immediately.
306-
///
307-
/// The setting can be configured through App.config, for example:
308-
/// <code>
309-
/// &lt;appSettings&gt;
310-
/// &lt;add key="AWSResponseLogging" value="OnError"/&gt;
311-
/// &lt;/appSettings&gt;
312-
/// </code>
313-
/// </summary>
314-
[Obsolete("This property is obsolete. Use LoggingConfig.LogResponses instead.")]
315-
public static ResponseLoggingOption ResponseLogging
316-
{
317-
get { return _rootConfig.Logging.LogResponses; }
318-
set { _rootConfig.Logging.LogResponses = value; }
319-
}
320-
321-
#endregion
322-
323-
#region Log Metrics
324-
325-
/// <summary>
326-
/// Key for the LogMetrics property.
327-
/// <seealso cref="Amazon.AWSConfigs.LogMetrics"/>
328-
/// </summary>
329-
public const string LogMetricsKey = "AWSLogMetrics";
330-
331-
/// <summary>
332-
/// Configures if the SDK should log performance metrics.
333-
/// This setting configures the default LogMetrics property for all clients/configs.
334-
/// Changes to this setting will only take effect in newly-constructed clients.
335-
///
336-
/// The setting can be configured through App.config, for example:
337-
/// <code>
338-
/// &lt;appSettings&gt;
339-
/// &lt;add key="AWSLogMetrics" value="true"/&gt;
340-
/// &lt;/appSettings&gt;
341-
/// </code>
342-
/// </summary>
343-
[Obsolete("This property is obsolete. Use LoggingConfig.LogMetrics instead.")]
344-
public static bool LogMetrics
345-
{
346-
get { return _rootConfig.Logging.LogMetrics; }
347-
set { _rootConfig.Logging.LogMetrics = value; }
348-
}
349-
350-
#endregion
351223

352224
#region SDK Cache
353225

sdk/src/Core/AWSSDK.Core.NetStandard.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
2222

2323
<NoWarn>$(NoWarn);CS1591;CA1822</NoWarn>
24-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
25-
<SignAssembly>True</SignAssembly>
24+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
25+
<SignAssembly>True</SignAssembly>
2626

2727
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2828
</PropertyGroup>

sdk/src/Core/Amazon.Auth/AccessControlPolicy/ConditionFactory.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -237,23 +237,6 @@ public static Condition NewCondition(string key, bool value)
237237
return new Condition("Bool", key, value.ToString().ToLowerInvariant());
238238
}
239239

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

sdk/src/Core/Amazon.Runtime/AmazonServiceClient.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,6 @@ protected virtual void Initialize()
195195

196196
#region Invoke methods
197197

198-
[Obsolete("Invoke taking marshallers is obsolete. Use Invoke taking InvokeOptionsBase instead.")]
199-
protected TResponse Invoke<TRequest, TResponse>(TRequest request,
200-
IMarshaller<IRequest, AmazonWebServiceRequest> marshaller, ResponseUnmarshaller unmarshaller)
201-
where TRequest : AmazonWebServiceRequest
202-
where TResponse : AmazonWebServiceResponse
203-
{
204-
var options = new InvokeOptions();
205-
options.RequestMarshaller = marshaller;
206-
options.ResponseUnmarshaller = unmarshaller;
207-
return Invoke<TResponse>(request, options);
208-
}
209198

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

233222
#if AWS_ASYNC_API
234223

235-
[Obsolete("InvokeAsync taking marshallers is obsolete. Use InvokeAsync taking InvokeOptionsBase instead.")]
236-
protected System.Threading.Tasks.Task<TResponse> InvokeAsync<TRequest, TResponse>(
237-
TRequest request,
238-
IMarshaller<IRequest, AmazonWebServiceRequest> marshaller,
239-
ResponseUnmarshaller unmarshaller,
240-
System.Threading.CancellationToken cancellationToken)
241-
where TRequest: AmazonWebServiceRequest
242-
where TResponse : AmazonWebServiceResponse, new()
243-
{
244-
var options = new InvokeOptions();
245-
options.RequestMarshaller = marshaller;
246-
options.ResponseUnmarshaller = unmarshaller;
247-
return InvokeAsync<TResponse>(request, options, cancellationToken);
248-
}
249-
250224
protected System.Threading.Tasks.Task<TResponse> InvokeAsync<TResponse>(
251225
AmazonWebServiceRequest request,
252226
InvokeOptionsBase options,

sdk/src/Core/Amazon.Runtime/CapacityManager.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,7 @@ public bool TryAcquireCapacity(RetryCapacity retryCapacity, CapacityType capacit
111111
}
112112
}
113113

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

126116
/// <summary>
127117
/// This method calls a method to release capacity back

sdk/src/Core/Amazon.Runtime/ClientConfig.cs

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public abstract partial class ClientConfig : IClientConfig
6565
private string signatureVersion = "4";
6666
private string clientAppId = null;
6767
private SigningAlgorithm signatureMethod = SigningAlgorithm.HmacSHA256;
68-
private bool readEntireResponse = false;
6968
private bool logResponse = false;
7069
private int bufferSize = AWSSDKUtils.DefaultBufferSize;
7170
private long progressUpdateInterval = AWSSDKUtils.DefaultProgressUpdateInterval;
@@ -387,15 +386,7 @@ public bool UseHttp
387386
set { this.useHttp = value; }
388387
}
389388

390-
/// <summary>
391-
/// Given this client configuration, return a DNS suffix for service endpoint url.
392-
/// </summary>
393-
[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.")]
394-
public virtual string DetermineDnsSuffix()
395-
{
396-
var endpoint = regionEndpoint.GetEndpointForService(this);
397-
return endpoint.DnsSuffix;
398-
}
389+
399390

400391
internal static string GetUrl(IClientConfig config, RegionEndpoint regionEndpoint)
401392
{
@@ -499,19 +490,7 @@ public bool LogResponse
499490
set { this.logResponse = value; }
500491
}
501492

502-
/// <summary>
503-
/// Gets and sets the ReadEntireResponse property.
504-
/// NOTE: This property does not effect response processing and is deprecated.
505-
/// To enable response logging, the ClientConfig.LogResponse and AWSConfigs.LoggingConfig
506-
/// properties can be used.
507-
/// </summary>
508-
[Obsolete("This property does not effect response processing and is deprecated." +
509-
"To enable response logging, the ClientConfig.LogResponse and AWSConfigs.LoggingConfig.LogResponses properties can be used.")]
510-
public bool ReadEntireResponse
511-
{
512-
get { return this.readEntireResponse; }
513-
set { this.readEntireResponse = value; }
514-
}
493+
515494

516495
/// <summary>
517496
/// Gets and Sets the BufferSize property.
@@ -949,31 +928,9 @@ public virtual void Validate()
949928
#endif
950929
}
951930

952-
/// <summary>
953-
/// Returns the current UTC now after clock correction for AWSConfigs.ManualClockCorrection.
954-
/// </summary>
955-
[Obsolete("Please use CorrectClockSkew.GetCorrectedUtcNowForEndpoint(string endpoint) instead.", false)]
956-
public DateTime CorrectedUtcNow
957-
{
958-
get
959-
{
960-
// Passing null will cause GetCorrectedUtcNowForEndpoint to skip calculating ClockSkew based on
961-
// endpoint and only use ManualClockCorrection if is set.
962-
return CorrectClockSkew.GetCorrectedUtcNowForEndpoint(null);
963-
}
964-
}
965931

966-
/// <summary>
967-
/// Wrapper around <seealso cref="AWSConfigs.ManualClockCorrection"/>
968-
/// </summary>
969-
[Obsolete("Please use CorrectClockSkew.GetClockCorrectionForEndpoint(string endpoint) instead.", false)]
970-
public TimeSpan ClockOffset
971-
{
972-
get
973-
{
974-
return AWSConfigs.ManualClockCorrection.GetValueOrDefault();
975-
}
976-
}
932+
933+
977934

978935
/// <summary>
979936
/// 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.

sdk/src/Core/Amazon.Runtime/CorrectClockSkew.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ internal static void SetClockCorrectionForEndpoint(string endpoint, TimeSpan cor
127127
try
128128
{
129129
clockCorrectionDictionary[endpoint] = correction;
130-
#pragma warning disable CS0618 // Type or member is obsolete
131-
AWSConfigs.ClockOffset = correction;
132-
#pragma warning restore CS0618 // Type or member is obsolete
133130
}
134131
finally
135132
{

sdk/src/Core/Amazon.Runtime/CredentialManagement/SharedCredentialsFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ private void RegisterProfileInternal(CredentialProfile profile)
447447

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

453453
var configPropertiesNames = configProperties.Keys.ToArray();

0 commit comments

Comments
 (0)