/// <summary>Snippet for GetMerchantCenterLink</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetMerchantCenterLinkResourceNames() { // Create client MerchantCenterLinkServiceClient merchantCenterLinkServiceClient = MerchantCenterLinkServiceClient.Create(); // Initialize request argument(s) MerchantCenterLinkName resourceName = MerchantCenterLinkName.FromCustomerMerchantCenter("[CUSTOMER_ID]", "[MERCHANT_CENTER_ID]"); // Make the request MerchantCenterLink response = merchantCenterLinkServiceClient.GetMerchantCenterLink(resourceName); }
/// <summary>Snippet for GetMerchantCenterLinkAsync</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 GetMerchantCenterLinkResourceNamesAsync() { // Create client MerchantCenterLinkServiceClient merchantCenterLinkServiceClient = await MerchantCenterLinkServiceClient.CreateAsync(); // Initialize request argument(s) MerchantCenterLinkName resourceName = MerchantCenterLinkName.FromCustomerMerchantCenterLink("[CUSTOMER]", "[MERCHANT_CENTER_LINK]"); // Make the request MerchantCenterLink response = await merchantCenterLinkServiceClient.GetMerchantCenterLinkAsync(resourceName); }
/// <summary>Snippet for GetMerchantCenterLink</summary> public void GetMerchantCenterLinkResourceNames() { // Snippet: GetMerchantCenterLink(MerchantCenterLinkName, CallSettings) // Create client MerchantCenterLinkServiceClient merchantCenterLinkServiceClient = MerchantCenterLinkServiceClient.Create(); // Initialize request argument(s) MerchantCenterLinkName resourceName = MerchantCenterLinkName.FromCustomerMerchantCenterLink("[CUSTOMER]", "[MERCHANT_CENTER_LINK]"); // Make the request MerchantCenterLink response = merchantCenterLinkServiceClient.GetMerchantCenterLink(resourceName); // End snippet }
/// <summary>Snippet for GetMerchantCenterLink</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetMerchantCenterLinkRequestObject() { // Create client MerchantCenterLinkServiceClient merchantCenterLinkServiceClient = MerchantCenterLinkServiceClient.Create(); // Initialize request argument(s) GetMerchantCenterLinkRequest request = new GetMerchantCenterLinkRequest { ResourceNameAsMerchantCenterLinkName = MerchantCenterLinkName.FromCustomerMerchantCenterLink("[CUSTOMER]", "[MERCHANT_CENTER_LINK]"), }; // Make the request MerchantCenterLink response = merchantCenterLinkServiceClient.GetMerchantCenterLink(request); }
/// <summary>Snippet for GetMerchantCenterLinkAsync</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 GetMerchantCenterLinkRequestObjectAsync() { // Create client MerchantCenterLinkServiceClient merchantCenterLinkServiceClient = await MerchantCenterLinkServiceClient.CreateAsync(); // Initialize request argument(s) GetMerchantCenterLinkRequest request = new GetMerchantCenterLinkRequest { ResourceNameAsMerchantCenterLinkName = MerchantCenterLinkName.FromCustomerMerchantCenter("[CUSTOMER_ID]", "[MERCHANT_CENTER_ID]"), }; // Make the request MerchantCenterLink response = await merchantCenterLinkServiceClient.GetMerchantCenterLinkAsync(request); }
/// <summary>Snippet for GetMerchantCenterLinkAsync</summary> public async Task GetMerchantCenterLinkResourceNamesAsync() { // Snippet: GetMerchantCenterLinkAsync(MerchantCenterLinkName, CallSettings) // Additional: GetMerchantCenterLinkAsync(MerchantCenterLinkName, CancellationToken) // Create client MerchantCenterLinkServiceClient merchantCenterLinkServiceClient = await MerchantCenterLinkServiceClient.CreateAsync(); // Initialize request argument(s) MerchantCenterLinkName resourceName = MerchantCenterLinkName.FromCustomerMerchantCenter("[CUSTOMER_ID]", "[MERCHANT_CENTER_ID]"); // Make the request MerchantCenterLink response = await merchantCenterLinkServiceClient.GetMerchantCenterLinkAsync(resourceName); // End snippet }
/// <summary>Snippet for GetMerchantCenterLinkAsync</summary> public async Task GetMerchantCenterLinkRequestObjectAsync() { // Snippet: GetMerchantCenterLinkAsync(GetMerchantCenterLinkRequest, CallSettings) // Additional: GetMerchantCenterLinkAsync(GetMerchantCenterLinkRequest, CancellationToken) // Create client MerchantCenterLinkServiceClient merchantCenterLinkServiceClient = await MerchantCenterLinkServiceClient.CreateAsync(); // Initialize request argument(s) GetMerchantCenterLinkRequest request = new GetMerchantCenterLinkRequest { ResourceNameAsMerchantCenterLinkName = MerchantCenterLinkName.FromCustomerMerchantCenterLink("[CUSTOMER]", "[MERCHANT_CENTER_LINK]"), }; // Make the request MerchantCenterLink response = await merchantCenterLinkServiceClient.GetMerchantCenterLinkAsync(request); // End snippet }
public async Task GetMerchantCenterLinkAsync() { Mock <MerchantCenterLinkService.MerchantCenterLinkServiceClient> mockGrpcClient = new Mock <MerchantCenterLinkService.MerchantCenterLinkServiceClient>(MockBehavior.Strict); GetMerchantCenterLinkRequest expectedRequest = new GetMerchantCenterLinkRequest { ResourceName = new MerchantCenterLinkName("[CUSTOMER]", "[MERCHANT_CENTER_LINK]").ToString(), }; MerchantCenterLink expectedResponse = new MerchantCenterLink { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetMerchantCenterLinkAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MerchantCenterLink>(Task.FromResult(expectedResponse), null, null, null, null)); MerchantCenterLinkServiceClient client = new MerchantCenterLinkServiceClientImpl(mockGrpcClient.Object, null); string formattedResourceName = new MerchantCenterLinkName("[CUSTOMER]", "[MERCHANT_CENTER_LINK]").ToString(); MerchantCenterLink response = await client.GetMerchantCenterLinkAsync(formattedResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }