Ejemplo n.º 1
0
        /// <summary>Snippet for RunRealtimeReportAsync</summary>
        public async Task RunRealtimeReportRequestObjectAsync()
        {
            // Snippet: RunRealtimeReportAsync(RunRealtimeReportRequest, CallSettings)
            // Additional: RunRealtimeReportAsync(RunRealtimeReportRequest, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            RunRealtimeReportRequest request = new RunRealtimeReportRequest
            {
                Property           = "",
                Dimensions         = { new Dimension(), },
                Metrics            = { new Metric(), },
                DimensionFilter    = new FilterExpression(),
                MetricFilter       = new FilterExpression(),
                Limit              = 0L,
                MetricAggregations =
                {
                    MetricAggregation.Unspecified,
                },
                OrderBys            = { new OrderBy(), },
                ReturnPropertyQuota = false,
                MinuteRanges        = { new MinuteRange(), },
            };
            // Make the request
            RunRealtimeReportResponse response = await betaAnalyticsDataClient.RunRealtimeReportAsync(request);

            // End snippet
        }
        /// <summary>Snippet for RunReportAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task RunReportRequestObjectAsync()
        {
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            RunReportRequest request = new RunReportRequest
            {
                Property           = "",
                Dimensions         = { new Dimension(), },
                Metrics            = { new Metric(), },
                DateRanges         = { new DateRange(), },
                DimensionFilter    = new FilterExpression(),
                MetricFilter       = new FilterExpression(),
                Offset             = 0L,
                Limit              = 0L,
                MetricAggregations =
                {
                    MetricAggregation.Unspecified,
                },
                OrderBys            = { new OrderBy(), },
                CurrencyCode        = "",
                CohortSpec          = new CohortSpec(),
                KeepEmptyRows       = false,
                ReturnPropertyQuota = false,
            };
            // Make the request
            RunReportResponse response = await betaAnalyticsDataClient.RunReportAsync(request);
        }
Ejemplo n.º 3
0
        /// <summary>Snippet for RunPivotReportAsync</summary>
        public async Task RunPivotReportRequestObjectAsync()
        {
            // Snippet: RunPivotReportAsync(RunPivotReportRequest, CallSettings)
            // Additional: RunPivotReportAsync(RunPivotReportRequest, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            RunPivotReportRequest request = new RunPivotReportRequest
            {
                Property            = "",
                Dimensions          = { new Dimension(), },
                Metrics             = { new Metric(), },
                DateRanges          = { new DateRange(), },
                Pivots              = { new Pivot(), },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                CurrencyCode        = "",
                CohortSpec          = new CohortSpec(),
                KeepEmptyRows       = false,
                ReturnPropertyQuota = false,
            };
            // Make the request
            RunPivotReportResponse response = await betaAnalyticsDataClient.RunPivotReportAsync(request);

            // End snippet
        }
Ejemplo n.º 4
0
        /// <summary>Snippet for GetMetadataAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetMetadataAsync()
        {
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            string name = "properties/[PROPERTY]/metadata";
            // Make the request
            Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);
        }
Ejemplo n.º 5
0
        /// <summary>Snippet for GetMetadataAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetMetadataResourceNamesAsync()
        {
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            MetadataName name = MetadataName.FromProperty("[PROPERTY]");
            // Make the request
            Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);
        }
        /// <summary>Snippet for GetMetadataAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetMetadataRequestObjectAsync()
        {
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            GetMetadataRequest request = new GetMetadataRequest
            {
                MetadataName = MetadataName.FromProperty("[PROPERTY]"),
            };
            // Make the request
            Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(request);
        }
Ejemplo n.º 7
0
        /// <summary>Snippet for GetMetadataAsync</summary>
        public async Task GetMetadataResourceNamesAsync()
        {
            // Snippet: GetMetadataAsync(MetadataName, CallSettings)
            // Additional: GetMetadataAsync(MetadataName, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            MetadataName name = MetadataName.FromProperty("[PROPERTY]");
            // Make the request
            Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);

            // End snippet
        }
