Skip to content

Commit b31a871

Browse files
Added support for passing role arn corresponding to the supported event destination
1 parent 82f0da4 commit b31a871

File tree

9 files changed

+95
-2
lines changed

9 files changed

+95
-2
lines changed

generator/ServiceModels/socialmessaging/socialmessaging-2024-01-01.api.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,8 @@
501501
"members":{
502502
"accountName":{"shape":"WhatsAppBusinessAccountName"},
503503
"registrationStatus":{"shape":"RegistrationStatus"},
504-
"unregisteredWhatsAppPhoneNumbers":{"shape":"WhatsAppPhoneNumberDetailList"}
504+
"unregisteredWhatsAppPhoneNumbers":{"shape":"WhatsAppPhoneNumberDetailList"},
505+
"wabaId":{"shape":"LinkedWhatsAppBusinessAccountId"}
505506
}
506507
},
507508
"LinkedWhatsAppBusinessAccountSummary":{
@@ -644,6 +645,10 @@
644645
},
645646
"exception":true
646647
},
648+
"RoleArn":{
649+
"type":"string",
650+
"pattern":"arn:aws:iam::\\d{12}:role\\/[a-zA-Z0-9+=,.@\\-_]+"
651+
},
647652
"S3File":{
648653
"type":"structure",
649654
"required":[
@@ -823,7 +828,8 @@
823828
"type":"structure",
824829
"required":["eventDestinationArn"],
825830
"members":{
826-
"eventDestinationArn":{"shape":"EventDestinationArn"}
831+
"eventDestinationArn":{"shape":"EventDestinationArn"},
832+
"roleArn":{"shape":"RoleArn"}
827833
}
828834
},
829835
"WhatsAppBusinessAccountEventDestinations":{

generator/ServiceModels/socialmessaging/socialmessaging-2024-01-01.docs.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
"GetLinkedWhatsAppBusinessAccountInput$id": "<p>The unique identifier, from Amazon Web Services, of the linked WhatsApp Business Account. WABA identifiers are formatted as <code>waba-01234567890123456789012345678901</code>. Use <a href=\"https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_ListLinkedWhatsAppBusinessAccounts.html\">ListLinkedWhatsAppBusinessAccounts</a> to list all WABAs and their details.</p>",
191191
"GetLinkedWhatsAppBusinessAccountPhoneNumberOutput$linkedWhatsAppBusinessAccountId": "<p>The WABA identifier linked to the phone number, formatted as <code>waba-01234567890123456789012345678901</code>.</p>",
192192
"LinkedWhatsAppBusinessAccount$id": "<p>The ID of the linked WhatsApp Business Account, formatted as <code>waba-01234567890123456789012345678901</code>.</p>",
193+
"LinkedWhatsAppBusinessAccountIdMetaData$wabaId": "<p>The Amazon Resource Name (ARN) of the WhatsApp Business Account ID.</p>",
193194
"LinkedWhatsAppBusinessAccountSummary$id": "<p>The ID of the linked WhatsApp Business Account, formatted as <code>waba-01234567890123456789012345678901</code>.</p>",
194195
"PutWhatsAppBusinessAccountEventDestinationsInput$id": "<p>The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as <code>waba-01234567890123456789012345678901</code>. Use <a href=\"https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_ListLinkedWhatsAppBusinessAccounts.html\">ListLinkedWhatsAppBusinessAccounts</a> to list all WABAs and their details.</p>",
195196
"WhatsAppSetupFinalization$phoneNumberParent": "<p>Used to add a new phone number to an existing WhatsApp Business Account. This field can't be used when the <code>waba</code> field is present.</p>"
@@ -299,6 +300,12 @@
299300
"refs": {
300301
}
301302
},
303+
"RoleArn": {
304+
"base": null,
305+
"refs": {
306+
"WhatsAppBusinessAccountEventDestination$roleArn": "<p>The Amazon Resource Name (ARN) of an Identity and Access Management role that is able to import phone numbers and write events.</p>"
307+
}
308+
},
302309
"S3File": {
303310
"base": "<p>Contains information for the S3 bucket that contains media files.</p>",
304311
"refs": {

generator/ServiceModels/socialmessaging/socialmessaging-2024-01-01.normal.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,10 @@
600600
"unregisteredWhatsAppPhoneNumbers":{
601601
"shape":"WhatsAppPhoneNumberDetailList",
602602
"documentation":"<p>The details for unregistered WhatsApp phone numbers.</p>"
603+
},
604+
"wabaId":{
605+
"shape":"LinkedWhatsAppBusinessAccountId",
606+
"documentation":"<p>The Amazon Resource Name (ARN) of the WhatsApp Business Account ID.</p>"
603607
}
604608
},
605609
"documentation":"<p>Contains your WhatsApp registration status and details of any unregistered WhatsApp phone number.</p>"
@@ -800,6 +804,10 @@
800804
},
801805
"exception":true
802806
},
807+
"RoleArn":{
808+
"type":"string",
809+
"pattern":"arn:aws:iam::\\d{12}:role\\/[a-zA-Z0-9+=,.@\\-_]+"
810+
},
803811
"S3File":{
804812
"type":"structure",
805813
"required":[
@@ -1058,6 +1066,10 @@
10581066
"eventDestinationArn":{
10591067
"shape":"EventDestinationArn",
10601068
"documentation":"<p>The ARN of the event destination.</p>"
1069+
},
1070+
"roleArn":{
1071+
"shape":"RoleArn",
1072+
"documentation":"<p>The Amazon Resource Name (ARN) of an Identity and Access Management role that is able to import phone numbers and write events.</p>"
10611073
}
10621074
},
10631075
"documentation":"<p>Contains information on the event destination.</p>"

sdk/code-analysis/ServiceAnalysis/SocialMessaging/Generated/PropertyValueRules.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@
137137
<min>0</min>
138138
<max>200</max>
139139
</property-value-rule>
140+
<property-value-rule>
141+
<property>Amazon.SocialMessaging.Model.LinkedWhatsAppBusinessAccountIdMetaData.WabaId</property>
142+
<min>1</min>
143+
<max>100</max>
144+
<pattern>.*(^waba-.*$)|(^arn:.*:waba/[0-9a-zA-Z]+$).*</pattern>
145+
</property-value-rule>
140146
<property-value-rule>
141147
<property>Amazon.SocialMessaging.Model.LinkedWhatsAppBusinessAccountSummary.Arn</property>
142148
<min>0</min>
@@ -211,6 +217,10 @@
211217
<max>2048</max>
212218
<pattern>arn:.*:[a-z-]+([/:](.*))?</pattern>
213219
</property-value-rule>
220+
<property-value-rule>
221+
<property>Amazon.SocialMessaging.Model.WhatsAppBusinessAccountEventDestination.RoleArn</property>
222+
<pattern>arn:aws:iam::\d{12}:role\/[a-zA-Z0-9+=,.@\-_]+</pattern>
223+
</property-value-rule>
214224
<property-value-rule>
215225
<property>Amazon.SocialMessaging.Model.WhatsAppPhoneNumberDetail.Arn</property>
216226
<min>0</min>

sdk/src/Services/SocialMessaging/Generated/Model/Internal/MarshallTransformations/LinkedWhatsAppBusinessAccountIdMetaDataUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ public LinkedWhatsAppBusinessAccountIdMetaData Unmarshall(JsonUnmarshallerContex
8484
unmarshalledObject.UnregisteredWhatsAppPhoneNumbers = unmarshaller.Unmarshall(context);
8585
continue;
8686
}
87+
if (context.TestExpression("wabaId", targetDepth))
88+
{
89+
var unmarshaller = StringUnmarshaller.Instance;
90+
unmarshalledObject.WabaId = unmarshaller.Unmarshall(context);
91+
continue;
92+
}
8793
}
8894
return unmarshalledObject;
8995
}

