/// <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);
        }
Exemplo n.º 2
0
        /// <summary>Snippet for RunReportAsync</summary>
        public async Task RunReportRequestObjectAsync()
        {
            // Snippet: RunReportAsync(RunReportRequest, CallSettings)
            // Additional: RunReportAsync(RunReportRequest, CancellationToken)
            // Create client
            AlphaAnalyticsDataClient alphaAnalyticsDataClient = await AlphaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            RunReportRequest request = new RunReportRequest
            {
                Entity             = new Entity(),
                Dimensions         = { new Dimension(), },
                Metrics            = { new Metric(), },
                DateRanges         = { new DateRange(), },
                Offset             = 0L,
                Limit              = 0L,
                MetricAggregations =
                {
                    MetricAggregation.Unspecified,
                },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                OrderBys            = { new OrderBy(), },
                CurrencyCode        = "",
                CohortSpec          = new CohortSpec(),
                KeepEmptyRows       = false,
                ReturnPropertyQuota = false,
            };
            // Make the request
            RunReportResponse response = await alphaAnalyticsDataClient.RunReportAsync(request);

            // End snippet
        }
 /// <summary>Snippet for RunReport</summary>
 public void RunReport_RequestObject()
 {
     // Snippet: RunReport(RunReportRequest,CallSettings)
     // Create client
     AlphaAnalyticsDataClient alphaAnalyticsDataClient = AlphaAnalyticsDataClient.Create();
     // Initialize request argument(s)
     RunReportRequest request = new RunReportRequest();
     // Make the request
     RunReportResponse response = alphaAnalyticsDataClient.RunReport(request);
     // End snippet
 }
        /// <summary>Snippet for RunReportAsync</summary>
        public async Task RunReportAsync_RequestObject()
        {
            // Snippet: RunReportAsync(RunReportRequest,CallSettings)
            // Additional: RunReportAsync(RunReportRequest,CancellationToken)
            // Create client
            AlphaAnalyticsDataClient alphaAnalyticsDataClient = await AlphaAnalyticsDataClient.CreateAsync();

            // Initialize request argument(s)
            RunReportRequest request = new RunReportRequest();
            // Make the request
            RunReportResponse response = await alphaAnalyticsDataClient.RunReportAsync(request);

            // End snippet
        }
        public async stt::Task RunReportRequestObjectAsync()
        {
            moq::Mock <BetaAnalyticsData.BetaAnalyticsDataClient> mockGrpcClient = new moq::Mock <BetaAnalyticsData.BetaAnalyticsDataClient>(moq::MockBehavior.Strict);
            RunReportRequest request = new RunReportRequest
            {
                Property           = "propertyc9b48d1a",
                Dimensions         = { new Dimension(), },
                Metrics            = { new Metric(), },
                DateRanges         = { new DateRange(), },
                DimensionFilter    = new FilterExpression(),
                MetricFilter       = new FilterExpression(),
                Offset             = -4389998161825790342L,
                Limit              = 7494001492025909162L,
                MetricAggregations =
                {
                    MetricAggregation.Minimum,
                },
                OrderBys            = { new OrderBy(), },
                CurrencyCode        = "currency_code7f81e352",
                CohortSpec          = new CohortSpec(),
                KeepEmptyRows       = true,
                ReturnPropertyQuota = true,
            };
            RunReportResponse expectedResponse = new RunReportResponse
            {
                DimensionHeaders =
                {
                    new DimensionHeader(),
                },
                MetricHeaders = { new MetricHeader(), },
                Rows          = { new Row(), },
                Totals        = { new Row(), },
                Maximums      = { new Row(), },
                Minimums      = { new Row(), },
                RowCount      = 743251772,
                Metadata      = new ResponseMetaData(),
                PropertyQuota = new PropertyQuota(),
                Kind          = "kindf7aa39d9",
            };

            mockGrpcClient.Setup(x => x.RunReportAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <RunReportResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            BetaAnalyticsDataClient client = new BetaAnalyticsDataClientImpl(mockGrpcClient.Object, null);
            RunReportResponse       responseCallSettings = await client.RunReportAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            RunReportResponse responseCancellationToken = await client.RunReportAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public async Task RunReportAsync()
        {
            Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(MockBehavior.Strict);
            RunReportRequest  request          = new RunReportRequest();
            RunReportResponse expectedResponse = new RunReportResponse();

            mockGrpcClient.Setup(x => x.RunReportAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <RunReportResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            AlphaAnalyticsDataClient client   = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null);
            RunReportResponse        response = await client.RunReportAsync(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void RunReport()
        {
            Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(MockBehavior.Strict);
            RunReportRequest  request          = new RunReportRequest();
            RunReportResponse expectedResponse = new RunReportResponse();

            mockGrpcClient.Setup(x => x.RunReport(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            AlphaAnalyticsDataClient client   = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null);
            RunReportResponse        response = client.RunReport(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void RunReportRequestObject()
        {
            moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict);
            RunReportRequest request = new RunReportRequest
            {
                Entity             = new Entity(),
                Dimensions         = { new Dimension(), },
                Metrics            = { new Metric(), },
                DateRanges         = { new DateRange(), },
                Offset             = -4389998161825790342L,
                Limit              = 7494001492025909162L,
                MetricAggregations =
                {
                    MetricAggregation.Minimum,
                },
                DimensionFilter     = new FilterExpression(),
                MetricFilter        = new FilterExpression(),
                OrderBys            = { new OrderBy(), },
                CurrencyCode        = "currency_code7f81e352",
                CohortSpec          = new CohortSpec(),
                KeepEmptyRows       = true,
                ReturnPropertyQuota = true,
            };
            RunReportResponse expectedResponse = new RunReportResponse
            {
                MetricHeaders    = { new MetricHeader(), },
                Rows             = { new Row(), },
                Metadata         = new ResponseMetaData(),
                PropertyQuota    = new PropertyQuota(),
                Totals           = { new Row(), },
                Maximums         = { new Row(), },
                Minimums         = { new Row(), },
                DimensionHeaders =
                {
                    new DimensionHeader(),
                },
                RowCount = 743251772,
            };

            mockGrpcClient.Setup(x => x.RunReport(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AlphaAnalyticsDataClient client   = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null);
            RunReportResponse        response = client.RunReport(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }