Example #1
0
 /// <summary>Snippet for GetAdGroupAudienceView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAdGroupAudienceViewResourceNames()
 {
     // Create client
     AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = AdGroupAudienceViewServiceClient.Create();
     // Initialize request argument(s)
     AdGroupAudienceViewName resourceName = AdGroupAudienceViewName.FromCustomerAdGroupCriterion("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]");
     // Make the request
     AdGroupAudienceView response = adGroupAudienceViewServiceClient.GetAdGroupAudienceView(resourceName);
 }
Example #2
0
        /// <summary>Snippet for GetAdGroupAudienceViewAsync</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 GetAdGroupAudienceViewResourceNamesAsync()
        {
            // Create client
            AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = await AdGroupAudienceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            AdGroupAudienceViewName resourceName = AdGroupAudienceViewName.FromCustomerAdGroupAudienceView("[CUSTOMER]", "[AD_GROUP_AUDIENCE_VIEW]");
            // Make the request
            AdGroupAudienceView response = await adGroupAudienceViewServiceClient.GetAdGroupAudienceViewAsync(resourceName);
        }
Example #3
0
 /// <summary>Snippet for GetAdGroupAudienceView</summary>
 public void GetAdGroupAudienceViewResourceNames()
 {
     // Snippet: GetAdGroupAudienceView(AdGroupAudienceViewName, CallSettings)
     // Create client
     AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = AdGroupAudienceViewServiceClient.Create();
     // Initialize request argument(s)
     AdGroupAudienceViewName resourceName = AdGroupAudienceViewName.FromCustomerAdGroupAudienceView("[CUSTOMER]", "[AD_GROUP_AUDIENCE_VIEW]");
     // Make the request
     AdGroupAudienceView response = adGroupAudienceViewServiceClient.GetAdGroupAudienceView(resourceName);
     // End snippet
 }
Example #4
0
 /// <summary>Snippet for GetAdGroupAudienceView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAdGroupAudienceViewRequestObject()
 {
     // Create client
     AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = AdGroupAudienceViewServiceClient.Create();
     // Initialize request argument(s)
     GetAdGroupAudienceViewRequest request = new GetAdGroupAudienceViewRequest
     {
         ResourceNameAsAdGroupAudienceViewName = AdGroupAudienceViewName.FromCustomerAdGroupAudienceView("[CUSTOMER]", "[AD_GROUP_AUDIENCE_VIEW]"),
     };
     // Make the request
     AdGroupAudienceView response = adGroupAudienceViewServiceClient.GetAdGroupAudienceView(request);
 }
        /// <summary>Snippet for GetAdGroupAudienceViewAsync</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 GetAdGroupAudienceViewRequestObjectAsync()
        {
            // Create client
            AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = await AdGroupAudienceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetAdGroupAudienceViewRequest request = new GetAdGroupAudienceViewRequest
            {
                ResourceNameAsAdGroupAudienceViewName = AdGroupAudienceViewName.FromCustomerAdGroupCriterion("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]"),
            };
            // Make the request
            AdGroupAudienceView response = await adGroupAudienceViewServiceClient.GetAdGroupAudienceViewAsync(request);
        }
Example #6
0
 /// <summary>Snippet for GetAdGroupAudienceView</summary>
 public void GetAdGroupAudienceViewRequestObject()
 {
     // Snippet: GetAdGroupAudienceView(GetAdGroupAudienceViewRequest, CallSettings)
     // Create client
     AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = AdGroupAudienceViewServiceClient.Create();
     // Initialize request argument(s)
     GetAdGroupAudienceViewRequest request = new GetAdGroupAudienceViewRequest
     {
         ResourceNameAsAdGroupAudienceViewName = AdGroupAudienceViewName.FromCustomerAdGroupCriterion("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]"),
     };
     // Make the request
     AdGroupAudienceView response = adGroupAudienceViewServiceClient.GetAdGroupAudienceView(request);
     // End snippet
 }
Example #7
0
        /// <summary>Snippet for GetAdGroupAudienceViewAsync</summary>
        public async Task GetAdGroupAudienceViewResourceNamesAsync()
        {
            // Snippet: GetAdGroupAudienceViewAsync(AdGroupAudienceViewName, CallSettings)
            // Additional: GetAdGroupAudienceViewAsync(AdGroupAudienceViewName, CancellationToken)
            // Create client
            AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = await AdGroupAudienceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            AdGroupAudienceViewName resourceName = AdGroupAudienceViewName.FromCustomerAdGroupCriterion("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]");
            // Make the request
            AdGroupAudienceView response = await adGroupAudienceViewServiceClient.GetAdGroupAudienceViewAsync(resourceName);

            // End snippet
        }
Example #8
0
        /// <summary>Snippet for GetAdGroupAudienceViewAsync</summary>
        public async Task GetAdGroupAudienceViewRequestObjectAsync()
        {
            // Snippet: GetAdGroupAudienceViewAsync(GetAdGroupAudienceViewRequest, CallSettings)
            // Additional: GetAdGroupAudienceViewAsync(GetAdGroupAudienceViewRequest, CancellationToken)
            // Create client
            AdGroupAudienceViewServiceClient adGroupAudienceViewServiceClient = await AdGroupAudienceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetAdGroupAudienceViewRequest request = new GetAdGroupAudienceViewRequest
            {
                ResourceNameAsAdGroupAudienceViewName = AdGroupAudienceViewName.FromCustomerAdGroupAudienceView("[CUSTOMER]", "[AD_GROUP_AUDIENCE_VIEW]"),
            };
            // Make the request
            AdGroupAudienceView response = await adGroupAudienceViewServiceClient.GetAdGroupAudienceViewAsync(request);

            // End snippet
        }
        public async Task GetAdGroupAudienceViewAsync()
        {
            Mock <AdGroupAudienceViewService.AdGroupAudienceViewServiceClient> mockGrpcClient = new Mock <AdGroupAudienceViewService.AdGroupAudienceViewServiceClient>(MockBehavior.Strict);
            GetAdGroupAudienceViewRequest expectedRequest = new GetAdGroupAudienceViewRequest
            {
                ResourceName = new AdGroupAudienceViewName("[CUSTOMER]", "[AD_GROUP_AUDIENCE_VIEW]").ToString(),
            };
            AdGroupAudienceView expectedResponse = new AdGroupAudienceView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetAdGroupAudienceViewAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <AdGroupAudienceView>(Task.FromResult(expectedResponse), null, null, null, null));
            AdGroupAudienceViewServiceClient client = new AdGroupAudienceViewServiceClientImpl(mockGrpcClient.Object, null);
            string formattedResourceName            = new AdGroupAudienceViewName("[CUSTOMER]", "[AD_GROUP_AUDIENCE_VIEW]").ToString();
            AdGroupAudienceView response            = await client.GetAdGroupAudienceViewAsync(formattedResourceName);

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