sdk/src/Services/SocialMessaging/Generated/Model/Internal/MarshallTransformations/WhatsAppBusinessAccountEventDestinationMarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ public void Marshall(WhatsAppBusinessAccountEventDestination requestObject, Json
5454
context.Writer.Write(requestObject.EventDestinationArn);
5555
}
5656

57+
if(requestObject.IsSetRoleArn())
58+
{
59+
context.Writer.WritePropertyName("roleArn");
60+
context.Writer.Write(requestObject.RoleArn);
61+
}
62+
5763
}
5864

5965
/// <summary>

sdk/src/Services/SocialMessaging/Generated/Model/Internal/MarshallTransformations/WhatsAppBusinessAccountEventDestinationUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ public WhatsAppBusinessAccountEventDestination Unmarshall(JsonUnmarshallerContex
7272
unmarshalledObject.EventDestinationArn = unmarshaller.Unmarshall(context);
7373
continue;
7474
}
75+
if (context.TestExpression("roleArn", targetDepth))
76+
{
77+
var unmarshaller = StringUnmarshaller.Instance;
78+
unmarshalledObject.RoleArn = unmarshaller.Unmarshall(context);
79+
continue;
80+
}
7581
}
7682
return unmarshalledObject;
7783
}

sdk/src/Services/SocialMessaging/Generated/Model/LinkedWhatsAppBusinessAccountIdMetaData.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public partial class LinkedWhatsAppBusinessAccountIdMetaData
3838
private string _accountName;
3939
private RegistrationStatus _registrationStatus;
4040
private List<WhatsAppPhoneNumberDetail> _unregisteredWhatsAppPhoneNumbers = AWSConfigs.InitializeCollections ? new List<WhatsAppPhoneNumberDetail>() : null;
41+
private string _wabaId;
4142

