private Amazon.Greengrass.Model.CreateGroupResponse CallAWSServiceOperation(IAmazonGreengrass client, Amazon.Greengrass.Model.CreateGroupRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Greengrass", "CreateGroup");
     try
     {
         #if DESKTOP
         return(client.CreateGroup(request));
         #elif CORECLR
         return(client.CreateGroupAsync(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.Greengrass.Model.CreateGroupRequest();

            if (cmdletContext.AmznClientToken != null)
            {
                request.AmznClientToken = cmdletContext.AmznClientToken;
            }

            // populate InitialVersion
            var requestInitialVersionIsNull = true;

            request.InitialVersion = new Amazon.Greengrass.Model.GroupVersion();
            System.String requestInitialVersion_initialVersion_ConnectorDefinitionVersionArn = null;
            if (cmdletContext.InitialVersion_ConnectorDefinitionVersionArn != null)
            {
                requestInitialVersion_initialVersion_ConnectorDefinitionVersionArn = cmdletContext.InitialVersion_ConnectorDefinitionVersionArn;
            }
            if (requestInitialVersion_initialVersion_ConnectorDefinitionVersionArn != null)
            {
                request.InitialVersion.ConnectorDefinitionVersionArn = requestInitialVersion_initialVersion_ConnectorDefinitionVersionArn;
                requestInitialVersionIsNull = false;
            }
            System.String requestInitialVersion_initialVersion_CoreDefinitionVersionArn = null;
            if (cmdletContext.InitialVersion_CoreDefinitionVersionArn != null)
            {
                requestInitialVersion_initialVersion_CoreDefinitionVersionArn = cmdletContext.InitialVersion_CoreDefinitionVersionArn;
            }
            if (requestInitialVersion_initialVersion_CoreDefinitionVersionArn != null)
            {
                request.InitialVersion.CoreDefinitionVersionArn = requestInitialVersion_initialVersion_CoreDefinitionVersionArn;
                requestInitialVersionIsNull = false;
            }
            System.String requestInitialVersion_initialVersion_DeviceDefinitionVersionArn = null;
            if (cmdletContext.InitialVersion_DeviceDefinitionVersionArn != null)
            {
                requestInitialVersion_initialVersion_DeviceDefinitionVersionArn = cmdletContext.InitialVersion_DeviceDefinitionVersionArn;
            }
            if (requestInitialVersion_initialVersion_DeviceDefinitionVersionArn != null)
            {
                request.InitialVersion.DeviceDefinitionVersionArn = requestInitialVersion_initialVersion_DeviceDefinitionVersionArn;
                requestInitialVersionIsNull = false;
            }
            System.String requestInitialVersion_initialVersion_FunctionDefinitionVersionArn = null;
            if (cmdletContext.InitialVersion_FunctionDefinitionVersionArn != null)
            {
                requestInitialVersion_initialVersion_FunctionDefinitionVersionArn = cmdletContext.InitialVersion_FunctionDefinitionVersionArn;
            }
            if (requestInitialVersion_initialVersion_FunctionDefinitionVersionArn != null)
            {
                request.InitialVersion.FunctionDefinitionVersionArn = requestInitialVersion_initialVersion_FunctionDefinitionVersionArn;
                requestInitialVersionIsNull = false;
            }
            System.String requestInitialVersion_initialVersion_LoggerDefinitionVersionArn = null;
            if (cmdletContext.InitialVersion_LoggerDefinitionVersionArn != null)
            {
                requestInitialVersion_initialVersion_LoggerDefinitionVersionArn = cmdletContext.InitialVersion_LoggerDefinitionVersionArn;
            }
            if (requestInitialVersion_initialVersion_LoggerDefinitionVersionArn != null)
            {
                request.InitialVersion.LoggerDefinitionVersionArn = requestInitialVersion_initialVersion_LoggerDefinitionVersionArn;
                requestInitialVersionIsNull = false;
            }
            System.String requestInitialVersion_initialVersion_ResourceDefinitionVersionArn = null;
            if (cmdletContext.InitialVersion_ResourceDefinitionVersionArn != null)
            {
                requestInitialVersion_initialVersion_ResourceDefinitionVersionArn = cmdletContext.InitialVersion_ResourceDefinitionVersionArn;
            }
            if (requestInitialVersion_initialVersion_ResourceDefinitionVersionArn != null)
            {
                request.InitialVersion.ResourceDefinitionVersionArn = requestInitialVersion_initialVersion_ResourceDefinitionVersionArn;
                requestInitialVersionIsNull = false;
            }
            System.String requestInitialVersion_initialVersion_SubscriptionDefinitionVersionArn = null;
            if (cmdletContext.InitialVersion_SubscriptionDefinitionVersionArn != null)
            {
                requestInitialVersion_initialVersion_SubscriptionDefinitionVersionArn = cmdletContext.InitialVersion_SubscriptionDefinitionVersionArn;
            }
            if (requestInitialVersion_initialVersion_SubscriptionDefinitionVersionArn != null)
            {
                request.InitialVersion.SubscriptionDefinitionVersionArn = requestInitialVersion_initialVersion_SubscriptionDefinitionVersionArn;
                requestInitialVersionIsNull = false;
            }
            // determine if request.InitialVersion should be set to null
            if (requestInitialVersionIsNull)
            {
                request.InitialVersion = null;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            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);
        }