/// <summary>Snippet for GetMobileDeviceConstant</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetMobileDeviceConstantResourceNames() { // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = MobileDeviceConstantServiceClient.Create(); // Initialize request argument(s) MobileDeviceConstantName resourceName = MobileDeviceConstantName.FromCriterion("[CRITERION_ID]"); // Make the request MobileDeviceConstant response = mobileDeviceConstantServiceClient.GetMobileDeviceConstant(resourceName); }
/// <summary>Snippet for GetMobileDeviceConstant</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetMobileDeviceConstantResourceNames() { // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = MobileDeviceConstantServiceClient.Create(); // Initialize request argument(s) MobileDeviceConstantName resourceName = MobileDeviceConstantName.FromMobileDeviceConstant("[MOBILE_DEVICE_CONSTANT]"); // Make the request MobileDeviceConstant response = mobileDeviceConstantServiceClient.GetMobileDeviceConstant(resourceName); }
/// <summary>Snippet for GetMobileDeviceConstantAsync</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 GetMobileDeviceConstantResourceNamesAsync() { // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = await MobileDeviceConstantServiceClient.CreateAsync(); // Initialize request argument(s) MobileDeviceConstantName resourceName = MobileDeviceConstantName.FromMobileDeviceConstant("[MOBILE_DEVICE_CONSTANT]"); // Make the request MobileDeviceConstant response = await mobileDeviceConstantServiceClient.GetMobileDeviceConstantAsync(resourceName); }
/// <summary>Snippet for GetMobileDeviceConstantAsync</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 GetMobileDeviceConstantResourceNamesAsync() { // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = await MobileDeviceConstantServiceClient.CreateAsync(); // Initialize request argument(s) MobileDeviceConstantName resourceName = MobileDeviceConstantName.FromCriterion("[CRITERION_ID]"); // Make the request MobileDeviceConstant response = await mobileDeviceConstantServiceClient.GetMobileDeviceConstantAsync(resourceName); }
/// <summary>Snippet for GetMobileDeviceConstant</summary> public void GetMobileDeviceConstantRequestObject() { // Snippet: GetMobileDeviceConstant(GetMobileDeviceConstantRequest, CallSettings) // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = MobileDeviceConstantServiceClient.Create(); // Initialize request argument(s) GetMobileDeviceConstantRequest request = new GetMobileDeviceConstantRequest { ResourceNameAsMobileDeviceConstantName = MobileDeviceConstantName.FromCriterion("[CRITERION_ID]"), }; // Make the request MobileDeviceConstant response = mobileDeviceConstantServiceClient.GetMobileDeviceConstant(request); // End snippet }
/// <summary>Snippet for GetMobileDeviceConstantAsync</summary> public async Task GetMobileDeviceConstantResourceNamesAsync() { // Snippet: GetMobileDeviceConstantAsync(MobileDeviceConstantName, CallSettings) // Additional: GetMobileDeviceConstantAsync(MobileDeviceConstantName, CancellationToken) // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = await MobileDeviceConstantServiceClient.CreateAsync(); // Initialize request argument(s) MobileDeviceConstantName resourceName = MobileDeviceConstantName.FromCriterion("[CRITERION_ID]"); // Make the request MobileDeviceConstant response = await mobileDeviceConstantServiceClient.GetMobileDeviceConstantAsync(resourceName); // End snippet }
/// <summary>Snippet for GetMobileDeviceConstant</summary> public void GetMobileDeviceConstantRequestObject() { // Snippet: GetMobileDeviceConstant(GetMobileDeviceConstantRequest, CallSettings) // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = MobileDeviceConstantServiceClient.Create(); // Initialize request argument(s) GetMobileDeviceConstantRequest request = new GetMobileDeviceConstantRequest { ResourceNameAsMobileDeviceConstantName = MobileDeviceConstantName.FromMobileDeviceConstant("[MOBILE_DEVICE_CONSTANT]"), }; // Make the request MobileDeviceConstant response = mobileDeviceConstantServiceClient.GetMobileDeviceConstant(request); // End snippet }
/// <summary>Snippet for GetMobileDeviceConstantAsync</summary> public async Task GetMobileDeviceConstantRequestObjectAsync() { // Snippet: GetMobileDeviceConstantAsync(GetMobileDeviceConstantRequest, CallSettings) // Additional: GetMobileDeviceConstantAsync(GetMobileDeviceConstantRequest, CancellationToken) // Create client MobileDeviceConstantServiceClient mobileDeviceConstantServiceClient = await MobileDeviceConstantServiceClient.CreateAsync(); // Initialize request argument(s) GetMobileDeviceConstantRequest request = new GetMobileDeviceConstantRequest { ResourceNameAsMobileDeviceConstantName = MobileDeviceConstantName.FromMobileDeviceConstant("[MOBILE_DEVICE_CONSTANT]"), }; // Make the request MobileDeviceConstant response = await mobileDeviceConstantServiceClient.GetMobileDeviceConstantAsync(request); // End snippet }
public async Task GetMobileDeviceConstantAsync() { Mock <MobileDeviceConstantService.MobileDeviceConstantServiceClient> mockGrpcClient = new Mock <MobileDeviceConstantService.MobileDeviceConstantServiceClient>(MockBehavior.Strict); GetMobileDeviceConstantRequest expectedRequest = new GetMobileDeviceConstantRequest { ResourceName = new MobileDeviceConstantName("[MOBILE_DEVICE_CONSTANT]").ToString(), }; MobileDeviceConstant expectedResponse = new MobileDeviceConstant { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetMobileDeviceConstantAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MobileDeviceConstant>(Task.FromResult(expectedResponse), null, null, null, null)); MobileDeviceConstantServiceClient client = new MobileDeviceConstantServiceClientImpl(mockGrpcClient.Object, null); string formattedResourceName = new MobileDeviceConstantName("[MOBILE_DEVICE_CONSTANT]").ToString(); MobileDeviceConstant response = await client.GetMobileDeviceConstantAsync(formattedResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }