/// <summary>Snippet for GetRemarketingAction</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetRemarketingActionResourceNames() { // Create client RemarketingActionServiceClient remarketingActionServiceClient = RemarketingActionServiceClient.Create(); // Initialize request argument(s) RemarketingActionName resourceName = RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER_ID]", "[REMARKETING_ACTION_ID]"); // Make the request RemarketingAction response = remarketingActionServiceClient.GetRemarketingAction(resourceName); }
/// <summary>Snippet for GetRemarketingActionAsync</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 GetRemarketingActionResourceNamesAsync() { // Create client RemarketingActionServiceClient remarketingActionServiceClient = await RemarketingActionServiceClient.CreateAsync(); // Initialize request argument(s) RemarketingActionName resourceName = RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"); // Make the request RemarketingAction response = await remarketingActionServiceClient.GetRemarketingActionAsync(resourceName); }
/// <summary>Snippet for GetRemarketingAction</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetRemarketingActionRequestObject() { // Create client RemarketingActionServiceClient remarketingActionServiceClient = RemarketingActionServiceClient.Create(); // Initialize request argument(s) GetRemarketingActionRequest request = new GetRemarketingActionRequest { ResourceNameAsRemarketingActionName = RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER]", "[REMARKETING_ACTION]"), }; // Make the request RemarketingAction response = remarketingActionServiceClient.GetRemarketingAction(request); }
/// <summary>Snippet for GetRemarketingActionAsync</summary> public async Task GetRemarketingActionResourceNamesAsync() { // Snippet: GetRemarketingActionAsync(RemarketingActionName, CallSettings) // Additional: GetRemarketingActionAsync(RemarketingActionName, CancellationToken) // Create client RemarketingActionServiceClient remarketingActionServiceClient = await RemarketingActionServiceClient.CreateAsync(); // Initialize request argument(s) RemarketingActionName resourceName = RemarketingActionName.FromCustomerRemarketingAction("[CUSTOMER_ID]", "[REMARKETING_ACTION_ID]"); // Make the request RemarketingAction response = await remarketingActionServiceClient.GetRemarketingActionAsync(resourceName); // End snippet }
public async Task GetRemarketingActionAsync() { Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict); GetRemarketingActionRequest expectedRequest = new GetRemarketingActionRequest { ResourceName = new RemarketingActionName("[CUSTOMER]", "[REMARKETING_ACTION]").ToString(), }; RemarketingAction expectedResponse = new RemarketingAction { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetRemarketingActionAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <RemarketingAction>(Task.FromResult(expectedResponse), null, null, null, null)); RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null); string formattedResourceName = new RemarketingActionName("[CUSTOMER]", "[REMARKETING_ACTION]").ToString(); RemarketingAction response = await client.GetRemarketingActionAsync(formattedResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }