public void MutateCampaigns() { Mock <CampaignService.CampaignServiceClient> mockGrpcClient = new Mock <CampaignService.CampaignServiceClient>(MockBehavior.Strict); MutateCampaignsRequest expectedRequest = new MutateCampaignsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateCampaignsResponse expectedResponse = new MutateCampaignsResponse(); mockGrpcClient.Setup(x => x.MutateCampaigns(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); CampaignServiceClient client = new CampaignServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <CampaignOperation> operations = new List <CampaignOperation>(); MutateCampaignsResponse response = client.MutateCampaigns(customerId, operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateCampaigns</summary> public void MutateCampaignsRequestObject() { // Snippet: MutateCampaigns(MutateCampaignsRequest, CallSettings) // Create client CampaignServiceClient campaignServiceClient = CampaignServiceClient.Create(); // Initialize request argument(s) MutateCampaignsRequest request = new MutateCampaignsRequest { CustomerId = "", Operations = { new CampaignOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateCampaignsResponse response = campaignServiceClient.MutateCampaigns(request); // End snippet }
/// <summary>Snippet for MutateCampaignsAsync</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 MutateCampaignsRequestObjectAsync() { // Create client CampaignServiceClient campaignServiceClient = await CampaignServiceClient.CreateAsync(); // Initialize request argument(s) MutateCampaignsRequest request = new MutateCampaignsRequest { CustomerId = "", Operations = { new CampaignOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateCampaignsResponse response = await campaignServiceClient.MutateCampaignsAsync(request); }
public async Task MutateCampaignsAsync2() { Mock <CampaignService.CampaignServiceClient> mockGrpcClient = new Mock <CampaignService.CampaignServiceClient>(MockBehavior.Strict); MutateCampaignsRequest expectedRequest = new MutateCampaignsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateCampaignsResponse expectedResponse = new MutateCampaignsResponse(); mockGrpcClient.Setup(x => x.MutateCampaignsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateCampaignsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); CampaignServiceClient client = new CampaignServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <CampaignOperation> operations = new List <CampaignOperation>(); MutateCampaignsResponse response = await client.MutateCampaignsAsync(customerId, operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateCampaignsAsync</summary> public async Task MutateCampaignsRequestObjectAsync() { // Snippet: MutateCampaignsAsync(MutateCampaignsRequest, CallSettings) // Additional: MutateCampaignsAsync(MutateCampaignsRequest, CancellationToken) // Create client CampaignServiceClient campaignServiceClient = await CampaignServiceClient.CreateAsync(); // Initialize request argument(s) MutateCampaignsRequest request = new MutateCampaignsRequest { CustomerId = "", Operations = { new CampaignOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateCampaignsResponse response = await campaignServiceClient.MutateCampaignsAsync(request); // End snippet }
/// <summary> /// Creates, updates, or removes campaigns. Operation statuses are returned. /// /// List of thrown errors: /// [AdxError]() /// [AuthenticationError]() /// [AuthorizationError]() /// [BiddingError]() /// [BiddingStrategyError]() /// [CampaignBudgetError]() /// [CampaignError]() /// [ContextError]() /// [DatabaseError]() /// [DateError]() /// [DateRangeError]() /// [DistinctError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotAllowlistedError]() /// [NotEmptyError]() /// [NullError]() /// [OperationAccessDeniedError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RegionCodeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SettingError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// [UrlFieldError]() /// </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 <MutateCampaignsResponse> MutateCampaignsAsync(MutateCampaignsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateCampaignsRequest(ref request, ref callSettings); return(_callMutateCampaigns.Async(request, callSettings)); }
partial void Modify_MutateCampaignsRequest(ref MutateCampaignsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes campaigns. Operation statuses are returned. /// /// List of thrown errors: /// [AdxError]() /// [AuthenticationError]() /// [AuthorizationError]() /// [BiddingError]() /// [BiddingStrategyError]() /// [CampaignBudgetError]() /// [CampaignError]() /// [ContextError]() /// [DatabaseError]() /// [DateError]() /// [DateRangeError]() /// [DistinctError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotAllowlistedError]() /// [NotEmptyError]() /// [NullError]() /// [OperationAccessDeniedError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RegionCodeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SettingError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// [UrlFieldError]() /// </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 <MutateCampaignsResponse> MutateCampaignsAsync(MutateCampaignsRequest request, st::CancellationToken cancellationToken) => MutateCampaignsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes campaigns. Operation statuses are returned. /// /// List of thrown errors: /// [AdxError]() /// [AuthenticationError]() /// [AuthorizationError]() /// [BiddingError]() /// [BiddingStrategyError]() /// [CampaignBudgetError]() /// [CampaignError]() /// [ContextError]() /// [DatabaseError]() /// [DateError]() /// [DateRangeError]() /// [DistinctError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotAllowlistedError]() /// [NotEmptyError]() /// [NullError]() /// [OperationAccessDeniedError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RegionCodeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SettingError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// [UrlFieldError]() /// </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 <MutateCampaignsResponse> MutateCampaignsAsync(MutateCampaignsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();