/// <summary>Snippet for Get</summary> public void Get() { // Snippet: Get(string, string, string, CallSettings) // Create client RegionOperationsClient regionOperationsClient = RegionOperationsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string operation = ""; // Make the request Operation response = regionOperationsClient.Get(project, region, operation); // End snippet }
/// <summary>Snippet for Get</summary> public void GetRequestObject() { // Snippet: Get(GetRegionOperationRequest, CallSettings) // Create client RegionOperationsClient regionOperationsClient = RegionOperationsClient.Create(); // Initialize request argument(s) GetRegionOperationRequest request = new GetRegionOperationRequest { Operation = "", Region = "", Project = "", }; // Make the request Operation response = regionOperationsClient.Get(request); // End snippet }
private Func <Operation> CreatePoller(Operation operation) { if (operation.HasRegion && !operation.HasZone) { RegionOperationsClient client = RegionOperationsClient.Create(); GetRegionOperationRequest request = new GetRegionOperationRequest { Operation = operation.Name, Region = Region, Project = ProjectId, }; return(() => client.Get(request)); } else if (operation.HasZone && !operation.HasRegion) { ZoneOperationsClient client = ZoneOperationsClient.Create(); GetZoneOperationRequest request = new GetZoneOperationRequest { Operation = operation.Name, Zone = Zone, Project = ProjectId, }; return(() => client.Get(request)); } else if (!operation.HasZone && !operation.HasRegion) { GlobalOperationsClient client = GlobalOperationsClient.Create(); GetGlobalOperationRequest request = new GetGlobalOperationRequest { Operation = operation.Name, Project = ProjectId, }; return(() => client.Get(request)); } throw new ArgumentException($"Unable to determine operation type for {operation}"); }