private Amazon.NimbleStudio.Model.CreateStudioResponse CallAWSServiceOperation(IAmazonNimbleStudio client, Amazon.NimbleStudio.Model.CreateStudioRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Nimble Studio", "CreateStudio"); try { #if DESKTOP return(client.CreateStudio(request)); #elif CORECLR return(client.CreateStudioAsync(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.NimbleStudio.Model.CreateStudioRequest(); if (cmdletContext.AdminRoleArn != null) { request.AdminRoleArn = cmdletContext.AdminRoleArn; } if (cmdletContext.ClientToken != null) { request.ClientToken = cmdletContext.ClientToken; } if (cmdletContext.DisplayName != null) { request.DisplayName = cmdletContext.DisplayName; } // populate StudioEncryptionConfiguration var requestStudioEncryptionConfigurationIsNull = true; request.StudioEncryptionConfiguration = new Amazon.NimbleStudio.Model.StudioEncryptionConfiguration(); System.String requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyArn = null; if (cmdletContext.StudioEncryptionConfiguration_KeyArn != null) { requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyArn = cmdletContext.StudioEncryptionConfiguration_KeyArn; } if (requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyArn != null) { request.StudioEncryptionConfiguration.KeyArn = requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyArn; requestStudioEncryptionConfigurationIsNull = false; } Amazon.NimbleStudio.StudioEncryptionConfigurationKeyType requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyType = null; if (cmdletContext.StudioEncryptionConfiguration_KeyType != null) { requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyType = cmdletContext.StudioEncryptionConfiguration_KeyType; } if (requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyType != null) { request.StudioEncryptionConfiguration.KeyType = requestStudioEncryptionConfiguration_studioEncryptionConfiguration_KeyType; requestStudioEncryptionConfigurationIsNull = false; } // determine if request.StudioEncryptionConfiguration should be set to null if (requestStudioEncryptionConfigurationIsNull) { request.StudioEncryptionConfiguration = null; } if (cmdletContext.StudioName != null) { request.StudioName = cmdletContext.StudioName; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.UserRoleArn != null) { request.UserRoleArn = cmdletContext.UserRoleArn; } 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); }