4243
/// <summary>
4344
/// Gets and sets the property AccountName.
@@ -94,5 +95,24 @@ internal bool IsSetUnregisteredWhatsAppPhoneNumbers()
9495
return this._unregisteredWhatsAppPhoneNumbers != null && (this._unregisteredWhatsAppPhoneNumbers.Count > 0 || !AWSConfigs.InitializeCollections);
9596
}
9697

98+
/// <summary>
99+
/// Gets and sets the property WabaId.
100+
/// <para>
101+
/// The Amazon Resource Name (ARN) of the WhatsApp Business Account ID.
102+
/// </para>
103+
/// </summary>
104+
[AWSProperty(Min=1, Max=100)]
105+
public string WabaId
106+
{
107+
get { return this._wabaId; }
108+
set { this._wabaId = value; }
109+
}
110+
111+
// Check to see if WabaId property is set
112+
internal bool IsSetWabaId()
113+
{
114+
return this._wabaId != null;
115+
}
116+
97117
}
98118
}

sdk/src/Services/SocialMessaging/Generated/Model/WhatsAppBusinessAccountEventDestination.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace Amazon.SocialMessaging.Model
3535
public partial class WhatsAppBusinessAccountEventDestination
3636
{
3737
private string _eventDestinationArn;
38+
private string _roleArn;
3839

3940
/// <summary>
4041
/// Gets and sets the property EventDestinationArn.
@@ -55,5 +56,24 @@ internal bool IsSetEventDestinationArn()
5556
return this._eventDestinationArn != null;
5657
}
5758

59+
/// <summary>
60+
/// Gets and sets the property RoleArn.
61+
/// <para>
62+
/// The Amazon Resource Name (ARN) of an Identity and Access Management role that is able
63+
/// to import phone numbers and write events.
64+
/// </para>
65+
/// </summary>
66+
public string RoleArn
67+
{
68+
get { return this._roleArn; }
69+
set { this._roleArn = value; }
70+
}
71+
72+
// Check to see if RoleArn property is set
73+
internal bool IsSetRoleArn()
74+
{
75+
return this._roleArn != null;
76+
}
77+
5878
}
5979
}

0 commit comments

Comments
 (0)