Skip to content

Commit 752286f

Browse files
This release adds support for retrieval of the optional executionIamPolicy field in the GetJobRun API response.
1 parent 25a8d5d commit 752286f

File tree

7 files changed

+127
-3
lines changed

7 files changed

+127
-3
lines changed

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.api.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@
827827
"createdAt":{"shape":"Date"},
828828
"updatedAt":{"shape":"Date"},
829829
"executionRole":{"shape":"IAMRoleArn"},
830+
"executionIamPolicy":{"shape":"JobRunExecutionIamPolicy"},
830831
"state":{"shape":"JobRunState"},
831832
"stateDetails":{"shape":"String256"},
832833
"releaseLabel":{"shape":"ReleaseLabel"},

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@
491491
"JobRunExecutionIamPolicy": {
492492
"base": "<p>Optional IAM policy. The resulting job IAM role permissions will be an intersection of the policies passed and the policy associated with your job execution role.</p>",
493493
"refs": {
494+
"JobRun$executionIamPolicy": null,
494495
"StartJobRunRequest$executionIamPolicy": "<p>You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.</p>"
495496
}
496497
},
@@ -818,7 +819,7 @@
818819
"ShutdownGracePeriodInSeconds": {
819820
"base": null,
820821
"refs": {
821-
"CancelJobRunRequest$shutdownGracePeriodInSeconds": "<p>The duration (in seconds) to wait before forcefully terminating the job after cancellation is requested.</p>"
822+
"CancelJobRunRequest$shutdownGracePeriodInSeconds": "<p>The duration in seconds to wait before forcefully terminating the job after cancellation is requested.</p>"
822823
}
823824
},
824825
"SparkSubmit": {

generator/ServiceModels/emr-serverless/emr-serverless-2021-07-13.normal.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@
547547
},
548548
"shutdownGracePeriodInSeconds":{
549549
"shape":"ShutdownGracePeriodInSeconds",
550-
"documentation":"<p>The duration (in seconds) to wait before forcefully terminating the job after cancellation is requested.</p>",
550+
"documentation":"<p>The duration in seconds to wait before forcefully terminating the job after cancellation is requested.</p>",
551551
"location":"querystring",
552552
"locationName":"shutdownGracePeriodInSeconds"
553553
}
@@ -1135,6 +1135,7 @@
11351135
"shape":"IAMRoleArn",
11361136
"documentation":"<p>The execution role ARN of the job run.</p>"
11371137
},
1138+
"executionIamPolicy":{"shape":"JobRunExecutionIamPolicy"},
11381139
"state":{
11391140
"shape":"JobRunState",
11401141
"documentation":"<p>The state of the job run.</p>"

sdk/src/Services/EMRServerless/Generated/Model/CancelJobRunRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ internal bool IsSetJobRunId()
8080
/// <summary>
8181
/// Gets and sets the property ShutdownGracePeriodInSeconds.
8282
/// <para>
83-
/// The duration (in seconds) to wait before forcefully terminating the job after cancellation
83+
/// The duration in seconds to wait before forcefully terminating the job after cancellation
8484
/// is requested.
8585
/// </para>
8686
/// </summary>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the emr-serverless-2021-07-13.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Net;
24+
using System.Text;
25+
using System.Xml.Serialization;
26+
27+
using Amazon.EMRServerless.Model;
28+
using Amazon.Runtime;
29+
using Amazon.Runtime.Internal;
30+
using Amazon.Runtime.Internal.Transform;
31+
using Amazon.Runtime.Internal.Util;
32+
using ThirdParty.Json.LitJson;
33+
34+
#pragma warning disable CS0612,CS0618
35+
namespace Amazon.EMRServerless.Model.Internal.MarshallTransformations
36+
{
37+
/// <summary>
38+
/// Response Unmarshaller for JobRunExecutionIamPolicy Object
39+
/// </summary>
40+
public class JobRunExecutionIamPolicyUnmarshaller : IUnmarshaller<JobRunExecutionIamPolicy, XmlUnmarshallerContext>, IUnmarshaller<JobRunExecutionIamPolicy, JsonUnmarshallerContext>
41+
{
42+
/// <summary>
43+
/// Unmarshaller the response from the service to the response class.
44+
/// </summary>
45+
/// <param name="context"></param>
46+
/// <returns></returns>
47+
JobRunExecutionIamPolicy IUnmarshaller<JobRunExecutionIamPolicy, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
48+
{
49+
throw new NotImplementedException();
50+
}
51+
52+
/// <summary>
53+
/// Unmarshaller the response from the service to the response class.
54+
/// </summary>
55+
/// <param name="context"></param>
56+
/// <returns>The unmarshalled object</returns>
57+
public JobRunExecutionIamPolicy Unmarshall(JsonUnmarshallerContext context)
58+
{
59+
JobRunExecutionIamPolicy unmarshalledObject = new JobRunExecutionIamPolicy();
60+
if (context.IsEmptyResponse)
61+
return null;
62+
context.Read();
63+
if (context.CurrentTokenType == JsonToken.Null)
64+
return null;
65+
66+
int targetDepth = context.CurrentDepth;
67+
while (context.ReadAtDepth(targetDepth))
68+
{
69+
if (context.TestExpression("policy", targetDepth))
70+
{
71+
var unmarshaller = StringUnmarshaller.Instance;
72+
unmarshalledObject.Policy = unmarshaller.Unmarshall(context);
73+
continue;
74+
}
75+
if (context.TestExpression("policyArns", targetDepth))
76+
{
77+
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
78+
unmarshalledObject.PolicyArns = unmarshaller.Unmarshall(context);
79+
continue;
80+
}
81+
}
82+
return unmarshalledObject;
83+
}
84+
85+
86+
private static JobRunExecutionIamPolicyUnmarshaller _instance = new JobRunExecutionIamPolicyUnmarshaller();
87+
88+
/// <summary>
89+
/// Gets the singleton.
90+
/// </summary>
91+
public static JobRunExecutionIamPolicyUnmarshaller Instance
92+
{
93+
get
94+
{
95+
return _instance;
96+
}
97+
}
98+
}
99+
}

sdk/src/Services/EMRServerless/Generated/Model/Internal/MarshallTransformations/JobRunUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ public JobRun Unmarshall(JsonUnmarshallerContext context)
126126
unmarshalledObject.EndedAt = unmarshaller.Unmarshall(context);
127127
continue;
128128
}
129+
if (context.TestExpression("executionIamPolicy", targetDepth))
130+
{
131+
var unmarshaller = JobRunExecutionIamPolicyUnmarshaller.Instance;
132+
unmarshalledObject.ExecutionIamPolicy = unmarshaller.Unmarshall(context);
133+
continue;
134+
}
129135
if (context.TestExpression("executionRole", targetDepth))
130136
{
131137
var unmarshaller = StringUnmarshaller.Instance;

sdk/src/Services/EMRServerless/Generated/Model/JobRun.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public partial class JobRun
4545
private DateTime? _createdAt;
4646
private string _createdBy;
4747
private DateTime? _endedAt;
48+
private JobRunExecutionIamPolicy _executionIamPolicy;
4849
private string _executionRole;
4950
private long? _executionTimeoutMinutes;
5051
private JobDriver _jobDriver;
@@ -251,6 +252,21 @@ internal bool IsSetEndedAt()
251252
return this._endedAt.HasValue;
252253
}
253254

255+
/// <summary>
256+
/// Gets and sets the property ExecutionIamPolicy.
257+
/// </summary>
258+
public JobRunExecutionIamPolicy ExecutionIamPolicy
259+
{
260+
get { return this._executionIamPolicy; }
261+
set { this._executionIamPolicy = value; }
262+
}
263+
264+
// Check to see if ExecutionIamPolicy property is set
265+
internal bool IsSetExecutionIamPolicy()
266+
{
267+
return this._executionIamPolicy != null;
268+
}
269+
254270
/// <summary>
255271
/// Gets and sets the property ExecutionRole.
256272
/// <para>

0 commit comments

Comments
 (0)