private Amazon.CognitoIdentityProvider.Model.UpdateUserPoolClientResponse CallAWSServiceOperation(IAmazonCognitoIdentityProvider client, Amazon.CognitoIdentityProvider.Model.UpdateUserPoolClientRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Cognito Identity Provider", "UpdateUserPoolClient"); try { #if DESKTOP return(client.UpdateUserPoolClient(request)); #elif CORECLR return(client.UpdateUserPoolClientAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.CognitoIdentityProvider.Model.UpdateUserPoolClientRequest(); if (cmdletContext.AllowedOAuthFlow != null) { request.AllowedOAuthFlows = cmdletContext.AllowedOAuthFlow; } if (cmdletContext.AllowedOAuthFlowsUserPoolClient != null) { request.AllowedOAuthFlowsUserPoolClient = cmdletContext.AllowedOAuthFlowsUserPoolClient.Value; } if (cmdletContext.AllowedOAuthScope != null) { request.AllowedOAuthScopes = cmdletContext.AllowedOAuthScope; } // populate AnalyticsConfiguration var requestAnalyticsConfigurationIsNull = true; request.AnalyticsConfiguration = new Amazon.CognitoIdentityProvider.Model.AnalyticsConfigurationType(); System.String requestAnalyticsConfiguration_analyticsConfiguration_ApplicationId = null; if (cmdletContext.AnalyticsConfiguration_ApplicationId != null) { requestAnalyticsConfiguration_analyticsConfiguration_ApplicationId = cmdletContext.AnalyticsConfiguration_ApplicationId; } if (requestAnalyticsConfiguration_analyticsConfiguration_ApplicationId != null) { request.AnalyticsConfiguration.ApplicationId = requestAnalyticsConfiguration_analyticsConfiguration_ApplicationId; requestAnalyticsConfigurationIsNull = false; } System.String requestAnalyticsConfiguration_analyticsConfiguration_ExternalId = null; if (cmdletContext.AnalyticsConfiguration_ExternalId != null) { requestAnalyticsConfiguration_analyticsConfiguration_ExternalId = cmdletContext.AnalyticsConfiguration_ExternalId; } if (requestAnalyticsConfiguration_analyticsConfiguration_ExternalId != null) { request.AnalyticsConfiguration.ExternalId = requestAnalyticsConfiguration_analyticsConfiguration_ExternalId; requestAnalyticsConfigurationIsNull = false; } System.String requestAnalyticsConfiguration_analyticsConfiguration_RoleArn = null; if (cmdletContext.AnalyticsConfiguration_RoleArn != null) { requestAnalyticsConfiguration_analyticsConfiguration_RoleArn = cmdletContext.AnalyticsConfiguration_RoleArn; } if (requestAnalyticsConfiguration_analyticsConfiguration_RoleArn != null) { request.AnalyticsConfiguration.RoleArn = requestAnalyticsConfiguration_analyticsConfiguration_RoleArn; requestAnalyticsConfigurationIsNull = false; } System.Boolean?requestAnalyticsConfiguration_analyticsConfiguration_UserDataShared = null; if (cmdletContext.AnalyticsConfiguration_UserDataShared != null) { requestAnalyticsConfiguration_analyticsConfiguration_UserDataShared = cmdletContext.AnalyticsConfiguration_UserDataShared.Value; } if (requestAnalyticsConfiguration_analyticsConfiguration_UserDataShared != null) { request.AnalyticsConfiguration.UserDataShared = requestAnalyticsConfiguration_analyticsConfiguration_UserDataShared.Value; requestAnalyticsConfigurationIsNull = false; } // determine if request.AnalyticsConfiguration should be set to null if (requestAnalyticsConfigurationIsNull) { request.AnalyticsConfiguration = null; } if (cmdletContext.CallbackURLs != null) { request.CallbackURLs = cmdletContext.CallbackURLs; } if (cmdletContext.ClientId != null) { request.ClientId = cmdletContext.ClientId; } if (cmdletContext.ClientName != null) { request.ClientName = cmdletContext.ClientName; } if (cmdletContext.DefaultRedirectURI != null) { request.DefaultRedirectURI = cmdletContext.DefaultRedirectURI; } if (cmdletContext.ExplicitAuthFlow != null) { request.ExplicitAuthFlows = cmdletContext.ExplicitAuthFlow; } if (cmdletContext.LogoutURLs != null) { request.LogoutURLs = cmdletContext.LogoutURLs; } if (cmdletContext.PreventUserExistenceError != null) { request.PreventUserExistenceErrors = cmdletContext.PreventUserExistenceError; } if (cmdletContext.ReadAttribute != null) { request.ReadAttributes = cmdletContext.ReadAttribute; } if (cmdletContext.RefreshTokenValidity != null) { request.RefreshTokenValidity = cmdletContext.RefreshTokenValidity.Value; } if (cmdletContext.SupportedIdentityProvider != null) { request.SupportedIdentityProviders = cmdletContext.SupportedIdentityProvider; } if (cmdletContext.UserPoolId != null) { request.UserPoolId = cmdletContext.UserPoolId; } if (cmdletContext.WriteAttribute != null) { request.WriteAttributes = cmdletContext.WriteAttribute; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Allows the developer to update the specified user pool client and password policy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateUserPoolClient service method.</param> /// /// <returns>The response from the UpdateUserPoolClient service method, as returned by CognitoIdentityProvider.</returns> /// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException"> /// This exception is thrown when Amazon Cognito encounters an internal error. /// </exception> /// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException"> /// This exception is thrown when the Amazon Cognito service encounters an invalid parameter. /// </exception> /// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException"> /// This exception gets thrown when a user is not authorized. /// </exception> /// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException"> /// This exception is thrown when the Amazon Cognito service cannot find the requested /// resource. /// </exception> /// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException"> /// This exception gets thrown when the user has made too many requests for a given operation. /// </exception> public UpdateUserPoolClientResponse UpdateUserPoolClient(UpdateUserPoolClientRequest request) { var marshaller = new UpdateUserPoolClientRequestMarshaller(); var unmarshaller = UpdateUserPoolClientResponseUnmarshaller.Instance; return Invoke<UpdateUserPoolClientRequest,UpdateUserPoolClientResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the UpdateUserPoolClient operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateUserPoolClient operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<UpdateUserPoolClientResponse> UpdateUserPoolClientAsync(UpdateUserPoolClientRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateUserPoolClientRequestMarshaller(); var unmarshaller = UpdateUserPoolClientResponseUnmarshaller.Instance; return InvokeAsync<UpdateUserPoolClientRequest,UpdateUserPoolClientResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the UpdateUserPoolClient operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateUserPoolClient operation on AmazonCognitoIdentityProviderClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateUserPoolClient /// operation.</returns> public IAsyncResult BeginUpdateUserPoolClient(UpdateUserPoolClientRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateUserPoolClientRequestMarshaller(); var unmarshaller = UpdateUserPoolClientResponseUnmarshaller.Instance; return BeginInvoke<UpdateUserPoolClientRequest>(request, marshaller, unmarshaller, callback, state); }