Beispiel #1
0
        /// <summary>Snippet for AnalyzeDataSourceRiskAsync</summary>
        public async Task AnalyzeDataSourceRiskAsync()
        {
            // Snippet: AnalyzeDataSourceRiskAsync(PrivacyMetric,BigQueryTable,CallSettings)
            // Additional: AnalyzeDataSourceRiskAsync(PrivacyMetric,BigQueryTable,CancellationToken)
            // Create client
            DlpServiceClient dlpServiceClient = await DlpServiceClient.CreateAsync();

            // Initialize request argument(s)
            PrivacyMetric privacyMetric = new PrivacyMetric();
            BigQueryTable sourceTable   = new BigQueryTable();
            // Make the request
            Operation <RiskAnalysisOperationResult, RiskAnalysisOperationMetadata> response =
                await dlpServiceClient.AnalyzeDataSourceRiskAsync(privacyMetric, sourceTable);

            // Poll until the returned long-running operation is complete
            Operation <RiskAnalysisOperationResult, RiskAnalysisOperationMetadata> completedResponse =
                await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            RiskAnalysisOperationResult result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <RiskAnalysisOperationResult, RiskAnalysisOperationMetadata> retrievedResponse =
                await dlpServiceClient.PollOnceAnalyzeDataSourceRiskAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                RiskAnalysisOperationResult retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }