From 2f9c7120d638d066f0510e1393e42a4baf1204c2 Mon Sep 17 00:00:00 2001 From: awstools Date: Wed, 6 Sep 2023 18:16:37 +0000 Subject: [PATCH] feat(client-appflow): Adding OAuth2.0 support for servicenow connector. --- .../commands/CreateConnectorProfileCommand.ts | 21 ++++++++++++------- .../commands/UpdateConnectorProfileCommand.ts | 21 ++++++++++++------- clients/client-appflow/src/models/models_0.ts | 11 ++++++++-- codegen/sdk-codegen/aws-models/appflow.json | 12 +++++++---- 4 files changed, 45 insertions(+), 20 deletions(-) diff --git a/clients/client-appflow/src/commands/CreateConnectorProfileCommand.ts b/clients/client-appflow/src/commands/CreateConnectorProfileCommand.ts index 29e4a42e6a33..6618b0d725a6 100644 --- a/clients/client-appflow/src/commands/CreateConnectorProfileCommand.ts +++ b/clients/client-appflow/src/commands/CreateConnectorProfileCommand.ts @@ -208,8 +208,18 @@ export interface CreateConnectorProfileCommandOutput extends CreateConnectorProf * jwtToken: "STRING_VALUE", * }, * ServiceNow: { // ServiceNowConnectorProfileCredentials - * username: "STRING_VALUE", // required - * password: "STRING_VALUE", // required + * username: "STRING_VALUE", + * password: "STRING_VALUE", + * oAuth2Credentials: { // OAuth2Credentials + * clientId: "STRING_VALUE", + * clientSecret: "STRING_VALUE", + * accessToken: "STRING_VALUE", + * refreshToken: "STRING_VALUE", + * oAuthRequest: { + * authCode: "STRING_VALUE", + * redirectUri: "STRING_VALUE", + * }, + * }, * }, * Singular: { // SingularConnectorProfileCredentials * apiKey: "STRING_VALUE", // required @@ -218,10 +228,7 @@ export interface CreateConnectorProfileCommandOutput extends CreateConnectorProf * clientId: "STRING_VALUE", // required * clientSecret: "STRING_VALUE", // required * accessToken: "STRING_VALUE", - * oAuthRequest: { - * authCode: "STRING_VALUE", - * redirectUri: "STRING_VALUE", - * }, + * oAuthRequest: "", * }, * Snowflake: { // SnowflakeConnectorProfileCredentials * username: "STRING_VALUE", // required @@ -259,7 +266,7 @@ export interface CreateConnectorProfileCommandOutput extends CreateConnectorProf * username: "STRING_VALUE", // required * password: "STRING_VALUE", // required * }, - * oauth2: { // OAuth2Credentials + * oauth2: { * clientId: "STRING_VALUE", * clientSecret: "STRING_VALUE", * accessToken: "STRING_VALUE", diff --git a/clients/client-appflow/src/commands/UpdateConnectorProfileCommand.ts b/clients/client-appflow/src/commands/UpdateConnectorProfileCommand.ts index ed9bc5313b75..20e0254059a2 100644 --- a/clients/client-appflow/src/commands/UpdateConnectorProfileCommand.ts +++ b/clients/client-appflow/src/commands/UpdateConnectorProfileCommand.ts @@ -201,8 +201,18 @@ export interface UpdateConnectorProfileCommandOutput extends UpdateConnectorProf * jwtToken: "STRING_VALUE", * }, * ServiceNow: { // ServiceNowConnectorProfileCredentials - * username: "STRING_VALUE", // required - * password: "STRING_VALUE", // required + * username: "STRING_VALUE", + * password: "STRING_VALUE", + * oAuth2Credentials: { // OAuth2Credentials + * clientId: "STRING_VALUE", + * clientSecret: "STRING_VALUE", + * accessToken: "STRING_VALUE", + * refreshToken: "STRING_VALUE", + * oAuthRequest: { + * authCode: "STRING_VALUE", + * redirectUri: "STRING_VALUE", + * }, + * }, * }, * Singular: { // SingularConnectorProfileCredentials * apiKey: "STRING_VALUE", // required @@ -211,10 +221,7 @@ export interface UpdateConnectorProfileCommandOutput extends UpdateConnectorProf * clientId: "STRING_VALUE", // required * clientSecret: "STRING_VALUE", // required * accessToken: "STRING_VALUE", - * oAuthRequest: { - * authCode: "STRING_VALUE", - * redirectUri: "STRING_VALUE", - * }, + * oAuthRequest: "", * }, * Snowflake: { // SnowflakeConnectorProfileCredentials * username: "STRING_VALUE", // required @@ -252,7 +259,7 @@ export interface UpdateConnectorProfileCommandOutput extends UpdateConnectorProf * username: "STRING_VALUE", // required * password: "STRING_VALUE", // required * }, - * oauth2: { // OAuth2Credentials + * oauth2: { * clientId: "STRING_VALUE", * clientSecret: "STRING_VALUE", * accessToken: "STRING_VALUE", diff --git a/clients/client-appflow/src/models/models_0.ts b/clients/client-appflow/src/models/models_0.ts index a43f09fb3956..13740780d49b 100644 --- a/clients/client-appflow/src/models/models_0.ts +++ b/clients/client-appflow/src/models/models_0.ts @@ -3468,13 +3468,19 @@ export interface ServiceNowConnectorProfileCredentials { * @public *

The name of the user.

*/ - username: string | undefined; + username?: string; /** * @public *

The password that corresponds to the user name.

*/ - password: string | undefined; + password?: string; + + /** + * @public + *

The OAuth 2.0 credentials required to authenticate the user.

+ */ + oAuth2Credentials?: OAuth2Credentials; } /** @@ -7109,6 +7115,7 @@ export const ServiceNowConnectorProfileCredentialsFilterSensitiveLog = ( ): any => ({ ...obj, ...(obj.password && { password: SENSITIVE_STRING }), + ...(obj.oAuth2Credentials && { oAuth2Credentials: OAuth2CredentialsFilterSensitiveLog(obj.oAuth2Credentials) }), }); /** diff --git a/codegen/sdk-codegen/aws-models/appflow.json b/codegen/sdk-codegen/aws-models/appflow.json index 0689e5887849..5cc3ac5cd89f 100644 --- a/codegen/sdk-codegen/aws-models/appflow.json +++ b/codegen/sdk-codegen/aws-models/appflow.json @@ -9253,15 +9253,19 @@ "username": { "target": "com.amazonaws.appflow#Username", "traits": { - "smithy.api#documentation": "

The name of the user.

", - "smithy.api#required": {} + "smithy.api#documentation": "

The name of the user.

" } }, "password": { "target": "com.amazonaws.appflow#Password", "traits": { - "smithy.api#documentation": "

The password that corresponds to the user name.

", - "smithy.api#required": {} + "smithy.api#documentation": "

The password that corresponds to the user name.

" + } + }, + "oAuth2Credentials": { + "target": "com.amazonaws.appflow#OAuth2Credentials", + "traits": { + "smithy.api#documentation": "

The OAuth 2.0 credentials required to authenticate the user.

" } } },