/// <summary>Snippet for GetGoogleAdsField</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGoogleAdsField()
 {
     // Create client
     GoogleAdsFieldServiceClient googleAdsFieldServiceClient = GoogleAdsFieldServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "googleAdsFields/[GOOGLE_ADS_FIELD]";
     // Make the request
     GoogleAdsField response = googleAdsFieldServiceClient.GetGoogleAdsField(resourceName);
 }
Пример #2
0
 /// <summary>Snippet for GetGoogleAdsField</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGoogleAdsFieldResourceNames()
 {
     // Create client
     GoogleAdsFieldServiceClient googleAdsFieldServiceClient = GoogleAdsFieldServiceClient.Create();
     // Initialize request argument(s)
     GoogleAdsFieldName resourceName = GoogleAdsFieldName.FromGoogleAdsField("[GOOGLE_ADS_FIELD]");
     // Make the request
     GoogleAdsField response = googleAdsFieldServiceClient.GetGoogleAdsField(resourceName);
 }
Пример #3
0
        /// <summary>Snippet for GetGoogleAdsFieldAsync</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 GetGoogleAdsFieldResourceNamesAsync()
        {
            // Create client
            GoogleAdsFieldServiceClient googleAdsFieldServiceClient = await GoogleAdsFieldServiceClient.CreateAsync();

            // Initialize request argument(s)
            GoogleAdsFieldName resourceName = GoogleAdsFieldName.FromGoogleAdsField("[GOOGLE_ADS_FIELD]");
            // Make the request
            GoogleAdsField response = await googleAdsFieldServiceClient.GetGoogleAdsFieldAsync(resourceName);
        }
Пример #4
0
        /// <summary>Snippet for GetGoogleAdsFieldAsync</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 GetGoogleAdsFieldAsync()
        {
            // Create client
            GoogleAdsFieldServiceClient googleAdsFieldServiceClient = await GoogleAdsFieldServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "googleAdsFields/[GOOGLE_ADS_FIELD]";
            // Make the request
            GoogleAdsField response = await googleAdsFieldServiceClient.GetGoogleAdsFieldAsync(resourceName);
        }
        /// <summary>Snippet for GetGoogleAdsFieldAsync</summary>
        public async Task GetGoogleAdsFieldAsync()
        {
            // Snippet: GetGoogleAdsFieldAsync(string, CallSettings)
            // Additional: GetGoogleAdsFieldAsync(string, CancellationToken)
            // Create client
            GoogleAdsFieldServiceClient googleAdsFieldServiceClient = await GoogleAdsFieldServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "googleAdsFields/[GOOGLE_ADS_FIELD]";
            // Make the request
            GoogleAdsField response = await googleAdsFieldServiceClient.GetGoogleAdsFieldAsync(resourceName);

            // End snippet
        }
 /// <summary>Snippet for GetGoogleAdsField</summary>
 public void GetGoogleAdsFieldRequestObject()
 {
     // Snippet: GetGoogleAdsField(GetGoogleAdsFieldRequest, CallSettings)
     // Create client
     GoogleAdsFieldServiceClient googleAdsFieldServiceClient = GoogleAdsFieldServiceClient.Create();
     // Initialize request argument(s)
     GetGoogleAdsFieldRequest request = new GetGoogleAdsFieldRequest
     {
         ResourceNameAsGoogleAdsFieldName = GoogleAdsFieldName.FromGoogleAdsField("[GOOGLE_ADS_FIELD]"),
     };
     // Make the request
     GoogleAdsField response = googleAdsFieldServiceClient.GetGoogleAdsField(request);
     // End snippet
 }
        /// <summary>Snippet for GetGoogleAdsFieldAsync</summary>
        public async Task GetGoogleAdsFieldRequestObjectAsync()
        {
            // Snippet: GetGoogleAdsFieldAsync(GetGoogleAdsFieldRequest, CallSettings)
            // Additional: GetGoogleAdsFieldAsync(GetGoogleAdsFieldRequest, CancellationToken)
            // Create client
            GoogleAdsFieldServiceClient googleAdsFieldServiceClient = await GoogleAdsFieldServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetGoogleAdsFieldRequest request = new GetGoogleAdsFieldRequest
            {
                ResourceNameAsGoogleAdsFieldName = GoogleAdsFieldName.FromGoogleAdsField("[GOOGLE_ADS_FIELD]"),
            };
            // Make the request
            GoogleAdsField response = await googleAdsFieldServiceClient.GetGoogleAdsFieldAsync(request);

            // End snippet
        }
        public void GetGoogleAdsField2()
        {
            Mock <GoogleAdsFieldService.GoogleAdsFieldServiceClient> mockGrpcClient = new Mock <GoogleAdsFieldService.GoogleAdsFieldServiceClient>(MockBehavior.Strict);
            GetGoogleAdsFieldRequest request = new GetGoogleAdsFieldRequest
            {
                ResourceName = new GoogleAdsFieldName("[GOOGLE_ADS_FIELD]").ToString(),
            };
            GoogleAdsField expectedResponse = new GoogleAdsField
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGoogleAdsField(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            GoogleAdsFieldServiceClient client = new GoogleAdsFieldServiceClientImpl(mockGrpcClient.Object, null);
            GoogleAdsField response            = client.GetGoogleAdsField(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task GetGoogleAdsFieldAsync2()
        {
            Mock <GoogleAdsFieldService.GoogleAdsFieldServiceClient> mockGrpcClient = new Mock <GoogleAdsFieldService.GoogleAdsFieldServiceClient>(MockBehavior.Strict);
            GetGoogleAdsFieldRequest request = new GetGoogleAdsFieldRequest
            {
                ResourceName = new GoogleAdsFieldName("[GOOGLE_ADS_FIELD]").ToString(),
            };
            GoogleAdsField expectedResponse = new GoogleAdsField
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGoogleAdsFieldAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <GoogleAdsField>(Task.FromResult(expectedResponse), null, null, null, null));
            GoogleAdsFieldServiceClient client = new GoogleAdsFieldServiceClientImpl(mockGrpcClient.Object, null);
            GoogleAdsField response            = await client.GetGoogleAdsFieldAsync(request);

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