/// <summary> /// Constructs a client wrapper for the Firewall service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="FirewallSettings"/> used within this client.</param> public FirewallClientImpl(Firewall.FirewallClient grpcClient, FirewallSettings settings) { GrpcClient = grpcClient; FirewallSettings effectiveSettings = settings ?? FirewallSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callListIngressRules = clientHelper.BuildApiCall <ListIngressRulesRequest, ListIngressRulesResponse>(grpcClient.ListIngressRulesAsync, grpcClient.ListIngressRules, effectiveSettings.ListIngressRulesSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callListIngressRules); Modify_ListIngressRulesApiCall(ref _callListIngressRules); _callBatchUpdateIngressRules = clientHelper.BuildApiCall <BatchUpdateIngressRulesRequest, BatchUpdateIngressRulesResponse>(grpcClient.BatchUpdateIngressRulesAsync, grpcClient.BatchUpdateIngressRules, effectiveSettings.BatchUpdateIngressRulesSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callBatchUpdateIngressRules); Modify_BatchUpdateIngressRulesApiCall(ref _callBatchUpdateIngressRules); _callCreateIngressRule = clientHelper.BuildApiCall <CreateIngressRuleRequest, FirewallRule>(grpcClient.CreateIngressRuleAsync, grpcClient.CreateIngressRule, effectiveSettings.CreateIngressRuleSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callCreateIngressRule); Modify_CreateIngressRuleApiCall(ref _callCreateIngressRule); _callGetIngressRule = clientHelper.BuildApiCall <GetIngressRuleRequest, FirewallRule>(grpcClient.GetIngressRuleAsync, grpcClient.GetIngressRule, effectiveSettings.GetIngressRuleSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callGetIngressRule); Modify_GetIngressRuleApiCall(ref _callGetIngressRule); _callUpdateIngressRule = clientHelper.BuildApiCall <UpdateIngressRuleRequest, FirewallRule>(grpcClient.UpdateIngressRuleAsync, grpcClient.UpdateIngressRule, effectiveSettings.UpdateIngressRuleSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callUpdateIngressRule); Modify_UpdateIngressRuleApiCall(ref _callUpdateIngressRule); _callDeleteIngressRule = clientHelper.BuildApiCall <DeleteIngressRuleRequest, wkt::Empty>(grpcClient.DeleteIngressRuleAsync, grpcClient.DeleteIngressRule, effectiveSettings.DeleteIngressRuleSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callDeleteIngressRule); Modify_DeleteIngressRuleApiCall(ref _callDeleteIngressRule); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Creates a <see cref="FirewallClient"/> which uses the specified call invoker for remote operations. /// </summary> /// <param name="callInvoker"> /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null. /// </param> /// <param name="settings">Optional <see cref="FirewallSettings"/>.</param> /// <returns>The created <see cref="FirewallClient"/>.</returns> internal static FirewallClient Create(grpccore::CallInvoker callInvoker, FirewallSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } Firewall.FirewallClient grpcClient = new Firewall.FirewallClient(callInvoker); return(new FirewallClientImpl(grpcClient, settings)); }
partial void OnConstruction(Firewall.FirewallClient grpcClient, FirewallSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);