public async Task UpdateLogMetricAsync()
        {
            // Snippet: UpdateLogMetricAsync(string,LogMetric,CallSettings)
            // Additional: UpdateLogMetricAsync(string,LogMetric,CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.Create();
            // Initialize request argument(s)
            string    formattedMetricName = MetricsServiceV2Client.FormatMetricName("[PROJECT]", "[METRIC]");
            LogMetric metric = new LogMetric();
            // Make the request
            LogMetric response = await metricsServiceV2Client.UpdateLogMetricAsync(formattedMetricName, metric);

            // End snippet
        }
Beispiel #2
0
        /// <summary>Snippet for UpdateLogMetricAsync</summary>
        public async Task UpdateLogMetricAsync()
        {
            // Snippet: UpdateLogMetricAsync(MetricNameOneof,LogMetric,CallSettings)
            // Additional: UpdateLogMetricAsync(MetricNameOneof,LogMetric,CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            MetricNameOneof metricName = MetricNameOneof.From(new MetricName("[PROJECT]", "[METRIC]"));
            LogMetric       metric     = new LogMetric();
            // Make the request
            LogMetric response = await metricsServiceV2Client.UpdateLogMetricAsync(metricName, metric);

            // End snippet
        }
Beispiel #3
0
        /// <summary>Snippet for UpdateLogMetricAsync</summary>
        public async Task UpdateLogMetricResourceNamesAsync()
        {
            // Snippet: UpdateLogMetricAsync(LogMetricName, LogMetric, CallSettings)
            // Additional: UpdateLogMetricAsync(LogMetricName, LogMetric, CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            LogMetricName metricName = LogMetricName.FromProjectMetric("[PROJECT]", "[METRIC]");
            LogMetric     metric     = new LogMetric();
            // Make the request
            LogMetric response = await metricsServiceV2Client.UpdateLogMetricAsync(metricName, metric);

            // End snippet
        }
Beispiel #4
0
        /// <summary>Snippet for UpdateLogMetricAsync</summary>
        public async Task UpdateLogMetricAsync()
        {
            // Snippet: UpdateLogMetricAsync(string, LogMetric, CallSettings)
            // Additional: UpdateLogMetricAsync(string, LogMetric, CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            string    metricName = "projects/[PROJECT]/metrics/[METRIC]";
            LogMetric metric     = new LogMetric();
            // Make the request
            LogMetric response = await metricsServiceV2Client.UpdateLogMetricAsync(metricName, metric);

            // End snippet
        }
        public async Task UpdateLogMetricAsync_RequestObject()
        {
            // Snippet: UpdateLogMetricAsync(UpdateLogMetricRequest,CallSettings)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            UpdateLogMetricRequest request = new UpdateLogMetricRequest
            {
                MetricNameAsMetricNameOneof = MetricNameOneof.From(new MetricName("[PROJECT]", "[METRIC]")),
                Metric = new LogMetric(),
            };
            // Make the request
            LogMetric response = await metricsServiceV2Client.UpdateLogMetricAsync(request);

            // End snippet
        }
Beispiel #6
0
        /// <summary>Snippet for UpdateLogMetricAsync</summary>
        public async Task UpdateLogMetricRequestObjectAsync()
        {
            // Snippet: UpdateLogMetricAsync(UpdateLogMetricRequest, CallSettings)
            // Additional: UpdateLogMetricAsync(UpdateLogMetricRequest, CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            UpdateLogMetricRequest request = new UpdateLogMetricRequest
            {
                MetricNameAsLogMetricName = LogMetricName.FromProjectMetric("[PROJECT]", "[METRIC]"),
                Metric = new LogMetric(),
            };
            // Make the request
            LogMetric response = await metricsServiceV2Client.UpdateLogMetricAsync(request);

            // End snippet
        }