private Amazon.ChimeSDKIdentity.Model.RegisterAppInstanceUserEndpointResponse CallAWSServiceOperation(IAmazonChimeSDKIdentity client, Amazon.ChimeSDKIdentity.Model.RegisterAppInstanceUserEndpointRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Chime SDK Identity", "RegisterAppInstanceUserEndpoint");
     try
     {
         #if DESKTOP
         return(client.RegisterAppInstanceUserEndpoint(request));
         #elif CORECLR
         return(client.RegisterAppInstanceUserEndpointAsync(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.ChimeSDKIdentity.Model.RegisterAppInstanceUserEndpointRequest();

            if (cmdletContext.AllowMessage != null)
            {
                request.AllowMessages = cmdletContext.AllowMessage;
            }
            if (cmdletContext.AppInstanceUserArn != null)
            {
                request.AppInstanceUserArn = cmdletContext.AppInstanceUserArn;
            }
            if (cmdletContext.ClientRequestToken != null)
            {
                request.ClientRequestToken = cmdletContext.ClientRequestToken;
            }

            // populate EndpointAttributes
            var requestEndpointAttributesIsNull = true;

            request.EndpointAttributes = new Amazon.ChimeSDKIdentity.Model.EndpointAttributes();
            System.String requestEndpointAttributes_endpointAttributes_DeviceToken = null;
            if (cmdletContext.EndpointAttributes_DeviceToken != null)
            {
                requestEndpointAttributes_endpointAttributes_DeviceToken = cmdletContext.EndpointAttributes_DeviceToken;
            }
            if (requestEndpointAttributes_endpointAttributes_DeviceToken != null)
            {
                request.EndpointAttributes.DeviceToken = requestEndpointAttributes_endpointAttributes_DeviceToken;
                requestEndpointAttributesIsNull        = false;
            }
            System.String requestEndpointAttributes_endpointAttributes_VoipDeviceToken = null;
            if (cmdletContext.EndpointAttributes_VoipDeviceToken != null)
            {
                requestEndpointAttributes_endpointAttributes_VoipDeviceToken = cmdletContext.EndpointAttributes_VoipDeviceToken;
            }
            if (requestEndpointAttributes_endpointAttributes_VoipDeviceToken != null)
            {
                request.EndpointAttributes.VoipDeviceToken = requestEndpointAttributes_endpointAttributes_VoipDeviceToken;
                requestEndpointAttributesIsNull            = false;
            }
            // determine if request.EndpointAttributes should be set to null
            if (requestEndpointAttributesIsNull)
            {
                request.EndpointAttributes = null;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.ResourceArn != null)
            {
                request.ResourceArn = cmdletContext.ResourceArn;
            }
            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);
        }