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 custom service package code #3684

Merged
merged 7 commits into from
Mar 6, 2025
Merged
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
54 changes: 54 additions & 0 deletions generator/.DevConfigs/0C9C1129-CEB5-41BA-B24F-95A5E89E4573.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"services": [
{
"serviceName": "CloudFront",
"type": "patch",
"changeLogMessages": [
"Removed the AmazonCloudFrontUtil utility code that was no longer being used."
]
},
{
"serviceName": "DynamoDBv2",
"type": "patch",
"changeLogMessages": [
"Removed the DynamoDBContextTableNamePrefix property. Users should call AWSConfigsDynamoDB.Context.TableNamePrefix instead of AWSConfigsDynamoDB.Context.DynamoDBContextTableNamePrefix."
]
},
{
"serviceName": "EC2",
"type": "patch",
"changeLogMessages": [
"Removed the VPC utilizes code. It was terribly out of date even referring to EC2 instance type that has been deprecated for years.",
"Removed the image utilities used for looking up EC2 amis for Windows OS."
]
},
{
"serviceName": "IoT",
"type": "patch",
"changeLogMessages": [
"Removed a legacy customization for NextToken override to refer to the actual modeled pagination token."
]
},
{
"serviceName": "Lambda",
"type": "patch",
"changeLogMessages": [
"Removed obsolete InvokeAsync service client operation to avoid confusion with the Async suffix added for async .NET methods."
]
},
{
"serviceName": "SageMakerRuntime",
"type": "patch",
"changeLogMessages": [
"Removed obsolete constructors for PayloadPart."
]
},
{
"serviceName": "SecurityToken",
"type": "patch",
"changeLogMessages": [
"Removed the deprecated STS assume role credential provider since users should be using the one in core."
]
}
]
}
13 changes: 1 addition & 12 deletions generator/ServiceModels/lambda/lambda.customizations.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
{
"shapeModifiers": {
"InvokeAsyncRequest": {
"deprecatedMessage": "For .NET 3.5/4.5, API InvokeAsyncResponse InvokeAsync(InvokeAsyncRequest) is deprecated, use InvokeResponse Invoke(InvokeRequest), or Task<InvokeResponse> InvokeAsync(InvokeRequest, CancellationToken) instead. For .NET Core, Task<InvokeAsyncResponse> InvokeAsyncAsync(InvokeAsyncRequest, CancellationToken) is deprecated, use Task<InvokeResponse> InvokeAsync(InvokeRequest, CancellationToken) instead.",
"modify": [
{
"InvokeArgs": { "emitPropertyName": "InvokeArgsStream" }
}
]
},
"InvokeAsyncResponse": {
"deprecatedMessage": "For .NET 3.5/4.5, API InvokeAsyncResponse InvokeAsync(InvokeAsyncRequest) is deprecated, use InvokeResponse Invoke(InvokeRequest), or Task<InvokeResponse> InvokeAsync(InvokeRequest, CancellationToken) instead. For .NET Core, Task<InvokeAsyncResponse> InvokeAsyncAsync(InvokeAsyncRequest, CancellationToken) is deprecated, use Task<InvokeResponse> InvokeAsync(InvokeRequest, CancellationToken) instead."
},
"InvocationRequest": {
"modify": [
{
@@ -74,7 +63,7 @@
},
"operationModifiers": {
"InvokeAsync": {
"deprecatedMessage": "For .NET 3.5/4.5, API InvokeAsyncResponse InvokeAsync(InvokeAsyncRequest) is deprecated, use InvokeResponse Invoke(InvokeRequest), or Task<InvokeResponse> InvokeAsync(InvokeRequest, CancellationToken) instead. For .NET Core, Task<InvokeAsyncResponse> InvokeAsyncAsync(InvokeAsyncRequest, CancellationToken) is deprecated, use Task<InvokeResponse> InvokeAsync(InvokeRequest, CancellationToken) instead."
"exclude": true
}
},
"emitIsSetProperties": {
Original file line number Diff line number Diff line change
@@ -840,12 +840,6 @@
<max>1024</max>
<pattern>(\$LATEST|[0-9]+)</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.Lambda.Model.InvokeAsyncRequest.FunctionName</property>
<min>1</min>
<max>170</max>
<pattern>(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.Lambda.Model.InvokeWithResponseStreamRequest.FunctionName</property>
<min>1</min>
@@ -1743,6 +1737,12 @@
<property>Amazon.Lambda.Model.ImageConfig.WorkingDirectory</property>
<max>1000</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.Lambda.Model.InvokeAsyncRequest.FunctionName</property>
<min>1</min>
<max>170</max>
<pattern>(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.Lambda.Model.Layer.Arn</property>
<min>1</min>
Original file line number Diff line number Diff line change
@@ -367,6 +367,8 @@ public static string Interpolate(string template, Dictionary<string, object> ref
/// </summary>
public static string InterpolateJson(string json, Dictionary<string, object> refs)
{
if (string.IsNullOrEmpty(json))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this change to avoid the SDK generating a lot of JsonExceptions being thrown when an empty string is being sent in.

return string.Empty;
try
{
using JsonDocument doc = JsonDocument.Parse(json);
@@ -381,7 +383,7 @@ public static string InterpolateJson(string json, Dictionary<string, object> ref
}
catch (JsonException)
{
return "";
return string.Empty;
}
}

Original file line number Diff line number Diff line change
@@ -69,7 +69,10 @@ public override async System.Threading.Tasks.Task<T> InvokeAsync<T>(IExecutionCo
{
var requestContext = executionContext.RequestContext;
var regionalEndpoint = requestContext.Request.Endpoint;
PreInvoke(executionContext);

var immutableCredentials = (requestContext.Identity as AWSCredentials)?.GetCredentialsAsync();

PreInvoke(executionContext, immutableCredentials);

try
{
@@ -107,7 +110,7 @@ public static void EvictCacheKeyForRequest(IRequestContext requestContext, Uri r
requestContext.Request.Endpoint = regionalEndpoint;
}

public static void DiscoverEndpoints(IRequestContext requestContext, bool evictCacheKey)
public static void DiscoverEndpoints(IRequestContext requestContext, bool evictCacheKey, ImmutableCredentials credentials)
{
var discoveryEndpoints = ProcessEndpointDiscovery(requestContext, evictCacheKey, requestContext.Request.Endpoint);
if (discoveryEndpoints != null)
@@ -130,10 +133,9 @@ public static void DiscoverEndpoints(IRequestContext requestContext, bool evictC
}
}

private static IEnumerable<DiscoveryEndpointBase> ProcessEndpointDiscovery(IRequestContext requestContext, bool evictCacheKey, Uri evictUri)
private static IEnumerable<DiscoveryEndpointBase> ProcessEndpointDiscovery(IRequestContext requestContext, bool evictCacheKey, Uri evictUri, ImmutableCredentials immutableCredentials)
{
var options = requestContext.Options;
var immutableCredentials = (requestContext.Identity as AWSCredentials)?.GetCredentials();

if (options.EndpointDiscoveryMarshaller != null && options.EndpointOperation != null && immutableCredentials != null)
{
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ public partial class UpdateStackRequest : AmazonCloudFormationRequest
/// </summary>
public UpdateStackRequest()
{
this._notificationARNs = new AutoConstructedList<string>();
this._notificationARNs = AWSConfigs.InitializeCollections ? new AutoConstructedList<string>() : null;
}
}
}
48 changes: 0 additions & 48 deletions sdk/src/Services/CloudFront/Custom/Util/CloudFrontConstants.cs

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions sdk/src/Services/DynamoDBv2/Custom/AWSConfigs.DynamoDB.cs
Original file line number Diff line number Diff line change
@@ -57,33 +57,11 @@ static AWSConfigsDynamoDB()

#region DynamoDBContext TableNamePrefix


/// <summary>
/// Key for the DynamoDBContextTableNamePrefix property.
/// <seealso cref="AWSConfigsDynamoDB.DynamoDBContextTableNamePrefix"/>
/// </summary>
public const string DynamoDBContextTableNamePrefixKey = "AWS.DynamoDBContext.TableNamePrefix";

/// <summary>
/// Configures the default TableNamePrefix that the DynamoDBContext will use if
/// not manually configured.
/// Changes to this setting will only take effect in newly-constructed instances of
/// DynamoDBContextConfig and DynamoDBContext.
///
/// The setting can be configured through App.config, for example:
/// <code>
/// &lt;appSettings&gt;
/// &lt;add key="AWS.DynamoDBContext.TableNamePrefix" value="Test-"/&gt;
/// &lt;/appSettings&gt;
/// </code>
/// </summary>
[Obsolete("This property is obsolete. Use DynamoDBConfig.Context.TableNamePrefix instead.")]
public static string DynamoDBContextTableNamePrefix
{
get { return Context.TableNamePrefix; }
set { Context.TableNamePrefix = value; }
}

#endregion

/// <summary>
Loading
Oops, something went wrong.