Exemplo n.º 1
0
 /// <summary>Snippet for List</summary>
 public void List()
 {
     // Snippet: List(string, string, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string project = "";
     string region  = "";
     // Make the request
     DiskList response = regionDisksClient.List(project, region);
     // End snippet
 }
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, Disk, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string project      = "";
     string region       = "";
     Disk   diskResource = new Disk();
     // Make the request
     Operation response = regionDisksClient.Insert(project, region, diskResource);
     // End snippet
 }
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, string, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string project = "";
     string region  = "";
     string disk    = "";
     // Make the request
     Operation response = regionDisksClient.Delete(project, region, disk);
     // End snippet
 }
 /// <summary>Snippet for GetIamPolicy</summary>
 public void GetIamPolicy()
 {
     // Snippet: GetIamPolicy(string, string, string, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     // Make the request
     Policy response = regionDisksClient.GetIamPolicy(project, region, resource);
     // End snippet
 }
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListRegionDisksRequest, CallSettings)
            // Create client
            RegionDisksClient regionDisksClient = RegionDisksClient.Create();
            // Initialize request argument(s)
            ListRegionDisksRequest request = new ListRegionDisksRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <DiskList, Disk> response = regionDisksClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Disk 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 (DiskList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Disk 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 <Disk> 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 (Disk 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
        }
 /// <summary>Snippet for RemoveResourcePolicies</summary>
 public void RemoveResourcePolicies()
 {
     // Snippet: RemoveResourcePolicies(string, string, string, RegionDisksRemoveResourcePoliciesRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string project = "";
     string region  = "";
     string disk    = "";
     RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest();
     // Make the request
     Operation response = regionDisksClient.RemoveResourcePolicies(project, region, disk, regionDisksRemoveResourcePoliciesRequestResource);
     // End snippet
 }
 /// <summary>Snippet for SetLabels</summary>
 public void SetLabels()
 {
     // Snippet: SetLabels(string, string, string, RegionSetLabelsRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest();
     // Make the request
     Operation response = regionDisksClient.SetLabels(project, region, resource, regionSetLabelsRequestResource);
     // End snippet
 }
 /// <summary>Snippet for CreateSnapshot</summary>
 public void CreateSnapshot()
 {
     // Snippet: CreateSnapshot(string, string, string, Snapshot, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string   project          = "";
     string   region           = "";
     string   disk             = "";
     Snapshot snapshotResource = new Snapshot();
     // Make the request
     Operation response = regionDisksClient.CreateSnapshot(project, region, disk, snapshotResource);
     // End snippet
 }
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissions()
 {
     // Snippet: TestIamPermissions(string, string, string, TestPermissionsRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
     // Make the request
     TestPermissionsResponse response = regionDisksClient.TestIamPermissions(project, region, resource, testPermissionsRequestResource);
     // End snippet
 }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     GetRegionDiskRequest request = new GetRegionDiskRequest
     {
         Disk    = "",
         Region  = "",
         Project = "",
     };
     // Make the request
     Disk response = regionDisksClient.Get(request);
     // End snippet
 }
 /// <summary>Snippet for GetIamPolicy</summary>
 public void GetIamPolicyRequestObject()
 {
     // Snippet: GetIamPolicy(GetIamPolicyRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest
     {
         Region   = "",
         Resource = "",
         Project  = "",
         OptionsRequestedPolicyVersion = 0,
     };
     // Make the request
     Policy response = regionDisksClient.GetIamPolicy(request);
     // End snippet
 }
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     DeleteRegionDiskRequest request = new DeleteRegionDiskRequest
     {
         Disk      = "",
         RequestId = "",
         Region    = "",
         Project   = "",
     };
     // Make the request
     Operation response = regionDisksClient.Delete(request);
     // End snippet
 }
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissionsRequestObject()
 {
     // Snippet: TestIamPermissions(TestIamPermissionsRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     TestIamPermissionsRegionDiskRequest request = new TestIamPermissionsRegionDiskRequest
     {
         Region   = "",
         Resource = "",
         Project  = "",
         TestPermissionsRequestResource = new TestPermissionsRequest(),
     };
     // Make the request
     TestPermissionsResponse response = regionDisksClient.TestIamPermissions(request);
     // End snippet
 }
 /// <summary>Snippet for SetIamPolicy</summary>
 public void SetIamPolicyRequestObject()
 {
     // Snippet: SetIamPolicy(SetIamPolicyRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest
     {
         Region   = "",
         Resource = "",
         Project  = "",
         RegionSetPolicyRequestResource = new RegionSetPolicyRequest(),
     };
     // Make the request
     Policy response = regionDisksClient.SetIamPolicy(request);
     // End snippet
 }
Exemplo n.º 15
0
 /// <summary>Snippet for CreateSnapshot</summary>
 public void CreateSnapshotRequestObject()
 {
     // Snippet: CreateSnapshot(CreateSnapshotRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     CreateSnapshotRegionDiskRequest request = new CreateSnapshotRegionDiskRequest
     {
         Disk             = "",
         RequestId        = "",
         Region           = "",
         SnapshotResource = new Snapshot(),
         Project          = "",
     };
     // Make the request
     Operation response = regionDisksClient.CreateSnapshot(request);
     // End snippet
 }
 /// <summary>Snippet for Resize</summary>
 public void ResizeRequestObject()
 {
     // Snippet: Resize(ResizeRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     ResizeRegionDiskRequest request = new ResizeRegionDiskRequest
     {
         Disk      = "",
         RequestId = "",
         Region    = "",
         Project   = "",
         RegionDisksResizeRequestResource = new RegionDisksResizeRequest(),
     };
     // Make the request
     Operation response = regionDisksClient.Resize(request);
     // End snippet
 }
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertRegionDiskRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     InsertRegionDiskRequest request = new InsertRegionDiskRequest
     {
         DiskResource = new Disk(),
         RequestId    = "",
         SourceImage  = "",
         Region       = "",
         Project      = "",
     };
     // Make the request
     Operation response = regionDisksClient.Insert(request);
     // End snippet
 }
Exemplo n.º 18
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListRegionDisksRequest, CallSettings)
     // Create client
     RegionDisksClient regionDisksClient = RegionDisksClient.Create();
     // Initialize request argument(s)
     ListRegionDisksRequest request = new ListRegionDisksRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Region               = "",
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     DiskList response = regionDisksClient.List(request);
     // End snippet
 }