public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AmplifyUIBuilder.Model.RefreshTokenRequest(); if (cmdletContext.Provider != null) { request.Provider = cmdletContext.Provider; } // populate RefreshTokenBody var requestRefreshTokenBodyIsNull = true; request.RefreshTokenBody = new Amazon.AmplifyUIBuilder.Model.RefreshTokenRequestBody(); System.String requestRefreshTokenBody_refreshTokenBody_Token = null; if (cmdletContext.RefreshTokenBody_Token != null) { requestRefreshTokenBody_refreshTokenBody_Token = cmdletContext.RefreshTokenBody_Token; } if (requestRefreshTokenBody_refreshTokenBody_Token != null) { request.RefreshTokenBody.Token = requestRefreshTokenBody_refreshTokenBody_Token; requestRefreshTokenBodyIsNull = false; } // determine if request.RefreshTokenBody should be set to null if (requestRefreshTokenBodyIsNull) { request.RefreshTokenBody = null; } 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); }
private Amazon.AmplifyUIBuilder.Model.RefreshTokenResponse CallAWSServiceOperation(IAmazonAmplifyUIBuilder client, Amazon.AmplifyUIBuilder.Model.RefreshTokenRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Amplify UI Builder", "RefreshToken"); try { #if DESKTOP return(client.RefreshToken(request)); #elif CORECLR return(client.RefreshTokenAsync(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; } }