Ejemplo n.º 1
0
        /// <summary>Snippet for AnalyzeIamPolicyLongrunning</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void AnalyzeIamPolicyLongrunningRequestObject()
        {
            // Create client
            AssetServiceClient assetServiceClient = AssetServiceClient.Create();
            // Initialize request argument(s)
            AnalyzeIamPolicyLongrunningRequest request = new AnalyzeIamPolicyLongrunningRequest
            {
                AnalysisQuery = new IamPolicyAnalysisQuery(),
                OutputConfig  = new IamPolicyAnalysisOutputConfig(),
            };
            // Make the request
            Operation <AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest> response = assetServiceClient.AnalyzeIamPolicyLongrunning(request);

            // Poll until the returned long-running operation is complete
            Operation <AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            AnalyzeIamPolicyLongrunningResponse 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 <AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest> retrievedResponse = assetServiceClient.PollOnceAnalyzeIamPolicyLongrunning(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnalyzeIamPolicyLongrunningResponse retrievedResult = retrievedResponse.Result;
            }
        }
Ejemplo n.º 2
0
        /// <summary>Snippet for AnalyzeIamPolicyLongrunningAsync</summary>
        public async Task AnalyzeIamPolicyLongrunningRequestObjectAsync()
        {
            // Snippet: AnalyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest, CallSettings)
            // Additional: AnalyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest, CancellationToken)
            // Create client
            AssetServiceClient assetServiceClient = await AssetServiceClient.CreateAsync();

            // Initialize request argument(s)
            AnalyzeIamPolicyLongrunningRequest request = new AnalyzeIamPolicyLongrunningRequest
            {
                AnalysisQuery = new IamPolicyAnalysisQuery(),
                OutputConfig  = new IamPolicyAnalysisOutputConfig(),
            };
            // Make the request
            Operation <AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest> response = await assetServiceClient.AnalyzeIamPolicyLongrunningAsync(request);

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

            // Retrieve the operation result
            AnalyzeIamPolicyLongrunningResponse 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 <AnalyzeIamPolicyLongrunningResponse, AnalyzeIamPolicyLongrunningRequest> retrievedResponse = await assetServiceClient.PollOnceAnalyzeIamPolicyLongrunningAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AnalyzeIamPolicyLongrunningResponse retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Ejemplo n.º 3
0
    public void TestAnalyzeIamPolicyLongrunningGcs()
    {
        // Run the sample code.
        string scope            = $"projects/{_fixture.ProjectId}";
        string fullResourceName =
            $"//cloudresourcemanager.googleapis.com/projects/{_fixture.ProjectId}";
        string uri = $"gs://{_fixture.BucketName}/my-analysis.json";

        AnalyzeIamPolicyLongrunningResponse result =
            _sample.AnalyzeIamPolicyLongrunning(scope, fullResourceName, uri);

        Assert.NotNull(result);
    }
    public void TestAnalyzeIamPolicyLongrunningBigquery()
    {
        // Run the sample code.
        string scope            = $"projects/{_fixture.ProjectId}";
        string fullResourceName =
            $"//cloudresourcemanager.googleapis.com/projects/{_fixture.ProjectId}";
        string dataset =
            $"projects/{_fixture.ProjectId}/datasets/{_fixture.DatasetId}";
        string tablePrefix = "client_library_table";

        AnalyzeIamPolicyLongrunningResponse result =
            _sample.AnalyzeIamPolicyLongrunning(scope, fullResourceName, dataset, tablePrefix);

        Assert.NotNull(result);
    }