private Amazon.AmplifyUIBuilder.Model.UpdateThemeResponse CallAWSServiceOperation(IAmazonAmplifyUIBuilder client, Amazon.AmplifyUIBuilder.Model.UpdateThemeRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Amplify UI Builder", "UpdateTheme"); try { #if DESKTOP return(client.UpdateTheme(request)); #elif CORECLR return(client.UpdateThemeAsync(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.AmplifyUIBuilder.Model.UpdateThemeRequest(); if (cmdletContext.AppId != null) { request.AppId = cmdletContext.AppId; } if (cmdletContext.ClientToken != null) { request.ClientToken = cmdletContext.ClientToken; } if (cmdletContext.EnvironmentName != null) { request.EnvironmentName = cmdletContext.EnvironmentName; } if (cmdletContext.Id != null) { request.Id = cmdletContext.Id; } // populate UpdatedTheme var requestUpdatedThemeIsNull = true; request.UpdatedTheme = new Amazon.AmplifyUIBuilder.Model.UpdateThemeData(); System.String requestUpdatedTheme_updatedTheme_Id = null; if (cmdletContext.UpdatedTheme_Id != null) { requestUpdatedTheme_updatedTheme_Id = cmdletContext.UpdatedTheme_Id; } if (requestUpdatedTheme_updatedTheme_Id != null) { request.UpdatedTheme.Id = requestUpdatedTheme_updatedTheme_Id; requestUpdatedThemeIsNull = false; } System.String requestUpdatedTheme_updatedTheme_Name = null; if (cmdletContext.UpdatedTheme_Name != null) { requestUpdatedTheme_updatedTheme_Name = cmdletContext.UpdatedTheme_Name; } if (requestUpdatedTheme_updatedTheme_Name != null) { request.UpdatedTheme.Name = requestUpdatedTheme_updatedTheme_Name; requestUpdatedThemeIsNull = false; } List <Amazon.AmplifyUIBuilder.Model.ThemeValues> requestUpdatedTheme_updatedTheme_Override = null; if (cmdletContext.UpdatedTheme_Override != null) { requestUpdatedTheme_updatedTheme_Override = cmdletContext.UpdatedTheme_Override; } if (requestUpdatedTheme_updatedTheme_Override != null) { request.UpdatedTheme.Overrides = requestUpdatedTheme_updatedTheme_Override; requestUpdatedThemeIsNull = false; } List <Amazon.AmplifyUIBuilder.Model.ThemeValues> requestUpdatedTheme_updatedTheme_Value = null; if (cmdletContext.UpdatedTheme_Value != null) { requestUpdatedTheme_updatedTheme_Value = cmdletContext.UpdatedTheme_Value; } if (requestUpdatedTheme_updatedTheme_Value != null) { request.UpdatedTheme.Values = requestUpdatedTheme_updatedTheme_Value; requestUpdatedThemeIsNull = false; } // determine if request.UpdatedTheme should be set to null if (requestUpdatedThemeIsNull) { request.UpdatedTheme = 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); }