private Amazon.ConnectWisdomService.Model.UpdateContentResponse CallAWSServiceOperation(IAmazonConnectWisdomService client, Amazon.ConnectWisdomService.Model.UpdateContentRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Wisdom Service", "UpdateContent"); try { #if DESKTOP return(client.UpdateContent(request)); #elif CORECLR return(client.UpdateContentAsync(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.ConnectWisdomService.Model.UpdateContentRequest(); if (cmdletContext.ContentId != null) { request.ContentId = cmdletContext.ContentId; } if (cmdletContext.KnowledgeBaseId != null) { request.KnowledgeBaseId = cmdletContext.KnowledgeBaseId; } if (cmdletContext.Metadata != null) { request.Metadata = cmdletContext.Metadata; } if (cmdletContext.OverrideLinkOutUri != null) { request.OverrideLinkOutUri = cmdletContext.OverrideLinkOutUri; } if (cmdletContext.RemoveOverrideLinkOutUri != null) { request.RemoveOverrideLinkOutUri = cmdletContext.RemoveOverrideLinkOutUri.Value; } if (cmdletContext.RevisionId != null) { request.RevisionId = cmdletContext.RevisionId; } if (cmdletContext.Title != null) { request.Title = cmdletContext.Title; } if (cmdletContext.UploadId != null) { request.UploadId = cmdletContext.UploadId; } 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); }