Ejemplo n.º 8
0
        /// <summary>Snippet for GetMetadataAsync</summary>
        public async Task GetMetadataAsync()
        {
            // Snippet: GetMetadataAsync(string, CallSettings)
            // Additional: GetMetadataAsync(string, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            string name = "properties/[PROPERTY]/metadata";
            // Make the request
            Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(name);

            // End snippet
        }
Ejemplo n.º 9
0
        /// <summary>Snippet for GetMetadataAsync</summary>
        public async Task GetMetadataRequestObjectAsync()
        {
            // Snippet: GetMetadataAsync(GetMetadataRequest, CallSettings)
            // Additional: GetMetadataAsync(GetMetadataRequest, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            GetMetadataRequest request = new GetMetadataRequest
            {
                MetadataName = MetadataName.FromProperty("[PROPERTY]"),
            };
            // Make the request
            Metadata response = await betaAnalyticsDataClient.GetMetadataAsync(request);

            // End snippet
        }
Ejemplo n.º 10
0
        /// <summary>Snippet for BatchRunReportsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task BatchRunReportsRequestObjectAsync()
        {
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            BatchRunReportsRequest request = new BatchRunReportsRequest
            {
                Property = "",
                Requests =
                {
                    new RunReportRequest(),
                },
            };
            // Make the request
            BatchRunReportsResponse response = await betaAnalyticsDataClient.BatchRunReportsAsync(request);
        }
Ejemplo n.º 11
0
        /// <summary>Snippet for BatchRunPivotReportsAsync</summary>
        public async Task BatchRunPivotReportsRequestObjectAsync()
        {
            // Snippet: BatchRunPivotReportsAsync(BatchRunPivotReportsRequest, CallSettings)
            // Additional: BatchRunPivotReportsAsync(BatchRunPivotReportsRequest, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            BatchRunPivotReportsRequest request = new BatchRunPivotReportsRequest
            {
                Property = "",
                Requests =
                {
                    new RunPivotReportRequest(),
                },
            };
            // Make the request
            BatchRunPivotReportsResponse response = await betaAnalyticsDataClient.BatchRunPivotReportsAsync(request);

            // End snippet
        }
Ejemplo n.º 12
0
        /// <summary>Snippet for CheckCompatibilityAsync</summary>
        public async Task CheckCompatibilityRequestObjectAsync()
        {
            // Snippet: CheckCompatibilityAsync(CheckCompatibilityRequest, CallSettings)
            // Additional: CheckCompatibilityAsync(CheckCompatibilityRequest, CancellationToken)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            CheckCompatibilityRequest request = new CheckCompatibilityRequest
            {
                Property            = "",
                Dimensions          = { new Dimension(), },
                Metrics             = { new Metric(), },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                CompatibilityFilter = Compatibility.Unspecified,
            };
            // Make the request
            CheckCompatibilityResponse response = await betaAnalyticsDataClient.CheckCompatibilityAsync(request);

            // End snippet
        }
Ejemplo n.º 13
0
        /// <summary>Snippet for RunReport</summary>
        public async Task RunReportRequestObjectAsync()
        {
            // Snippet: RunReportAsync(RunReportRequest, CallSettings)
            // Create client
            BetaAnalyticsDataClient betaAnalyticsDataClient = await BetaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            RunReportRequest request = new RunReportRequest
            {
                Property           = "",
                Dimensions         = { new Dimension(), },
                Metrics            = { new Metric(), },
                DateRanges         = { new DateRange(), },
                DimensionFilter    = new FilterExpression(),
                MetricFilter       = new FilterExpression(),
                MetricAggregations =
                {
                    MetricAggregation.Unspecified,
                },
                OrderBys            = { new OrderBy(), },
                CurrencyCode        = "",
                CohortSpec          = new CohortSpec(),
                KeepEmptyRows       = false,
                ReturnPropertyQuota = false,
            };
            // Make the request
            PagedAsyncEnumerable <RunReportResponse, DimensionHeader> response = betaAnalyticsDataClient.RunReportAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((DimensionHeader item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((RunReportResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (DimensionHeader item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <DimensionHeader> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (DimensionHeader item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }