Exemple #1
0
 /// <summary>Snippet for GetDomainCategory</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDomainCategoryResourceNames()
 {
     // Create client
     DomainCategoryServiceClient domainCategoryServiceClient = DomainCategoryServiceClient.Create();
     // Initialize request argument(s)
     DomainCategoryName resourceName = DomainCategoryName.FromCustomerCampaignBase64CategoryLanguageCode("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[BASE64_CATEGORY]", "[LANGUAGE_CODE]");
     // Make the request
     DomainCategory response = domainCategoryServiceClient.GetDomainCategory(resourceName);
 }
Exemple #2
0
 /// <summary>Snippet for GetDomainCategory</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDomainCategory()
 {
     // Create client
     DomainCategoryServiceClient domainCategoryServiceClient = DomainCategoryServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/domainCategories/[CAMPAIGN_ID]~[BASE64_CATEGORY]~[LANGUAGE_CODE]";
     // Make the request
     DomainCategory response = domainCategoryServiceClient.GetDomainCategory(resourceName);
 }
Exemple #3
0
        /// <summary>Snippet for GetDomainCategoryAsync</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 GetDomainCategoryAsync()
        {
            // Create client
            DomainCategoryServiceClient domainCategoryServiceClient = await DomainCategoryServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/domainCategories/[DOMAIN_CATEGORY]";
            // Make the request
            DomainCategory response = await domainCategoryServiceClient.GetDomainCategoryAsync(resourceName);
        }
        /// <summary>Snippet for GetDomainCategoryAsync</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 GetDomainCategoryResourceNamesAsync()
        {
            // Create client
            DomainCategoryServiceClient domainCategoryServiceClient = await DomainCategoryServiceClient.CreateAsync();

            // Initialize request argument(s)
            DomainCategoryName resourceName = DomainCategoryName.FromCustomerDomainCategory("[CUSTOMER]", "[DOMAIN_CATEGORY]");
            // Make the request
            DomainCategory response = await domainCategoryServiceClient.GetDomainCategoryAsync(resourceName);
        }
 /// <summary>Snippet for GetDomainCategory</summary>
 public void GetDomainCategoryResourceNames()
 {
     // Snippet: GetDomainCategory(DomainCategoryName, CallSettings)
     // Create client
     DomainCategoryServiceClient domainCategoryServiceClient = DomainCategoryServiceClient.Create();
     // Initialize request argument(s)
     DomainCategoryName resourceName = DomainCategoryName.FromCustomerDomainCategory("[CUSTOMER]", "[DOMAIN_CATEGORY]");
     // Make the request
     DomainCategory response = domainCategoryServiceClient.GetDomainCategory(resourceName);
     // End snippet
 }
 /// <summary>Snippet for GetDomainCategory</summary>
 public void GetDomainCategory()
 {
     // Snippet: GetDomainCategory(string, CallSettings)
     // Create client
     DomainCategoryServiceClient domainCategoryServiceClient = DomainCategoryServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER]/domainCategories/[DOMAIN_CATEGORY]";
     // Make the request
     DomainCategory response = domainCategoryServiceClient.GetDomainCategory(resourceName);
     // End snippet
 }
Exemple #7
0
 /// <summary>Snippet for GetDomainCategory</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDomainCategoryRequestObject()
 {
     // Create client
     DomainCategoryServiceClient domainCategoryServiceClient = DomainCategoryServiceClient.Create();
     // Initialize request argument(s)
     GetDomainCategoryRequest request = new GetDomainCategoryRequest
     {
         ResourceNameAsDomainCategoryName = DomainCategoryName.FromCustomerDomainCategory("[CUSTOMER]", "[DOMAIN_CATEGORY]"),
     };
     // Make the request
     DomainCategory response = domainCategoryServiceClient.GetDomainCategory(request);
 }
