/// <summary>Snippet for Insert</summary>
        public void Insert()
        {
            // Snippet: Insert(string, string, ResourcePolicy, CallSettings)
            // Create client
            ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
            // Initialize request argument(s)
            string         project = "";
            string         region  = "";
            ResourcePolicy resourcePolicyResource = new ResourcePolicy();
            // Make the request
            lro::Operation <Operation, Operation> response = resourcePoliciesClient.Insert(project, region, resourcePolicyResource);

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

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for Delete</summary>
        public void DeleteRequestObject()
        {
            // Snippet: Delete(DeleteResourcePolicyRequest, CallSettings)
            // Create client
            ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
            // Initialize request argument(s)
            DeleteResourcePolicyRequest request = new DeleteResourcePolicyRequest
            {
                RequestId      = "",
                Region         = "",
                ResourcePolicy = "",
                Project        = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = resourcePoliciesClient.Delete(request);

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

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Ejemplo n.º 3
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     ResourcePolicyAggregatedList response = resourcePoliciesClient.AggregatedList(project);
     // End snippet
 }
Ejemplo n.º 4
0
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, ResourcePolicy, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     string         project = "";
     string         region  = "";
     ResourcePolicy resourcePolicyResource = new ResourcePolicy();
     // Make the request
     Operation response = resourcePoliciesClient.Insert(project, region, resourcePolicyResource);
     // End snippet
 }
Ejemplo n.º 5
0
 /// <summary>Snippet for GetIamPolicy</summary>
 public void GetIamPolicy()
 {
     // Snippet: GetIamPolicy(string, string, string, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     // Make the request
     Policy response = resourcePoliciesClient.GetIamPolicy(project, region, resource);
     // End snippet
 }
Ejemplo n.º 6
0
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, string, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     string project        = "";
     string region         = "";
     string resourcePolicy = "";
     // Make the request
     Operation response = resourcePoliciesClient.Delete(project, region, resourcePolicy);
     // End snippet
 }
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListResourcePoliciesRequest, CallSettings)
            // Create client
            ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
            // Initialize request argument(s)
            ListResourcePoliciesRequest request = new ListResourcePoliciesRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <ResourcePolicyList, ResourcePolicy> response = resourcePoliciesClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (ResourcePolicy item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ResourcePolicyList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (ResourcePolicy 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 <ResourcePolicy> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (ResourcePolicy 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
        }
Ejemplo n.º 8
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissions()
 {
     // Snippet: TestIamPermissions(string, string, string, TestPermissionsRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
     // Make the request
     TestPermissionsResponse response = resourcePoliciesClient.TestIamPermissions(project, region, resource, testPermissionsRequestResource);
     // End snippet
 }
Ejemplo n.º 9
0
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetResourcePolicyRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     GetResourcePolicyRequest request = new GetResourcePolicyRequest
     {
         Region         = "",
         ResourcePolicy = "",
         Project        = "",
     };
     // Make the request
     ResourcePolicy response = resourcePoliciesClient.Get(request);
     // End snippet
 }
Ejemplo n.º 10
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissionsRequestObject()
 {
     // Snippet: TestIamPermissions(TestIamPermissionsResourcePolicyRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     TestIamPermissionsResourcePolicyRequest request = new TestIamPermissionsResourcePolicyRequest
     {
         Region = "",
         TestPermissionsRequestResource = new TestPermissionsRequest(),
         Resource = "",
         Project  = "",
     };
     // Make the request
     TestPermissionsResponse response = resourcePoliciesClient.TestIamPermissions(request);
     // End snippet
 }
Ejemplo n.º 11
0
 /// <summary>Snippet for SetIamPolicy</summary>
 public void SetIamPolicyRequestObject()
 {
     // Snippet: SetIamPolicy(SetIamPolicyResourcePolicyRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     SetIamPolicyResourcePolicyRequest request = new SetIamPolicyResourcePolicyRequest
     {
         RegionSetPolicyRequestResource = new RegionSetPolicyRequest(),
         Region   = "",
         Resource = "",
         Project  = "",
     };
     // Make the request
     Policy response = resourcePoliciesClient.SetIamPolicy(request);
     // End snippet
 }
Ejemplo n.º 12
0
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertResourcePolicyRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     InsertResourcePolicyRequest request = new InsertResourcePolicyRequest
     {
         RequestId = "",
         ResourcePolicyResource = new ResourcePolicy(),
         Region  = "",
         Project = "",
     };
     // Make the request
     Operation response = resourcePoliciesClient.Insert(request);
     // End snippet
 }
Ejemplo n.º 13
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteResourcePolicyRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     DeleteResourcePolicyRequest request = new DeleteResourcePolicyRequest
     {
         RequestId      = "",
         Region         = "",
         ResourcePolicy = "",
         Project        = "",
     };
     // Make the request
     Operation response = resourcePoliciesClient.Delete(request);
     // End snippet
 }
        /// <summary>Snippet for AggregatedList</summary>
        public void AggregatedList()
        {
            // Snippet: AggregatedList(string, string, int?, CallSettings)
            // Create client
            ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedEnumerable <ResourcePolicyAggregatedList, KeyValuePair <string, ResourcePoliciesScopedList> > response = resourcePoliciesClient.AggregatedList(project);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair <string, ResourcePoliciesScopedList> item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ResourcePolicyAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, ResourcePoliciesScopedList> 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 <KeyValuePair <string, ResourcePoliciesScopedList> > singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (KeyValuePair <string, ResourcePoliciesScopedList> 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
        }
Ejemplo n.º 15
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListResourcePoliciesRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     ListResourcePoliciesRequest request = new ListResourcePoliciesRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Filter               = "",
         Region               = "",
         OrderBy              = "",
         Project              = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     ResourcePolicyList response = resourcePoliciesClient.List(request);
     // End snippet
 }
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedListRequestObject()
 {
     // Snippet: AggregatedList(AggregatedListResourcePoliciesRequest, CallSettings)
     // Create client
     ResourcePoliciesClient resourcePoliciesClient = ResourcePoliciesClient.Create();
     // Initialize request argument(s)
     AggregatedListResourcePoliciesRequest request = new AggregatedListResourcePoliciesRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         IncludeAllScopes     = false,
         ReturnPartialSuccess = false,
     };
     // Make the request
     ResourcePolicyAggregatedList response = resourcePoliciesClient.AggregatedList(request);
     // End snippet
 }