/// <summary>Snippet for GetGroupPlacementView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGroupPlacementViewResourceNames()
 {
     // Create client
     GroupPlacementViewServiceClient groupPlacementViewServiceClient = GroupPlacementViewServiceClient.Create();
     // Initialize request argument(s)
     GroupPlacementViewName resourceName = GroupPlacementViewName.FromCustomerAdGroupBase64Placement("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[BASE64_PLACEMENT]");
     // Make the request
     GroupPlacementView response = groupPlacementViewServiceClient.GetGroupPlacementView(resourceName);
 }
 /// <summary>Snippet for GetGroupPlacementView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGroupPlacementView()
 {
     // Create client
     GroupPlacementViewServiceClient groupPlacementViewServiceClient = GroupPlacementViewServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/groupPlacementViews/[AD_GROUP_ID]~[BASE64_PLACEMENT]";
     // Make the request
     GroupPlacementView response = groupPlacementViewServiceClient.GetGroupPlacementView(resourceName);
 }
Exemplo n.º 3
0
 /// <summary>Snippet for GetGroupPlacementView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGroupPlacementViewResourceNames()
 {
     // Create client
     GroupPlacementViewServiceClient groupPlacementViewServiceClient = GroupPlacementViewServiceClient.Create();
     // Initialize request argument(s)
     GroupPlacementViewName resourceName = GroupPlacementViewName.FromCustomerGroupPlacementView("[CUSTOMER]", "[GROUP_PLACEMENT_VIEW]");
     // Make the request
     GroupPlacementView response = groupPlacementViewServiceClient.GetGroupPlacementView(resourceName);
 }
        /// <summary>Snippet for GetGroupPlacementViewAsync</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 GetGroupPlacementViewAsync()
        {
            // Create client
            GroupPlacementViewServiceClient groupPlacementViewServiceClient = await GroupPlacementViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/groupPlacementViews/[GROUP_PLACEMENT_VIEW]";
            // Make the request
            GroupPlacementView response = await groupPlacementViewServiceClient.GetGroupPlacementViewAsync(resourceName);
        }
 /// <summary>Snippet for GetGroupPlacementView</summary>
 public void GetGroupPlacementView()
 {
     // Snippet: GetGroupPlacementView(string, CallSettings)
     // Create client
     GroupPlacementViewServiceClient groupPlacementViewServiceClient = GroupPlacementViewServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER]/groupPlacementViews/[GROUP_PLACEMENT_VIEW]";
     // Make the request
     GroupPlacementView response = groupPlacementViewServiceClient.GetGroupPlacementView(resourceName);
     // End snippet
 }
        /// <summary>Snippet for GetGroupPlacementViewAsync</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 GetGroupPlacementViewRequestObjectAsync()
        {
            // Create client
            GroupPlacementViewServiceClient groupPlacementViewServiceClient = await GroupPlacementViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetGroupPlacementViewRequest request = new GetGroupPlacementViewRequest
            {
                ResourceNameAsGroupPlacementViewName = GroupPlacementViewName.FromCustomerAdGroupBase64Placement("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[BASE64_PLACEMENT]"),
            };
            // Make the request
            GroupPlacementView response = await groupPlacementViewServiceClient.GetGroupPlacementViewAsync(request);
        }
        /// <summary>Snippet for GetGroupPlacementViewAsync</summary>
        public async Task GetGroupPlacementViewAsync()
        {
            // Snippet: GetGroupPlacementViewAsync(string, CallSettings)
            // Additional: GetGroupPlacementViewAsync(string, CancellationToken)
            // Create client
            GroupPlacementViewServiceClient groupPlacementViewServiceClient = await GroupPlacementViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/groupPlacementViews/[GROUP_PLACEMENT_VIEW]";
            // Make the request
            GroupPlacementView response = await groupPlacementViewServiceClient.GetGroupPlacementViewAsync(resourceName);

            // End snippet
        }
 /// <summary>Snippet for GetGroupPlacementView</summary>
 public void GetGroupPlacementViewRequestObject()
 {
     // Snippet: GetGroupPlacementView(GetGroupPlacementViewRequest, CallSettings)
     // Create client
     GroupPlacementViewServiceClient groupPlacementViewServiceClient = GroupPlacementViewServiceClient.Create();
     // Initialize request argument(s)
     GetGroupPlacementViewRequest request = new GetGroupPlacementViewRequest
     {
         ResourceNameAsGroupPlacementViewName = GroupPlacementViewName.FromCustomerGroupPlacementView("[CUSTOMER]", "[GROUP_PLACEMENT_VIEW]"),
     };
     // Make the request
     GroupPlacementView response = groupPlacementViewServiceClient.GetGroupPlacementView(request);
     // End snippet
 }
        /// <summary>Snippet for GetGroupPlacementViewAsync</summary>
        public async Task GetGroupPlacementViewResourceNamesAsync()
        {
            // Snippet: GetGroupPlacementViewAsync(GroupPlacementViewName, CallSettings)
            // Additional: GetGroupPlacementViewAsync(GroupPlacementViewName, CancellationToken)
            // Create client
            GroupPlacementViewServiceClient groupPlacementViewServiceClient = await GroupPlacementViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GroupPlacementViewName resourceName = GroupPlacementViewName.FromCustomerGroupPlacementView("[CUSTOMER]", "[GROUP_PLACEMENT_VIEW]");
            // Make the request
            GroupPlacementView response = await groupPlacementViewServiceClient.GetGroupPlacementViewAsync(resourceName);

            // End snippet
        }
        public void GetGroupPlacementView2()
        {
            Mock <GroupPlacementViewService.GroupPlacementViewServiceClient> mockGrpcClient = new Mock <GroupPlacementViewService.GroupPlacementViewServiceClient>(MockBehavior.Strict);
            GetGroupPlacementViewRequest request = new GetGroupPlacementViewRequest
            {
                ResourceName = new GroupPlacementViewName("[CUSTOMER]", "[GROUP_PLACEMENT_VIEW]").ToString(),
            };
            GroupPlacementView expectedResponse = new GroupPlacementView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGroupPlacementView(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            GroupPlacementViewServiceClient client = new GroupPlacementViewServiceClientImpl(mockGrpcClient.Object, null);
            GroupPlacementView response            = client.GetGroupPlacementView(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task GetGroupPlacementViewAsync()
        {
            Mock <GroupPlacementViewService.GroupPlacementViewServiceClient> mockGrpcClient = new Mock <GroupPlacementViewService.GroupPlacementViewServiceClient>(MockBehavior.Strict);
            GetGroupPlacementViewRequest expectedRequest = new GetGroupPlacementViewRequest
            {
                ResourceName = new GroupPlacementViewName("[CUSTOMER]", "[GROUP_PLACEMENT_VIEW]").ToString(),
            };
            GroupPlacementView expectedResponse = new GroupPlacementView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGroupPlacementViewAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <GroupPlacementView>(Task.FromResult(expectedResponse), null, null, null, null));
            GroupPlacementViewServiceClient client   = new GroupPlacementViewServiceClientImpl(mockGrpcClient.Object, null);
            string             formattedResourceName = new GroupPlacementViewName("[CUSTOMER]", "[GROUP_PLACEMENT_VIEW]").ToString();
            GroupPlacementView response = await client.GetGroupPlacementViewAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }