Skip to content

Commit 9cab257

Browse files
Adding OAuth2.0 support for servicenow connector.
1 parent de77add commit 9cab257

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

generator/ServiceModels/appflow/appflow-2020-08-23.api.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,13 +2975,10 @@
29752975
},
29762976
"ServiceNowConnectorProfileCredentials":{
29772977
"type":"structure",
2978-
"required":[
2979-
"username",
2980-
"password"
2981-
],
29822978
"members":{
29832979
"username":{"shape":"Username"},
2984-
"password":{"shape":"Password"}
2980+
"password":{"shape":"Password"},
2981+
"oAuth2Credentials":{"shape":"OAuth2Credentials"}
29852982
}
29862983
},
29872984
"ServiceNowConnectorProfileProperties":{

generator/ServiceModels/appflow/appflow-2020-08-23.docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,8 @@
16731673
"OAuth2Credentials": {
16741674
"base": "<p>The OAuth 2.0 credentials required for OAuth 2.0 authentication.</p>",
16751675
"refs": {
1676-
"CustomConnectorProfileCredentials$oauth2": "<p>The OAuth 2.0 credentials required for the authentication of the user.</p>"
1676+
"CustomConnectorProfileCredentials$oauth2": "<p>The OAuth 2.0 credentials required for the authentication of the user.</p>",
1677+
"ServiceNowConnectorProfileCredentials$oAuth2Credentials": "<p> The OAuth 2.0 credentials required to authenticate the user. </p>"
16771678
}
16781679
},
16791680
"OAuth2CustomParameter": {

generator/ServiceModels/appflow/appflow-2020-08-23.normal.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4651,10 +4651,6 @@
46514651
},
46524652
"ServiceNowConnectorProfileCredentials":{
46534653
"type":"structure",
4654-
"required":[
4655-
"username",
4656-
"password"
4657-
],
46584654
"members":{
46594655
"username":{
46604656
"shape":"Username",
@@ -4663,6 +4659,10 @@
46634659
"password":{
46644660
"shape":"Password",
46654661
"documentation":"<p> The password that corresponds to the user name. </p>"
4662+
},
4663+
"oAuth2Credentials":{
4664+
"shape":"OAuth2Credentials",
4665+
"documentation":"<p> The OAuth 2.0 credentials required to authenticate the user. </p>"
46664666
}
46674667
},
46684668
"documentation":"<p> The connector-specific profile credentials required when using ServiceNow. </p>"

sdk/src/Services/Appflow/Generated/Model/Internal/MarshallTransformations/ServiceNowConnectorProfileCredentialsMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ public class ServiceNowConnectorProfileCredentialsMarshaller : IRequestMarshalle
4545
/// <returns></returns>
4646
public void Marshall(ServiceNowConnectorProfileCredentials requestObject, JsonMarshallerContext context)
4747
{
48+
if(requestObject.IsSetOAuth2Credentials())
49+
{
50+
context.Writer.WritePropertyName("oAuth2Credentials");
51+
context.Writer.WriteObjectStart();
52+
53+
var marshaller = OAuth2CredentialsMarshaller.Instance;
54+
marshaller.Marshall(requestObject.OAuth2Credentials, context);
55+
56+
context.Writer.WriteObjectEnd();
57+
}
58+
4859
if(requestObject.IsSetPassword())
4960
{
5061
context.Writer.WritePropertyName("password");

sdk/src/Services/Appflow/Generated/Model/ServiceNowConnectorProfileCredentials.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,35 @@ namespace Amazon.Appflow.Model
3333
/// </summary>
3434
public partial class ServiceNowConnectorProfileCredentials
3535
{
36+
private OAuth2Credentials _oAuth2Credentials;
3637
private string _password;
3738
private string _username;
3839

40+
/// <summary>
41+
/// Gets and sets the property OAuth2Credentials.
42+
/// <para>
43+
/// The OAuth 2.0 credentials required to authenticate the user.
44+
/// </para>
45+
/// </summary>
46+
public OAuth2Credentials OAuth2Credentials
47+
{
48+
get { return this._oAuth2Credentials; }
49+
set { this._oAuth2Credentials = value; }
50+
}
51+
52+
// Check to see if OAuth2Credentials property is set
53+
internal bool IsSetOAuth2Credentials()
54+
{
55+
return this._oAuth2Credentials != null;
56+
}
57+
3958
/// <summary>
4059
/// Gets and sets the property Password.
4160
/// <para>
4261
/// The password that corresponds to the user name.
4362
/// </para>
4463
/// </summary>
45-
[AWSProperty(Required=true, Sensitive=true, Max=512)]
64+
[AWSProperty(Sensitive=true, Max=512)]
4665
public string Password
4766
{
4867
get { return this._password; }
@@ -61,7 +80,7 @@ internal bool IsSetPassword()
6180
/// The name of the user.
6281
/// </para>
6382
/// </summary>
64-
[AWSProperty(Required=true, Max=512)]
83+
[AWSProperty(Max=512)]
6584
public string Username
6685
{
6786
get { return this._username; }

0 commit comments

Comments
 (0)