private Amazon.ManagedGrafana.Model.UpdateWorkspaceAuthenticationResponse CallAWSServiceOperation(IAmazonManagedGrafana client, Amazon.ManagedGrafana.Model.UpdateWorkspaceAuthenticationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Managed Grafana", "UpdateWorkspaceAuthentication");
     try
     {
         #if DESKTOP
         return(client.UpdateWorkspaceAuthentication(request));
         #elif CORECLR
         return(client.UpdateWorkspaceAuthenticationAsync(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.ManagedGrafana.Model.UpdateWorkspaceAuthenticationRequest();

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

            // populate SamlConfiguration
            var requestSamlConfigurationIsNull = true;

            request.SamlConfiguration = new Amazon.ManagedGrafana.Model.SamlConfiguration();
            List <System.String> requestSamlConfiguration_samlConfiguration_AllowedOrganization = null;

            if (cmdletContext.SamlConfiguration_AllowedOrganization != null)
            {
                requestSamlConfiguration_samlConfiguration_AllowedOrganization = cmdletContext.SamlConfiguration_AllowedOrganization;
            }
            if (requestSamlConfiguration_samlConfiguration_AllowedOrganization != null)
            {
                request.SamlConfiguration.AllowedOrganizations = requestSamlConfiguration_samlConfiguration_AllowedOrganization;
                requestSamlConfigurationIsNull = false;
            }
            System.Int32?requestSamlConfiguration_samlConfiguration_LoginValidityDuration = null;
            if (cmdletContext.SamlConfiguration_LoginValidityDuration != null)
            {
                requestSamlConfiguration_samlConfiguration_LoginValidityDuration = cmdletContext.SamlConfiguration_LoginValidityDuration.Value;
            }
            if (requestSamlConfiguration_samlConfiguration_LoginValidityDuration != null)
            {
                request.SamlConfiguration.LoginValidityDuration = requestSamlConfiguration_samlConfiguration_LoginValidityDuration.Value;
                requestSamlConfigurationIsNull = false;
            }
            Amazon.ManagedGrafana.Model.IdpMetadata requestSamlConfiguration_samlConfiguration_IdpMetadata = null;

            // populate IdpMetadata
            var requestSamlConfiguration_samlConfiguration_IdpMetadataIsNull = true;

            requestSamlConfiguration_samlConfiguration_IdpMetadata = new Amazon.ManagedGrafana.Model.IdpMetadata();
            System.String requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Url = null;
            if (cmdletContext.IdpMetadata_Url != null)
            {
                requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Url = cmdletContext.IdpMetadata_Url;
            }
            if (requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Url != null)
            {
                requestSamlConfiguration_samlConfiguration_IdpMetadata.Url   = requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Url;
                requestSamlConfiguration_samlConfiguration_IdpMetadataIsNull = false;
            }
            System.String requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Xml = null;
            if (cmdletContext.IdpMetadata_Xml != null)
            {
                requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Xml = cmdletContext.IdpMetadata_Xml;
            }
            if (requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Xml != null)
            {
                requestSamlConfiguration_samlConfiguration_IdpMetadata.Xml   = requestSamlConfiguration_samlConfiguration_IdpMetadata_idpMetadata_Xml;
                requestSamlConfiguration_samlConfiguration_IdpMetadataIsNull = false;
            }
            // determine if requestSamlConfiguration_samlConfiguration_IdpMetadata should be set to null
            if (requestSamlConfiguration_samlConfiguration_IdpMetadataIsNull)
            {
                requestSamlConfiguration_samlConfiguration_IdpMetadata = null;
            }
            if (requestSamlConfiguration_samlConfiguration_IdpMetadata != null)
            {
                request.SamlConfiguration.IdpMetadata = requestSamlConfiguration_samlConfiguration_IdpMetadata;
                requestSamlConfigurationIsNull        = false;
            }
            Amazon.ManagedGrafana.Model.RoleValues requestSamlConfiguration_samlConfiguration_RoleValues = null;

            // populate RoleValues
            var requestSamlConfiguration_samlConfiguration_RoleValuesIsNull = true;

            requestSamlConfiguration_samlConfiguration_RoleValues = new Amazon.ManagedGrafana.Model.RoleValues();
            List <System.String> requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Admin = null;

            if (cmdletContext.RoleValues_Admin != null)
            {
                requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Admin = cmdletContext.RoleValues_Admin;
            }
            if (requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Admin != null)
            {
                requestSamlConfiguration_samlConfiguration_RoleValues.Admin = requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Admin;
                requestSamlConfiguration_samlConfiguration_RoleValuesIsNull = false;
            }
            List <System.String> requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Editor = null;

            if (cmdletContext.RoleValues_Editor != null)
            {
                requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Editor = cmdletContext.RoleValues_Editor;
            }
            if (requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Editor != null)
            {
                requestSamlConfiguration_samlConfiguration_RoleValues.Editor = requestSamlConfiguration_samlConfiguration_RoleValues_roleValues_Editor;
                requestSamlConfiguration_samlConfiguration_RoleValuesIsNull  = false;
            }
            // determine if requestSamlConfiguration_samlConfiguration_RoleValues should be set to null
            if (requestSamlConfiguration_samlConfiguration_RoleValuesIsNull)
            {
                requestSamlConfiguration_samlConfiguration_RoleValues = null;
            }
            if (requestSamlConfiguration_samlConfiguration_RoleValues != null)
            {
                request.SamlConfiguration.RoleValues = requestSamlConfiguration_samlConfiguration_RoleValues;
                requestSamlConfigurationIsNull       = false;
            }
            Amazon.ManagedGrafana.Model.AssertionAttributes requestSamlConfiguration_samlConfiguration_AssertionAttributes = null;

            // populate AssertionAttributes
            var requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull = true;

            requestSamlConfiguration_samlConfiguration_AssertionAttributes = new Amazon.ManagedGrafana.Model.AssertionAttributes();
            System.String requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Email = null;
            if (cmdletContext.AssertionAttributes_Email != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Email = cmdletContext.AssertionAttributes_Email;
            }
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Email != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes.Email = requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Email;
                requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull = false;
            }
            System.String requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Group = null;
            if (cmdletContext.AssertionAttributes_Group != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Group = cmdletContext.AssertionAttributes_Group;
            }
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Group != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes.Groups = requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Group;
                requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull  = false;
            }
            System.String requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Login = null;
            if (cmdletContext.AssertionAttributes_Login != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Login = cmdletContext.AssertionAttributes_Login;
            }
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Login != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes.Login = requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Login;
                requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull = false;
            }
            System.String requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Name = null;
            if (cmdletContext.AssertionAttributes_Name != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Name = cmdletContext.AssertionAttributes_Name;
            }
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Name != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes.Name  = requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Name;
                requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull = false;
            }
            System.String requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Org = null;
            if (cmdletContext.AssertionAttributes_Org != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Org = cmdletContext.AssertionAttributes_Org;
            }
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Org != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes.Org   = requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Org;
                requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull = false;
            }
            System.String requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Role = null;
            if (cmdletContext.AssertionAttributes_Role != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Role = cmdletContext.AssertionAttributes_Role;
            }
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Role != null)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes.Role  = requestSamlConfiguration_samlConfiguration_AssertionAttributes_assertionAttributes_Role;
                requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull = false;
            }
            // determine if requestSamlConfiguration_samlConfiguration_AssertionAttributes should be set to null
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributesIsNull)
            {
                requestSamlConfiguration_samlConfiguration_AssertionAttributes = null;
            }
            if (requestSamlConfiguration_samlConfiguration_AssertionAttributes != null)
            {
                request.SamlConfiguration.AssertionAttributes = requestSamlConfiguration_samlConfiguration_AssertionAttributes;
                requestSamlConfigurationIsNull = false;
            }
            // determine if request.SamlConfiguration should be set to null
            if (requestSamlConfigurationIsNull)
            {
                request.SamlConfiguration = null;
            }
            if (cmdletContext.WorkspaceId != null)
            {
                request.WorkspaceId = cmdletContext.WorkspaceId;
            }

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