public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.SageMaker.Model.CreateHumanTaskUiRequest(); if (cmdletContext.HumanTaskUiName != null) { request.HumanTaskUiName = cmdletContext.HumanTaskUiName; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } // populate UiTemplate var requestUiTemplateIsNull = true; request.UiTemplate = new Amazon.SageMaker.Model.UiTemplate(); System.String requestUiTemplate_uiTemplate_Content = null; if (cmdletContext.UiTemplate_Content != null) { requestUiTemplate_uiTemplate_Content = cmdletContext.UiTemplate_Content; } if (requestUiTemplate_uiTemplate_Content != null) { request.UiTemplate.Content = requestUiTemplate_uiTemplate_Content; requestUiTemplateIsNull = false; } // determine if request.UiTemplate should be set to null if (requestUiTemplateIsNull) { request.UiTemplate = 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.SageMaker.Model.CreateHumanTaskUiResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.CreateHumanTaskUiRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "CreateHumanTaskUi"); try { #if DESKTOP return(client.CreateHumanTaskUi(request)); #elif CORECLR return(client.CreateHumanTaskUiAsync(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; } }