private Amazon.Chime.Model.UpdateAccountSettingsResponse CallAWSServiceOperation(IAmazonChime client, Amazon.Chime.Model.UpdateAccountSettingsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Chime", "UpdateAccountSettings"); try { #if DESKTOP return(client.UpdateAccountSettings(request)); #elif CORECLR return(client.UpdateAccountSettingsAsync(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.Chime.Model.UpdateAccountSettingsRequest(); if (cmdletContext.AccountId != null) { request.AccountId = cmdletContext.AccountId; } // populate AccountSettings var requestAccountSettingsIsNull = true; request.AccountSettings = new Amazon.Chime.Model.AccountSettings(); System.Boolean?requestAccountSettings_accountSettings_DisableRemoteControl = null; if (cmdletContext.AccountSettings_DisableRemoteControl != null) { requestAccountSettings_accountSettings_DisableRemoteControl = cmdletContext.AccountSettings_DisableRemoteControl.Value; } if (requestAccountSettings_accountSettings_DisableRemoteControl != null) { request.AccountSettings.DisableRemoteControl = requestAccountSettings_accountSettings_DisableRemoteControl.Value; requestAccountSettingsIsNull = false; } System.Boolean?requestAccountSettings_accountSettings_EnableDialOut = null; if (cmdletContext.AccountSettings_EnableDialOut != null) { requestAccountSettings_accountSettings_EnableDialOut = cmdletContext.AccountSettings_EnableDialOut.Value; } if (requestAccountSettings_accountSettings_EnableDialOut != null) { request.AccountSettings.EnableDialOut = requestAccountSettings_accountSettings_EnableDialOut.Value; requestAccountSettingsIsNull = false; } // determine if request.AccountSettings should be set to null if (requestAccountSettingsIsNull) { request.AccountSettings = 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); }