private Amazon.Pinpoint.Model.UpdateSmsChannelResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateSmsChannelRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateSmsChannel"); try { #if DESKTOP return(client.UpdateSmsChannel(request)); #elif CORECLR return(client.UpdateSmsChannelAsync(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.Pinpoint.Model.UpdateSmsChannelRequest(); if (cmdletContext.ApplicationId != null) { request.ApplicationId = cmdletContext.ApplicationId; } // populate SMSChannelRequest var requestSMSChannelRequestIsNull = true; request.SMSChannelRequest = new Amazon.Pinpoint.Model.SMSChannelRequest(); System.Boolean?requestSMSChannelRequest_sMSChannelRequest_Enabled = null; if (cmdletContext.SMSChannelRequest_Enabled != null) { requestSMSChannelRequest_sMSChannelRequest_Enabled = cmdletContext.SMSChannelRequest_Enabled.Value; } if (requestSMSChannelRequest_sMSChannelRequest_Enabled != null) { request.SMSChannelRequest.Enabled = requestSMSChannelRequest_sMSChannelRequest_Enabled.Value; requestSMSChannelRequestIsNull = false; } System.String requestSMSChannelRequest_sMSChannelRequest_SenderId = null; if (cmdletContext.SMSChannelRequest_SenderId != null) { requestSMSChannelRequest_sMSChannelRequest_SenderId = cmdletContext.SMSChannelRequest_SenderId; } if (requestSMSChannelRequest_sMSChannelRequest_SenderId != null) { request.SMSChannelRequest.SenderId = requestSMSChannelRequest_sMSChannelRequest_SenderId; requestSMSChannelRequestIsNull = false; } System.String requestSMSChannelRequest_sMSChannelRequest_ShortCode = null; if (cmdletContext.SMSChannelRequest_ShortCode != null) { requestSMSChannelRequest_sMSChannelRequest_ShortCode = cmdletContext.SMSChannelRequest_ShortCode; } if (requestSMSChannelRequest_sMSChannelRequest_ShortCode != null) { request.SMSChannelRequest.ShortCode = requestSMSChannelRequest_sMSChannelRequest_ShortCode; requestSMSChannelRequestIsNull = false; } // determine if request.SMSChannelRequest should be set to null if (requestSMSChannelRequestIsNull) { request.SMSChannelRequest = 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); }