/// <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(); }
/// <summary> /// Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public override stt::Task <InterconnectLocation> GetAsync(GetInterconnectLocationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_GetInterconnectLocationRequest(ref request, ref callSettings); return(_callGet.Async(request, callSettings)); }
/// <summary> /// Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>The RPC response.</returns> public override InterconnectLocation Get(GetInterconnectLocationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_GetInterconnectLocationRequest(ref request, ref callSettings); return(_callGet.Sync(request, callSettings)); }
partial void Modify_GetInterconnectLocationRequest(ref GetInterconnectLocationRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <InterconnectLocation> GetAsync(GetInterconnectLocationRequest request, st::CancellationToken cancellationToken) => GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <InterconnectLocation> GetAsync(GetInterconnectLocationRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();