public async stt::Task MutateCampaignAssetsAsync() { moq::Mock <CampaignAssetService.CampaignAssetServiceClient> mockGrpcClient = new moq::Mock <CampaignAssetService.CampaignAssetServiceClient>(moq::MockBehavior.Strict); MutateCampaignAssetsRequest request = new MutateCampaignAssetsRequest { CustomerId = "customer_id3b3724cb", Operations = { new CampaignAssetOperation(), }, }; MutateCampaignAssetsResponse expectedResponse = new MutateCampaignAssetsResponse { PartialFailureError = new gr::Status(), Results = { new MutateCampaignAssetResult(), }, }; mockGrpcClient.Setup(x => x.MutateCampaignAssetsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateCampaignAssetsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CampaignAssetServiceClient client = new CampaignAssetServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignAssetsResponse responseCallSettings = await client.MutateCampaignAssetsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MutateCampaignAssetsResponse responseCancellationToken = await client.MutateCampaignAssetsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateCampaignAssets() { moq::Mock <CampaignAssetService.CampaignAssetServiceClient> mockGrpcClient = new moq::Mock <CampaignAssetService.CampaignAssetServiceClient>(moq::MockBehavior.Strict); MutateCampaignAssetsRequest request = new MutateCampaignAssetsRequest { CustomerId = "customer_id3b3724cb", Operations = { new CampaignAssetOperation(), }, }; MutateCampaignAssetsResponse expectedResponse = new MutateCampaignAssetsResponse { PartialFailureError = new gr::Status(), Results = { new MutateCampaignAssetResult(), }, }; mockGrpcClient.Setup(x => x.MutateCampaignAssets(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CampaignAssetServiceClient client = new CampaignAssetServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignAssetsResponse response = client.MutateCampaignAssets(request.CustomerId, request.Operations); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateCampaignAssetsRequestObject() { moq::Mock <CampaignAssetService.CampaignAssetServiceClient> mockGrpcClient = new moq::Mock <CampaignAssetService.CampaignAssetServiceClient>(moq::MockBehavior.Strict); MutateCampaignAssetsRequest request = new MutateCampaignAssetsRequest { CustomerId = "customer_id3b3724cb", Operations = { new CampaignAssetOperation(), }, PartialFailure = false, ValidateOnly = true, ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly, }; MutateCampaignAssetsResponse expectedResponse = new MutateCampaignAssetsResponse { PartialFailureError = new gr::Status(), Results = { new MutateCampaignAssetResult(), }, }; mockGrpcClient.Setup(x => x.MutateCampaignAssets(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CampaignAssetServiceClient client = new CampaignAssetServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignAssetsResponse response = client.MutateCampaignAssets(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateCampaignAssets</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateCampaignAssetsRequestObject() { // Create client CampaignAssetServiceClient campaignAssetServiceClient = CampaignAssetServiceClient.Create(); // Initialize request argument(s) MutateCampaignAssetsRequest request = new MutateCampaignAssetsRequest { CustomerId = "", Operations = { new CampaignAssetOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateCampaignAssetsResponse response = campaignAssetServiceClient.MutateCampaignAssets(request); }
/// <summary>Snippet for MutateCampaignAssetsAsync</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 MutateCampaignAssetsRequestObjectAsync() { // Create client CampaignAssetServiceClient campaignAssetServiceClient = await CampaignAssetServiceClient.CreateAsync(); // Initialize request argument(s) MutateCampaignAssetsRequest request = new MutateCampaignAssetsRequest { CustomerId = "", Operations = { new CampaignAssetOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateCampaignAssetsResponse response = await campaignAssetServiceClient.MutateCampaignAssetsAsync(request); }
/// <summary>Snippet for MutateCampaignAssets</summary> public void MutateCampaignAssetsRequestObject() { // Snippet: MutateCampaignAssets(MutateCampaignAssetsRequest, CallSettings) // Create client CampaignAssetServiceClient campaignAssetServiceClient = CampaignAssetServiceClient.Create(); // Initialize request argument(s) MutateCampaignAssetsRequest request = new MutateCampaignAssetsRequest { CustomerId = "", Operations = { new CampaignAssetOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateCampaignAssetsResponse response = campaignAssetServiceClient.MutateCampaignAssets(request); // End snippet }
/// <summary>Snippet for MutateCampaignAssetsAsync</summary> public async Task MutateCampaignAssetsRequestObjectAsync() { // Snippet: MutateCampaignAssetsAsync(MutateCampaignAssetsRequest, CallSettings) // Additional: MutateCampaignAssetsAsync(MutateCampaignAssetsRequest, CancellationToken) // Create client CampaignAssetServiceClient campaignAssetServiceClient = await CampaignAssetServiceClient.CreateAsync(); // Initialize request argument(s) MutateCampaignAssetsRequest request = new MutateCampaignAssetsRequest { CustomerId = "", Operations = { new CampaignAssetOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateCampaignAssetsResponse response = await campaignAssetServiceClient.MutateCampaignAssetsAsync(request); // End snippet }
/// <summary> /// Creates or removes campaign assets. Operation statuses are returned. /// </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 <MutateCampaignAssetsResponse> MutateCampaignAssetsAsync(MutateCampaignAssetsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateCampaignAssetsRequest(ref request, ref callSettings); return(_callMutateCampaignAssets.Async(request, callSettings)); }
partial void Modify_MutateCampaignAssetsRequest(ref MutateCampaignAssetsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates or removes campaign assets. Operation statuses are returned. /// </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 <MutateCampaignAssetsResponse> MutateCampaignAssetsAsync(MutateCampaignAssetsRequest request, st::CancellationToken cancellationToken) => MutateCampaignAssetsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates or removes campaign assets. Operation statuses are returned. /// </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 <MutateCampaignAssetsResponse> MutateCampaignAssetsAsync(MutateCampaignAssetsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();