Exemple #8
0
        /// <summary>Snippet for GetDomainCategoryAsync</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 GetDomainCategoryRequestObjectAsync()
        {
            // Create client
            DomainCategoryServiceClient domainCategoryServiceClient = await DomainCategoryServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetDomainCategoryRequest request = new GetDomainCategoryRequest
            {
                ResourceNameAsDomainCategoryName = DomainCategoryName.FromCustomerCampaignBase64CategoryLanguageCode("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[BASE64_CATEGORY]", "[LANGUAGE_CODE]"),
            };
            // Make the request
            DomainCategory response = await domainCategoryServiceClient.GetDomainCategoryAsync(request);
        }
        /// <summary>Snippet for GetDomainCategoryAsync</summary>
        public async Task GetDomainCategoryAsync()
        {
            // Snippet: GetDomainCategoryAsync(string, CallSettings)
            // Additional: GetDomainCategoryAsync(string, CancellationToken)
            // Create client
            DomainCategoryServiceClient domainCategoryServiceClient = await DomainCategoryServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/domainCategories/[DOMAIN_CATEGORY]";
            // Make the request
            DomainCategory response = await domainCategoryServiceClient.GetDomainCategoryAsync(resourceName);

            // End snippet
        }
        /// <summary>Snippet for GetDomainCategoryAsync</summary>
        public async Task GetDomainCategoryResourceNamesAsync()
        {
            // Snippet: GetDomainCategoryAsync(DomainCategoryName, CallSettings)
            // Additional: GetDomainCategoryAsync(DomainCategoryName, CancellationToken)
            // Create client
            DomainCategoryServiceClient domainCategoryServiceClient = await DomainCategoryServiceClient.CreateAsync();

            // Initialize request argument(s)
            DomainCategoryName resourceName = DomainCategoryName.FromCustomerDomainCategory("[CUSTOMER]", "[DOMAIN_CATEGORY]");
            // Make the request
            DomainCategory response = await domainCategoryServiceClient.GetDomainCategoryAsync(resourceName);

            // End snippet
        }
 /// <summary>Snippet for GetDomainCategory</summary>
 public void GetDomainCategoryRequestObject()
 {
     // Snippet: GetDomainCategory(GetDomainCategoryRequest, CallSettings)
     // Create client
     DomainCategoryServiceClient domainCategoryServiceClient = DomainCategoryServiceClient.Create();
     // Initialize request argument(s)
     GetDomainCategoryRequest request = new GetDomainCategoryRequest
     {
         ResourceNameAsDomainCategoryName = DomainCategoryName.FromCustomerCampaignBase64CategoryLanguageCode("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[BASE64_CATEGORY]", "[LANGUAGE_CODE]"),
     };
     // Make the request
     DomainCategory response = domainCategoryServiceClient.GetDomainCategory(request);
     // End snippet
 }
        /// <summary>Snippet for GetDomainCategoryAsync</summary>
        public async Task GetDomainCategoryResourceNamesAsync()
        {
            // Snippet: GetDomainCategoryAsync(DomainCategoryName, CallSettings)
            // Additional: GetDomainCategoryAsync(DomainCategoryName, CancellationToken)
            // Create client
            DomainCategoryServiceClient domainCategoryServiceClient = await DomainCategoryServiceClient.CreateAsync();

            // Initialize request argument(s)
            DomainCategoryName resourceName = DomainCategoryName.FromCustomerCampaignBase64CategoryLanguageCode("[CUSTOMER_ID]", "[CAMPAIGN_ID]", "[BASE64_CATEGORY]", "[LANGUAGE_CODE]");
            // Make the request
            DomainCategory response = await domainCategoryServiceClient.GetDomainCategoryAsync(resourceName);

            // End snippet
        }
Exemple #13
0
        public void GetDomainCategory2()
        {
            Mock <DomainCategoryService.DomainCategoryServiceClient> mockGrpcClient = new Mock <DomainCategoryService.DomainCategoryServiceClient>(MockBehavior.Strict);
            GetDomainCategoryRequest request = new GetDomainCategoryRequest
            {
                ResourceName = new DomainCategoryName("[CUSTOMER]", "[DOMAIN_CATEGORY]").ToString(),
            };
            DomainCategory expectedResponse = new DomainCategory
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetDomainCategory(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            DomainCategoryServiceClient client = new DomainCategoryServiceClientImpl(mockGrpcClient.Object, null);
            DomainCategory response            = client.GetDomainCategory(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #14
0
        public async Task GetDomainCategoryAsync2()
        {
            Mock <DomainCategoryService.DomainCategoryServiceClient> mockGrpcClient = new Mock <DomainCategoryService.DomainCategoryServiceClient>(MockBehavior.Strict);
            GetDomainCategoryRequest request = new GetDomainCategoryRequest
            {
                ResourceName = new DomainCategoryName("[CUSTOMER]", "[DOMAIN_CATEGORY]").ToString(),
            };
            DomainCategory expectedResponse = new DomainCategory
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetDomainCategoryAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <DomainCategory>(Task.FromResult(expectedResponse), null, null, null, null));
            DomainCategoryServiceClient client = new DomainCategoryServiceClientImpl(mockGrpcClient.Object, null);
            DomainCategory response            = await client.GetDomainCategoryAsync(request);

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