public async stt::Task GetPublisherAccountRequestObjectAsync() { moq::Mock <AdMobApi.AdMobApiClient> mockGrpcClient = new moq::Mock <AdMobApi.AdMobApiClient>(moq::MockBehavior.Strict); GetPublisherAccountRequest request = new GetPublisherAccountRequest { Name = "name1c9368b0", }; PublisherAccount expectedResponse = new PublisherAccount { PublisherAccountName = PublisherAccountName.FromPublisher("[PUBLISHER]"), PublisherId = "publisher_ideacb0426", ReportingTimeZone = "reporting_time_zonee4c984d5", CurrencyCode = "currency_code7f81e352", }; mockGrpcClient.Setup(x => x.GetPublisherAccountAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <PublisherAccount>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AdMobApiClient client = new AdMobApiClientImpl(mockGrpcClient.Object, null); PublisherAccount responseCallSettings = await client.GetPublisherAccountAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); PublisherAccount responseCancellationToken = await client.GetPublisherAccountAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for GetPublisherAccount</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetPublisherAccountRequestObject() { // Create client AdMobApiClient adMobApiClient = AdMobApiClient.Create(); // Initialize request argument(s) GetPublisherAccountRequest request = new GetPublisherAccountRequest { Name = "", }; // Make the request PublisherAccount response = adMobApiClient.GetPublisherAccount(request); }
/// <summary>Snippet for GetPublisherAccountAsync</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 GetPublisherAccountRequestObjectAsync() { // Create client AdMobApiClient adMobApiClient = await AdMobApiClient.CreateAsync(); // Initialize request argument(s) GetPublisherAccountRequest request = new GetPublisherAccountRequest { Name = "", }; // Make the request PublisherAccount response = await adMobApiClient.GetPublisherAccountAsync(request); }
/// <summary>Snippet for GetPublisherAccountAsync</summary> public async Task GetPublisherAccountRequestObjectAsync() { // Snippet: GetPublisherAccountAsync(GetPublisherAccountRequest, CallSettings) // Additional: GetPublisherAccountAsync(GetPublisherAccountRequest, CancellationToken) // Create client AdMobApiClient adMobApiClient = await AdMobApiClient.CreateAsync(); // Initialize request argument(s) GetPublisherAccountRequest request = new GetPublisherAccountRequest { Name = "", }; // Make the request PublisherAccount response = await adMobApiClient.GetPublisherAccountAsync(request); // End snippet }
public void GetPublisherAccount() { moq::Mock <AdMobApi.AdMobApiClient> mockGrpcClient = new moq::Mock <AdMobApi.AdMobApiClient>(moq::MockBehavior.Strict); GetPublisherAccountRequest request = new GetPublisherAccountRequest { Name = "name1c9368b0", }; PublisherAccount expectedResponse = new PublisherAccount { PublisherAccountName = PublisherAccountName.FromPublisher("[PUBLISHER]"), PublisherId = "publisher_ideacb0426", ReportingTimeZone = "reporting_time_zonee4c984d5", CurrencyCode = "currency_code7f81e352", }; mockGrpcClient.Setup(x => x.GetPublisherAccount(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AdMobApiClient client = new AdMobApiClientImpl(mockGrpcClient.Object, null); PublisherAccount response = client.GetPublisherAccount(request.Name); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Gets information about the specified AdMob publisher account. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public override stt::Task <PublisherAccount> GetPublisherAccountAsync(GetPublisherAccountRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_GetPublisherAccountRequest(ref request, ref callSettings); return(_callGetPublisherAccount.Async(request, callSettings)); }
/// <summary> /// Gets information about the specified AdMob publisher account. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>The RPC response.</returns> public override PublisherAccount GetPublisherAccount(GetPublisherAccountRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_GetPublisherAccountRequest(ref request, ref callSettings); return(_callGetPublisherAccount.Sync(request, callSettings)); }
partial void Modify_GetPublisherAccountRequest(ref GetPublisherAccountRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Gets information about the specified AdMob publisher account. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <PublisherAccount> GetPublisherAccountAsync(GetPublisherAccountRequest request, st::CancellationToken cancellationToken) => GetPublisherAccountAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Gets information about the specified AdMob publisher account. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <PublisherAccount> GetPublisherAccountAsync(GetPublisherAccountRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Gets information about the specified AdMob publisher account. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>The RPC response.</returns> public virtual PublisherAccount GetPublisherAccount(GetPublisherAccountRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();