private Amazon.LicenseManager.Model.UpdateServiceSettingsResponse CallAWSServiceOperation(IAmazonLicenseManager client, Amazon.LicenseManager.Model.UpdateServiceSettingsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS License Manager", "UpdateServiceSettings"); try { #if DESKTOP return(client.UpdateServiceSettings(request)); #elif CORECLR return(client.UpdateServiceSettingsAsync(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.UpdateServiceSettingsRequest(); if (cmdletContext.EnableCrossAccountsDiscovery != null) { request.EnableCrossAccountsDiscovery = cmdletContext.EnableCrossAccountsDiscovery.Value; } // populate OrganizationConfiguration var requestOrganizationConfigurationIsNull = true; request.OrganizationConfiguration = new Amazon.LicenseManager.Model.OrganizationConfiguration(); System.Boolean?requestOrganizationConfiguration_organizationConfiguration_EnableIntegration = null; if (cmdletContext.OrganizationConfiguration_EnableIntegration != null) { requestOrganizationConfiguration_organizationConfiguration_EnableIntegration = cmdletContext.OrganizationConfiguration_EnableIntegration.Value; } if (requestOrganizationConfiguration_organizationConfiguration_EnableIntegration != null) { request.OrganizationConfiguration.EnableIntegration = requestOrganizationConfiguration_organizationConfiguration_EnableIntegration.Value; requestOrganizationConfigurationIsNull = false; } // determine if request.OrganizationConfiguration should be set to null if (requestOrganizationConfigurationIsNull) { request.OrganizationConfiguration = null; } if (cmdletContext.S3BucketArn != null) { request.S3BucketArn = cmdletContext.S3BucketArn; } if (cmdletContext.SnsTopicArn != null) { request.SnsTopicArn = cmdletContext.SnsTopicArn; } 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); }