/// <summary>Snippet for List</summary> public void List() { // Snippet: List(string, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; // Make the request ImageList response = imagesClient.List(project); // End snippet }
public void CorrectRequestForCreate() { var factory = Substitute.For <IConnection>(); var client = new ImagesClient(factory); var body = new Models.Requests.Image(); client.Create(body); factory.Received().ExecuteRequest <Image>("images", null, body, "image", Method.POST); }
/// <summary>Snippet for GetIamPolicy</summary> public void GetIamPolicy() { // Snippet: GetIamPolicy(string, string, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; // Make the request Policy response = imagesClient.GetIamPolicy(project, resource); // End snippet }
/// <summary>Snippet for Delete</summary> public void Delete() { // Snippet: Delete(string, string, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; string image = ""; // Make the request Operation response = imagesClient.Delete(project, image); // End snippet }
/// <summary>Snippet for GetFromFamily</summary> public void GetFromFamily() { // Snippet: GetFromFamily(string, string, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; string family = ""; // Make the request Image response = imagesClient.GetFromFamily(project, family); // End snippet }
/// <summary>Snippet for Insert</summary> public void Insert() { // Snippet: Insert(string, Image, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; Image imageResource = new Image(); // Make the request Operation response = imagesClient.Insert(project, imageResource); // End snippet }
/// <summary>Snippet for TestIamPermissions</summary> public void TestIamPermissions() { // Snippet: TestIamPermissions(string, string, TestPermissionsRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest(); // Make the request TestPermissionsResponse response = imagesClient.TestIamPermissions(project, resource, testPermissionsRequestResource); // End snippet }
/// <summary>Snippet for SetLabels</summary> public void SetLabels() { // Snippet: SetLabels(string, string, GlobalSetLabelsRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request Operation response = imagesClient.SetLabels(project, resource, globalSetLabelsRequestResource); // End snippet }
/// <summary>Snippet for Deprecate</summary> public void Deprecate() { // Snippet: Deprecate(string, string, DeprecationStatus, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) string project = ""; string image = ""; DeprecationStatus deprecationStatusResource = new DeprecationStatus(); // Make the request Operation response = imagesClient.Deprecate(project, image, deprecationStatusResource); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListImagesRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) ListImagesRequest request = new ListImagesRequest { OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request PagedEnumerable <ImageList, Image> response = imagesClient.List(request); // Iterate over all response items, lazily performing RPCs as required foreach (Image 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 (ImageList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Image 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 <Image> 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 (Image 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 GetFromFamily</summary> public void GetFromFamilyRequestObject() { // Snippet: GetFromFamily(GetFromFamilyImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) GetFromFamilyImageRequest request = new GetFromFamilyImageRequest { Project = "", Family = "", }; // Make the request Image response = imagesClient.GetFromFamily(request); // End snippet }
/// <summary>Snippet for TestIamPermissions</summary> public void TestIamPermissionsRequestObject() { // Snippet: TestIamPermissions(TestIamPermissionsImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) TestIamPermissionsImageRequest request = new TestIamPermissionsImageRequest { Resource = "", Project = "", TestPermissionsRequestResource = new TestPermissionsRequest(), }; // Make the request TestPermissionsResponse response = imagesClient.TestIamPermissions(request); // End snippet }
/// <summary>Snippet for SetLabels</summary> public void SetLabelsRequestObject() { // Snippet: SetLabels(SetLabelsImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) SetLabelsImageRequest request = new SetLabelsImageRequest { Resource = "", Project = "", GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request Operation response = imagesClient.SetLabels(request); // End snippet }
/// <summary>Snippet for GetIamPolicy</summary> public void GetIamPolicyRequestObject() { // Snippet: GetIamPolicy(GetIamPolicyImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) GetIamPolicyImageRequest request = new GetIamPolicyImageRequest { Resource = "", Project = "", OptionsRequestedPolicyVersion = 0, }; // Make the request Policy response = imagesClient.GetIamPolicy(request); // End snippet }
/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) DeleteImageRequest request = new DeleteImageRequest { RequestId = "", Image = "", Project = "", }; // Make the request Operation response = imagesClient.Delete(request); // End snippet }
/// <summary>Snippet for SetIamPolicy</summary> public void SetIamPolicyRequestObject() { // Snippet: SetIamPolicy(SetIamPolicyImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) SetIamPolicyImageRequest request = new SetIamPolicyImageRequest { GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(), Resource = "", Project = "", }; // Make the request Policy response = imagesClient.SetIamPolicy(request); // End snippet }
/// <summary>Snippet for Patch</summary> public void PatchRequestObject() { // Snippet: Patch(PatchImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) PatchImageRequest request = new PatchImageRequest { RequestId = "", Image = "", Project = "", ImageResource = new Image(), }; // Make the request Operation response = imagesClient.Patch(request); // End snippet }
/// <summary>Snippet for Insert</summary> public void InsertRequestObject() { // Snippet: Insert(InsertImageRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) InsertImageRequest request = new InsertImageRequest { RequestId = "", ForceCreate = false, Project = "", ImageResource = new Image(), }; // Make the request Operation response = imagesClient.Insert(request); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListImagesRequest, CallSettings) // Create client ImagesClient imagesClient = ImagesClient.Create(); // Initialize request argument(s) ListImagesRequest request = new ListImagesRequest { PageToken = "", MaxResults = 0U, Filter = "", OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request ImageList response = imagesClient.List(request); // End snippet }