private IAMPolicySettings(IAMPolicySettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     SetIamPolicySettings       = existing.SetIamPolicySettings;
     GetIamPolicySettings       = existing.GetIamPolicySettings;
     TestIamPermissionsSettings = existing.TestIamPermissionsSettings;
     OnCopy(existing);
 }
        /// <summary>
        /// Creates a <see cref="IAMPolicyClient"/> 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="IAMPolicySettings"/>.</param>
        /// <returns>The created <see cref="IAMPolicyClient"/>.</returns>
        internal static IAMPolicyClient Create(grpccore::CallInvoker callInvoker, IAMPolicySettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            IAMPolicy.IAMPolicyClient grpcClient = new IAMPolicy.IAMPolicyClient(callInvoker);
            return(new IAMPolicyClientImpl(grpcClient, settings));
        }
        /// <summary>
        /// Constructs a client wrapper for the IAMPolicy service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="IAMPolicySettings"/> used within this client.</param>
        public IAMPolicyClientImpl(IAMPolicy.IAMPolicyClient grpcClient, IAMPolicySettings settings)
        {
            GrpcClient = grpcClient;
            IAMPolicySettings     effectiveSettings = settings ?? IAMPolicySettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callSetIamPolicy = clientHelper.BuildApiCall <SetIamPolicyRequest, Policy>(grpcClient.SetIamPolicyAsync, grpcClient.SetIamPolicy, effectiveSettings.SetIamPolicySettings).WithGoogleRequestParam("resource", request => request.Resource);
            Modify_ApiCall(ref _callSetIamPolicy);
            Modify_SetIamPolicyApiCall(ref _callSetIamPolicy);
            _callGetIamPolicy = clientHelper.BuildApiCall <GetIamPolicyRequest, Policy>(grpcClient.GetIamPolicyAsync, grpcClient.GetIamPolicy, effectiveSettings.GetIamPolicySettings).WithGoogleRequestParam("resource", request => request.Resource);
            Modify_ApiCall(ref _callGetIamPolicy);
            Modify_GetIamPolicyApiCall(ref _callGetIamPolicy);
            _callTestIamPermissions = clientHelper.BuildApiCall <TestIamPermissionsRequest, TestIamPermissionsResponse>(grpcClient.TestIamPermissionsAsync, grpcClient.TestIamPermissions, effectiveSettings.TestIamPermissionsSettings).WithGoogleRequestParam("resource", request => request.Resource);
            Modify_ApiCall(ref _callTestIamPermissions);
            Modify_TestIamPermissionsApiCall(ref _callTestIamPermissions);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
 partial void OnCopy(IAMPolicySettings existing);
 partial void OnConstruction(IAMPolicy.IAMPolicyClient grpcClient, IAMPolicySettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);