Пример #1
0
        /// <summary>Snippet for Insert</summary>
        public void Insert()
        {
            // Snippet: Insert(string, License, CallSettings)
            // Create client
            LicensesClient licensesClient = LicensesClient.Create();
            // Initialize request argument(s)
            string  project         = "";
            License licenseResource = new License();
            // Make the request
            lro::Operation <Operation, Operation> response = licensesClient.Insert(project, licenseResource);

            // 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 = licensesClient.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
        }
Пример #2
0
        /// <summary>Snippet for Delete</summary>
        public void DeleteRequestObject()
        {
            // Snippet: Delete(DeleteLicenseRequest, CallSettings)
            // Create client
            LicensesClient licensesClient = LicensesClient.Create();
            // Initialize request argument(s)
            DeleteLicenseRequest request = new DeleteLicenseRequest
            {
                RequestId = "",
                License   = "",
                Project   = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = licensesClient.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 = licensesClient.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
        }
Пример #3
0
 /// <summary>Snippet for List</summary>
 public void List()
 {
     // Snippet: List(string, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     LicensesListResponse response = licensesClient.List(project);
     // End snippet
 }
Пример #4
0
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     string project = "";
     string license = "";
     // Make the request
     Operation response = licensesClient.Delete(project, license);
     // End snippet
 }
Пример #5
0
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, License, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     string  project         = "";
     License licenseResource = new License();
     // Make the request
     Operation response = licensesClient.Insert(project, licenseResource);
     // End snippet
 }
Пример #6
0
 /// <summary>Snippet for GetIamPolicy</summary>
 public void GetIamPolicy()
 {
     // Snippet: GetIamPolicy(string, string, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string resource = "";
     // Make the request
     Policy response = licensesClient.GetIamPolicy(project, resource);
     // End snippet
 }
Пример #7
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissions()
 {
     // Snippet: TestIamPermissions(string, string, TestPermissionsRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string resource = "";
     TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
     // Make the request
     TestPermissionsResponse response = licensesClient.TestIamPermissions(project, resource, testPermissionsRequestResource);
     // End snippet
 }
Пример #8
0
 /// <summary>Snippet for SetIamPolicy</summary>
 public void SetIamPolicy()
 {
     // Snippet: SetIamPolicy(string, string, GlobalSetPolicyRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string resource = "";
     GlobalSetPolicyRequest globalSetPolicyRequestResource = new GlobalSetPolicyRequest();
     // Make the request
     Policy response = licensesClient.SetIamPolicy(project, resource, globalSetPolicyRequestResource);
     // End snippet
 }
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListLicensesRequest, CallSettings)
            // Create client
            LicensesClient licensesClient = LicensesClient.Create();
            // Initialize request argument(s)
            ListLicensesRequest request = new ListLicensesRequest
            {
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <LicensesListResponse, License> response = licensesClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (License 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 (LicensesListResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (License 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 <License> 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 (License 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
        }
Пример #10
0
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetLicenseRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     GetLicenseRequest request = new GetLicenseRequest
     {
         License = "",
         Project = "",
     };
     // Make the request
     License response = licensesClient.Get(request);
     // End snippet
 }
Пример #11
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissionsRequestObject()
 {
     // Snippet: TestIamPermissions(TestIamPermissionsLicenseRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     TestIamPermissionsLicenseRequest request = new TestIamPermissionsLicenseRequest
     {
         Resource = "",
         Project  = "",
         TestPermissionsRequestResource = new TestPermissionsRequest(),
     };
     // Make the request
     TestPermissionsResponse response = licensesClient.TestIamPermissions(request);
     // End snippet
 }
Пример #12
0
 /// <summary>Snippet for SetIamPolicy</summary>
 public void SetIamPolicyRequestObject()
 {
     // Snippet: SetIamPolicy(SetIamPolicyLicenseRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     SetIamPolicyLicenseRequest request = new SetIamPolicyLicenseRequest
     {
         Resource = "",
         Project  = "",
         GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(),
     };
     // Make the request
     Policy response = licensesClient.SetIamPolicy(request);
     // End snippet
 }
Пример #13
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteLicenseRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     DeleteLicenseRequest request = new DeleteLicenseRequest
     {
         RequestId = "",
         License   = "",
         Project   = "",
     };
     // Make the request
     Operation response = licensesClient.Delete(request);
     // End snippet
 }
Пример #14
0
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertLicenseRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     InsertLicenseRequest request = new InsertLicenseRequest
     {
         RequestId       = "",
         Project         = "",
         LicenseResource = new License(),
     };
     // Make the request
     Operation response = licensesClient.Insert(request);
     // End snippet
 }
Пример #15
0
 /// <summary>Snippet for GetIamPolicy</summary>
 public void GetIamPolicyRequestObject()
 {
     // Snippet: GetIamPolicy(GetIamPolicyLicenseRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     GetIamPolicyLicenseRequest request = new GetIamPolicyLicenseRequest
     {
         Resource = "",
         Project  = "",
         OptionsRequestedPolicyVersion = 0,
     };
     // Make the request
     Policy response = licensesClient.GetIamPolicy(request);
     // End snippet
 }
Пример #16
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListLicensesRequest, CallSettings)
     // Create client
     LicensesClient licensesClient = LicensesClient.Create();
     // Initialize request argument(s)
     ListLicensesRequest request = new ListLicensesRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     LicensesListResponse response = licensesClient.List(request);
     // End snippet
 }