Skip to content

Commit de75b07

Browse files
This release adds support for retrieval of the optional executionIamPolicy field in the GetJobRun API response.
1 parent a5d7f70 commit de75b07

File tree

7 files changed

+117
-3
lines changed

7 files changed

+117
-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,89 @@
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 System.Text.Json;
33+
#pragma warning disable CS0612,CS0618
34+
namespace Amazon.EMRServerless.Model.Internal.MarshallTransformations
35+
{
36+
/// <summary>
37+
/// Response Unmarshaller for JobRunExecutionIamPolicy Object
38+
/// </summary>
39+
public class JobRunExecutionIamPolicyUnmarshaller : IJsonUnmarshaller<JobRunExecutionIamPolicy, JsonUnmarshallerContext>
40+
{
41+
/// <summary>
42+
/// Unmarshaller the response from the service to the response class.
43+
/// </summary>
44+
/// <param name="context"></param>
45+
/// <param name="reader"></param>
46+
/// <returns>The unmarshalled object</returns>
47+
public JobRunExecutionIamPolicy Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf8JsonReader reader)
48+
{
49+
JobRunExecutionIamPolicy unmarshalledObject = new JobRunExecutionIamPolicy();
50+
if (context.IsEmptyResponse)
51+
return null;
52+
context.Read(ref reader);
53+
if (context.CurrentTokenType == JsonTokenType.Null)
54+
return null;
55+
56+
int targetDepth = context.CurrentDepth;
57+
while (context.ReadAtDepth(targetDepth, ref reader))
58+
{
59+
if (context.TestExpression("policy", targetDepth))
60+
{
61+
var unmarshaller = StringUnmarshaller.Instance;
62+
unmarshalledObject.Policy = unmarshaller.Unmarshall(context, ref reader);
63+
continue;
64+
}
65+
if (context.TestExpression("policyArns", targetDepth))
66+
{
67+
var unmarshaller = new JsonListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
68+
unmarshalledObject.PolicyArns = unmarshaller.Unmarshall(context, ref reader);
69+
continue;
70+
}
71+
}
72+
return unmarshalledObject;
73+
}
74+
75+
76+
private static JobRunExecutionIamPolicyUnmarshaller _instance = new JobRunExecutionIamPolicyUnmarshaller();
77+
78+
/// <summary>
79+
/// Gets the singleton.
80+
/// </summary>
81+
public static JobRunExecutionIamPolicyUnmarshaller Instance
82+
{
83+
get
84+
{
85+
return _instance;
86+
}
87+
}
88+
}
89+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ public JobRun Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf8JsonR
116116
unmarshalledObject.EndedAt = unmarshaller.Unmarshall(context, ref reader);
117117
continue;
118118
}
119+
if (context.TestExpression("executionIamPolicy", targetDepth))
120+
{
121+
var unmarshaller = JobRunExecutionIamPolicyUnmarshaller.Instance;
122+
unmarshalledObject.ExecutionIamPolicy = unmarshaller.Unmarshall(context, ref reader);
123+
continue;
124+
}
119125
if (context.TestExpression("executionRole", targetDepth))
120126
{
121127
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)