/// <summary>Snippet for Get</summary> public void Get() { // Snippet: Get(string, string, CallSettings) // Create client InterconnectLocationsClient interconnectLocationsClient = InterconnectLocationsClient.Create(); // Initialize request argument(s) string project = ""; string interconnectLocation = ""; // Make the request InterconnectLocation response = interconnectLocationsClient.Get(project, interconnectLocation); // End snippet }
/// <summary>Snippet for GetAsync</summary> public async Task GetAsync() { // Snippet: GetAsync(string, string, CallSettings) // Additional: GetAsync(string, string, CancellationToken) // Create client InterconnectLocationsClient interconnectLocationsClient = await InterconnectLocationsClient.CreateAsync(); // Initialize request argument(s) string project = ""; string interconnectLocation = ""; // Make the request InterconnectLocation response = await interconnectLocationsClient.GetAsync(project, interconnectLocation); // End snippet }
/// <summary>Snippet for Get</summary> public void GetRequestObject() { // Snippet: Get(GetInterconnectLocationRequest, CallSettings) // Create client InterconnectLocationsClient interconnectLocationsClient = InterconnectLocationsClient.Create(); // Initialize request argument(s) GetInterconnectLocationRequest request = new GetInterconnectLocationRequest { Project = "", InterconnectLocation = "", }; // Make the request InterconnectLocation response = interconnectLocationsClient.Get(request); // End snippet }
/// <summary>Snippet for GetAsync</summary> public async Task GetRequestObjectAsync() { // Snippet: GetAsync(GetInterconnectLocationRequest, CallSettings) // Additional: GetAsync(GetInterconnectLocationRequest, CancellationToken) // Create client InterconnectLocationsClient interconnectLocationsClient = await InterconnectLocationsClient.CreateAsync(); // Initialize request argument(s) GetInterconnectLocationRequest request = new GetInterconnectLocationRequest { Project = "", InterconnectLocation = "", }; // Make the request InterconnectLocation response = await interconnectLocationsClient.GetAsync(request); // End snippet }
public async stt::Task GetRequestObjectAsync() { moq::Mock <InterconnectLocations.InterconnectLocationsClient> mockGrpcClient = new moq::Mock <InterconnectLocations.InterconnectLocationsClient>(moq::MockBehavior.Strict); GetInterconnectLocationRequest request = new GetInterconnectLocationRequest { Project = "projectaa6ff846", InterconnectLocation = "interconnect_location365a00f5", }; InterconnectLocation expectedResponse = new InterconnectLocation { Id = 11672635353343658936UL, City = "cityead2d54e", Kind = "kindf7aa39d9", Name = "name1c9368b0", CreationTimestamp = "creation_timestamp235e59a1", SupportsPzs = false, FacilityProviderFacilityId = "facility_provider_facility_id936c09db", Continent = "continent4ee8200e", AvailabilityZone = "availability_zone1778d0ba", Status = "status5444cb9a", RegionInfos = { new InterconnectLocationRegionInfo(), }, Description = "description2cf9da67", SelfLink = "self_link7e87f12d", Address = "address04984d88", FacilityProvider = "facility_provider3fff5132", PeeringdbFacilityId = "peeringdb_facility_idcce67e85", }; mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <InterconnectLocation>(stt::Task.FromResult(expectedResponse), null, null, null, null)); InterconnectLocationsClient client = new InterconnectLocationsClientImpl(mockGrpcClient.Object, null); InterconnectLocation responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); InterconnectLocation responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void GetRequestObject() { moq::Mock <InterconnectLocations.InterconnectLocationsClient> mockGrpcClient = new moq::Mock <InterconnectLocations.InterconnectLocationsClient>(moq::MockBehavior.Strict); GetInterconnectLocationRequest request = new GetInterconnectLocationRequest { Project = "projectaa6ff846", InterconnectLocation = "interconnect_location365a00f5", }; InterconnectLocation expectedResponse = new InterconnectLocation { Id = 11672635353343658936UL, City = "cityead2d54e", Kind = "kindf7aa39d9", Name = "name1c9368b0", CreationTimestamp = "creation_timestamp235e59a1", SupportsPzs = false, FacilityProviderFacilityId = "facility_provider_facility_id936c09db", Continent = InterconnectLocation.Types.Continent.CAfrica, AvailabilityZone = "availability_zone1778d0ba", Status = InterconnectLocation.Types.Status.Closed, RegionInfos = { new InterconnectLocationRegionInfo(), }, Description = "description2cf9da67", SelfLink = "self_link7e87f12d", Address = "address04984d88", FacilityProvider = "facility_provider3fff5132", PeeringdbFacilityId = "peeringdb_facility_idcce67e85", }; mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); InterconnectLocationsClient client = new InterconnectLocationsClientImpl(mockGrpcClient.Object, null); InterconnectLocation response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }