Example #1
0
 private Amazon.QuickSight.Model.GenerateEmbedUrlForRegisteredUserResponse CallAWSServiceOperation(IAmazonQuickSight client, Amazon.QuickSight.Model.GenerateEmbedUrlForRegisteredUserRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon QuickSight", "GenerateEmbedUrlForRegisteredUser");
     try
     {
         #if DESKTOP
         return(client.GenerateEmbedUrlForRegisteredUser(request));
         #elif CORECLR
         return(client.GenerateEmbedUrlForRegisteredUserAsync(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;
     }
 }
Example #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.QuickSight.Model.GenerateEmbedUrlForRegisteredUserRequest();

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

            // populate ExperienceConfiguration
            var requestExperienceConfigurationIsNull = true;

            request.ExperienceConfiguration = new Amazon.QuickSight.Model.RegisteredUserEmbeddingExperienceConfiguration();
            Amazon.QuickSight.Model.RegisteredUserDashboardEmbeddingConfiguration requestExperienceConfiguration_experienceConfiguration_Dashboard = null;

            // populate Dashboard
            var requestExperienceConfiguration_experienceConfiguration_DashboardIsNull = true;

            requestExperienceConfiguration_experienceConfiguration_Dashboard = new Amazon.QuickSight.Model.RegisteredUserDashboardEmbeddingConfiguration();
            System.String requestExperienceConfiguration_experienceConfiguration_Dashboard_dashboard_InitialDashboardId = null;
            if (cmdletContext.Dashboard_InitialDashboardId != null)
            {
                requestExperienceConfiguration_experienceConfiguration_Dashboard_dashboard_InitialDashboardId = cmdletContext.Dashboard_InitialDashboardId;
            }
            if (requestExperienceConfiguration_experienceConfiguration_Dashboard_dashboard_InitialDashboardId != null)
            {
                requestExperienceConfiguration_experienceConfiguration_Dashboard.InitialDashboardId = requestExperienceConfiguration_experienceConfiguration_Dashboard_dashboard_InitialDashboardId;
                requestExperienceConfiguration_experienceConfiguration_DashboardIsNull = false;
            }
            // determine if requestExperienceConfiguration_experienceConfiguration_Dashboard should be set to null
            if (requestExperienceConfiguration_experienceConfiguration_DashboardIsNull)
            {
                requestExperienceConfiguration_experienceConfiguration_Dashboard = null;
            }
            if (requestExperienceConfiguration_experienceConfiguration_Dashboard != null)
            {
                request.ExperienceConfiguration.Dashboard = requestExperienceConfiguration_experienceConfiguration_Dashboard;
                requestExperienceConfigurationIsNull      = false;
            }
            Amazon.QuickSight.Model.RegisteredUserQSearchBarEmbeddingConfiguration requestExperienceConfiguration_experienceConfiguration_QSearchBar = null;

            // populate QSearchBar
            var requestExperienceConfiguration_experienceConfiguration_QSearchBarIsNull = true;

            requestExperienceConfiguration_experienceConfiguration_QSearchBar = new Amazon.QuickSight.Model.RegisteredUserQSearchBarEmbeddingConfiguration();
            System.String requestExperienceConfiguration_experienceConfiguration_QSearchBar_qSearchBar_InitialTopicId = null;
            if (cmdletContext.QSearchBar_InitialTopicId != null)
            {
                requestExperienceConfiguration_experienceConfiguration_QSearchBar_qSearchBar_InitialTopicId = cmdletContext.QSearchBar_InitialTopicId;
            }
            if (requestExperienceConfiguration_experienceConfiguration_QSearchBar_qSearchBar_InitialTopicId != null)
            {
                requestExperienceConfiguration_experienceConfiguration_QSearchBar.InitialTopicId = requestExperienceConfiguration_experienceConfiguration_QSearchBar_qSearchBar_InitialTopicId;
                requestExperienceConfiguration_experienceConfiguration_QSearchBarIsNull          = false;
            }
            // determine if requestExperienceConfiguration_experienceConfiguration_QSearchBar should be set to null
            if (requestExperienceConfiguration_experienceConfiguration_QSearchBarIsNull)
            {
                requestExperienceConfiguration_experienceConfiguration_QSearchBar = null;
            }
            if (requestExperienceConfiguration_experienceConfiguration_QSearchBar != null)
            {
                request.ExperienceConfiguration.QSearchBar = requestExperienceConfiguration_experienceConfiguration_QSearchBar;
                requestExperienceConfigurationIsNull       = false;
            }
            Amazon.QuickSight.Model.RegisteredUserQuickSightConsoleEmbeddingConfiguration requestExperienceConfiguration_experienceConfiguration_QuickSightConsole = null;

            // populate QuickSightConsole
            var requestExperienceConfiguration_experienceConfiguration_QuickSightConsoleIsNull = true;

            requestExperienceConfiguration_experienceConfiguration_QuickSightConsole = new Amazon.QuickSight.Model.RegisteredUserQuickSightConsoleEmbeddingConfiguration();
            System.String requestExperienceConfiguration_experienceConfiguration_QuickSightConsole_quickSightConsole_InitialPath = null;
            if (cmdletContext.QuickSightConsole_InitialPath != null)
            {
                requestExperienceConfiguration_experienceConfiguration_QuickSightConsole_quickSightConsole_InitialPath = cmdletContext.QuickSightConsole_InitialPath;
            }
            if (requestExperienceConfiguration_experienceConfiguration_QuickSightConsole_quickSightConsole_InitialPath != null)
            {
                requestExperienceConfiguration_experienceConfiguration_QuickSightConsole.InitialPath = requestExperienceConfiguration_experienceConfiguration_QuickSightConsole_quickSightConsole_InitialPath;
                requestExperienceConfiguration_experienceConfiguration_QuickSightConsoleIsNull       = false;
            }
            // determine if requestExperienceConfiguration_experienceConfiguration_QuickSightConsole should be set to null
            if (requestExperienceConfiguration_experienceConfiguration_QuickSightConsoleIsNull)
            {
                requestExperienceConfiguration_experienceConfiguration_QuickSightConsole = null;
            }
            if (requestExperienceConfiguration_experienceConfiguration_QuickSightConsole != null)
            {
                request.ExperienceConfiguration.QuickSightConsole = requestExperienceConfiguration_experienceConfiguration_QuickSightConsole;
                requestExperienceConfigurationIsNull = false;
            }
            // determine if request.ExperienceConfiguration should be set to null
            if (requestExperienceConfigurationIsNull)
            {
                request.ExperienceConfiguration = null;
            }
            if (cmdletContext.SessionLifetimeInMinute != null)
            {
                request.SessionLifetimeInMinutes = cmdletContext.SessionLifetimeInMinute.Value;
            }
            if (cmdletContext.UserArn != null)
            {
                request.UserArn = cmdletContext.UserArn;
            }

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