Skip to content

Commit

Permalink
fix: Fixed an issue where custom AmazonEC2Client.DryRun() method was …
Browse files Browse the repository at this point in the history
…not working for non-BCL targets. Also included this method in IAmazonEC2 interface.
  • Loading branch information
ashishdhingra committed Jan 9, 2025
1 parent 472e49d commit 92bb5d8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
11 changes: 11 additions & 0 deletions generator/.DevConfigs/2a17f370-6558-4542-a38f-2361e83b84ea.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"services": [
{
"serviceName": "EC2",
"type": "patch",
"changeLogMessages": [
"fix: Fixed an issue where custom AmazonEC2Client.DryRun() method was not working for non-BCL targets. Also included this method in IAmazonEC2 interface."
]
}
]
}
4 changes: 2 additions & 2 deletions sdk/src/Services/EC2/Custom/AmazonEC2Client.Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Amazon.EC2
/// pay only for capacity that you actually use. Amazon EC2 provides developers the tools to build failure resilient applications and isolate
/// themselves from common failure scenarios. </para> <para> Visit http://aws.amazon.com/ec2/ for more information. </para>
/// </summary>
public partial class AmazonEC2Client
public partial class AmazonEC2Client : AmazonServiceClient, IAmazonEC2
{
#region DryRun

Expand Down Expand Up @@ -112,7 +112,7 @@ private static Dictionary<Type, DryRunInfo> MethodCache
_methodCache = new Dictionary<Type, DryRunInfo>();

var ec2RequestType = typeof(AmazonEC2Request);
var allMembers = typeof(AmazonEC2Client).GetMembers();
var allMembers = typeof(AmazonEC2Client).GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
foreach (var member in allMembers)
{
MethodInfo method = member as MethodInfo;
Expand Down
30 changes: 30 additions & 0 deletions sdk/src/Services/EC2/Custom/IAmazonEC2.Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 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 Amazon.EC2.Model;
using Amazon.Runtime;
using System;

namespace Amazon.EC2
{
public partial interface IAmazonEC2 : IAmazonService, IDisposable
{
/// <summary>
/// Checks whether you have the required permissions for the action, without actually making the request.
/// </summary>
/// <param name="request">Request to do a dry run of.</param>
/// <returns>Result of the dry run.</returns>
DryRunResponse DryRun(AmazonEC2Request request);
}
}

0 comments on commit 92bb5d8

Please sign in to comment.