private Amazon.LicenseManager.Model.UpdateLicenseManagerReportGeneratorResponse CallAWSServiceOperation(IAmazonLicenseManager client, Amazon.LicenseManager.Model.UpdateLicenseManagerReportGeneratorRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS License Manager", "UpdateLicenseManagerReportGenerator"); try { #if DESKTOP return(client.UpdateLicenseManagerReportGenerator(request)); #elif CORECLR return(client.UpdateLicenseManagerReportGeneratorAsync(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.LicenseManager.Model.UpdateLicenseManagerReportGeneratorRequest(); if (cmdletContext.ClientToken != null) { request.ClientToken = cmdletContext.ClientToken; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.LicenseManagerReportGeneratorArn != null) { request.LicenseManagerReportGeneratorArn = cmdletContext.LicenseManagerReportGeneratorArn; } // populate ReportContext var requestReportContextIsNull = true; request.ReportContext = new Amazon.LicenseManager.Model.ReportContext(); List <System.String> requestReportContext_reportContext_LicenseConfigurationArn = null; if (cmdletContext.ReportContext_LicenseConfigurationArn != null) { requestReportContext_reportContext_LicenseConfigurationArn = cmdletContext.ReportContext_LicenseConfigurationArn; } if (requestReportContext_reportContext_LicenseConfigurationArn != null) { request.ReportContext.LicenseConfigurationArns = requestReportContext_reportContext_LicenseConfigurationArn; requestReportContextIsNull = false; } // determine if request.ReportContext should be set to null if (requestReportContextIsNull) { request.ReportContext = null; } // populate ReportFrequency var requestReportFrequencyIsNull = true; request.ReportFrequency = new Amazon.LicenseManager.Model.ReportFrequency(); Amazon.LicenseManager.ReportFrequencyType requestReportFrequency_reportFrequency_Period = null; if (cmdletContext.ReportFrequency_Period != null) { requestReportFrequency_reportFrequency_Period = cmdletContext.ReportFrequency_Period; } if (requestReportFrequency_reportFrequency_Period != null) { request.ReportFrequency.Period = requestReportFrequency_reportFrequency_Period; requestReportFrequencyIsNull = false; } System.Int32?requestReportFrequency_reportFrequency_Value = null; if (cmdletContext.ReportFrequency_Value != null) { requestReportFrequency_reportFrequency_Value = cmdletContext.ReportFrequency_Value.Value; } if (requestReportFrequency_reportFrequency_Value != null) { request.ReportFrequency.Value = requestReportFrequency_reportFrequency_Value.Value; requestReportFrequencyIsNull = false; } // determine if request.ReportFrequency should be set to null if (requestReportFrequencyIsNull) { request.ReportFrequency = null; } if (cmdletContext.ReportGeneratorName != null) { request.ReportGeneratorName = cmdletContext.ReportGeneratorName; } if (cmdletContext.Type != null) { request.Type = cmdletContext.Type; } 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); }