示例#1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.MediaPackageVod.Model.ConfigureLogsRequest();


            // populate EgressAccessLogs
            var requestEgressAccessLogsIsNull = true;

            request.EgressAccessLogs = new Amazon.MediaPackageVod.Model.EgressAccessLogs();
            System.String requestEgressAccessLogs_egressAccessLogs_LogGroupName = null;
            if (cmdletContext.EgressAccessLogs_LogGroupName != null)
            {
                requestEgressAccessLogs_egressAccessLogs_LogGroupName = cmdletContext.EgressAccessLogs_LogGroupName;
            }
            if (requestEgressAccessLogs_egressAccessLogs_LogGroupName != null)
            {
                request.EgressAccessLogs.LogGroupName = requestEgressAccessLogs_egressAccessLogs_LogGroupName;
                requestEgressAccessLogsIsNull         = false;
            }
            // determine if request.EgressAccessLogs should be set to null
            if (requestEgressAccessLogsIsNull)
            {
                request.EgressAccessLogs = null;
            }
            if (cmdletContext.Id != null)
            {
                request.Id = cmdletContext.Id;
            }

            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);
        }
示例#2
0
 private Amazon.MediaPackageVod.Model.ConfigureLogsResponse CallAWSServiceOperation(IAmazonMediaPackageVod client, Amazon.MediaPackageVod.Model.ConfigureLogsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elemental MediaPackage VOD", "ConfigureLogs");
     try
     {
         #if DESKTOP
         return(client.ConfigureLogs(request));
         #elif CORECLR
         return(client.ConfigureLogsAsync(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;
     }
 }