/// <summary>Snippet for GetHotelGroupView</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetHotelGroupViewResourceNames() { // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = HotelGroupViewServiceClient.Create(); // Initialize request argument(s) HotelGroupViewName resourceName = HotelGroupViewName.FromCustomerHotelGroupView("[CUSTOMER]", "[HOTEL_GROUP_VIEW]"); // Make the request HotelGroupView response = hotelGroupViewServiceClient.GetHotelGroupView(resourceName); }
/// <summary>Snippet for GetHotelGroupView</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetHotelGroupViewResourceNames() { // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = HotelGroupViewServiceClient.Create(); // Initialize request argument(s) HotelGroupViewName resourceName = HotelGroupViewName.FromCustomerAdGroupCriterion("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]"); // Make the request HotelGroupView response = hotelGroupViewServiceClient.GetHotelGroupView(resourceName); }
/// <summary>Snippet for GetHotelGroupView</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetHotelGroupView() { // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = HotelGroupViewServiceClient.Create(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER]/hotelGroupViews/[HOTEL_GROUP_VIEW]"; // Make the request HotelGroupView response = hotelGroupViewServiceClient.GetHotelGroupView(resourceName); }
/// <summary>Snippet for GetHotelGroupViewAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetHotelGroupViewAsync() { // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = await HotelGroupViewServiceClient.CreateAsync(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER_ID]/hotelGroupViews/[AD_GROUP_ID]~[CRITERION_ID]"; // Make the request HotelGroupView response = await hotelGroupViewServiceClient.GetHotelGroupViewAsync(resourceName); }
/// <summary>Snippet for GetHotelGroupView</summary> public void GetHotelGroupView() { // Snippet: GetHotelGroupView(string, CallSettings) // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = HotelGroupViewServiceClient.Create(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER_ID]/hotelGroupViews/[AD_GROUP_ID]~[CRITERION_ID]"; // Make the request HotelGroupView response = hotelGroupViewServiceClient.GetHotelGroupView(resourceName); // End snippet }
/// <summary>Snippet for GetHotelGroupViewAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetHotelGroupViewRequestObjectAsync() { // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = await HotelGroupViewServiceClient.CreateAsync(); // Initialize request argument(s) GetHotelGroupViewRequest request = new GetHotelGroupViewRequest { ResourceNameAsHotelGroupViewName = HotelGroupViewName.FromCustomerHotelGroupView("[CUSTOMER]", "[HOTEL_GROUP_VIEW]"), }; // Make the request HotelGroupView response = await hotelGroupViewServiceClient.GetHotelGroupViewAsync(request); }
/// <summary>Snippet for GetHotelGroupViewAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetHotelGroupViewRequestObjectAsync() { // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = await HotelGroupViewServiceClient.CreateAsync(); // Initialize request argument(s) GetHotelGroupViewRequest request = new GetHotelGroupViewRequest { ResourceNameAsHotelGroupViewName = HotelGroupViewName.FromCustomerAdGroupCriterion("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]"), }; // Make the request HotelGroupView response = await hotelGroupViewServiceClient.GetHotelGroupViewAsync(request); }
/// <summary>Snippet for GetHotelGroupViewAsync</summary> public async Task GetHotelGroupViewAsync() { // Snippet: GetHotelGroupViewAsync(string, CallSettings) // Additional: GetHotelGroupViewAsync(string, CancellationToken) // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = await HotelGroupViewServiceClient.CreateAsync(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER]/hotelGroupViews/[HOTEL_GROUP_VIEW]"; // Make the request HotelGroupView response = await hotelGroupViewServiceClient.GetHotelGroupViewAsync(resourceName); // End snippet }
/// <summary>Snippet for GetHotelGroupView</summary> public void GetHotelGroupViewRequestObject() { // Snippet: GetHotelGroupView(GetHotelGroupViewRequest, CallSettings) // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = HotelGroupViewServiceClient.Create(); // Initialize request argument(s) GetHotelGroupViewRequest request = new GetHotelGroupViewRequest { ResourceNameAsHotelGroupViewName = HotelGroupViewName.FromCustomerHotelGroupView("[CUSTOMER]", "[HOTEL_GROUP_VIEW]"), }; // Make the request HotelGroupView response = hotelGroupViewServiceClient.GetHotelGroupView(request); // End snippet }
/// <summary>Snippet for GetHotelGroupViewAsync</summary> public async Task GetHotelGroupViewResourceNamesAsync() { // Snippet: GetHotelGroupViewAsync(HotelGroupViewName, CallSettings) // Additional: GetHotelGroupViewAsync(HotelGroupViewName, CancellationToken) // Create client HotelGroupViewServiceClient hotelGroupViewServiceClient = await HotelGroupViewServiceClient.CreateAsync(); // Initialize request argument(s) HotelGroupViewName resourceName = HotelGroupViewName.FromCustomerHotelGroupView("[CUSTOMER]", "[HOTEL_GROUP_VIEW]"); // Make the request HotelGroupView response = await hotelGroupViewServiceClient.GetHotelGroupViewAsync(resourceName); // End snippet }
public void GetHotelGroupView2() { Mock <HotelGroupViewService.HotelGroupViewServiceClient> mockGrpcClient = new Mock <HotelGroupViewService.HotelGroupViewServiceClient>(MockBehavior.Strict); GetHotelGroupViewRequest request = new GetHotelGroupViewRequest { ResourceName = new HotelGroupViewName("[CUSTOMER]", "[HOTEL_GROUP_VIEW]").ToString(), }; HotelGroupView expectedResponse = new HotelGroupView { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetHotelGroupView(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); HotelGroupViewServiceClient client = new HotelGroupViewServiceClientImpl(mockGrpcClient.Object, null); HotelGroupView response = client.GetHotelGroupView(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task GetHotelGroupViewAsync2() { Mock <HotelGroupViewService.HotelGroupViewServiceClient> mockGrpcClient = new Mock <HotelGroupViewService.HotelGroupViewServiceClient>(MockBehavior.Strict); GetHotelGroupViewRequest request = new GetHotelGroupViewRequest { ResourceName = new HotelGroupViewName("[CUSTOMER]", "[HOTEL_GROUP_VIEW]").ToString(), }; HotelGroupView expectedResponse = new HotelGroupView { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetHotelGroupViewAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <HotelGroupView>(Task.FromResult(expectedResponse), null, null, null, null)); HotelGroupViewServiceClient client = new HotelGroupViewServiceClientImpl(mockGrpcClient.Object, null); HotelGroupView response = await client.GetHotelGroupViewAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }