private ProfilerServiceSettings(ProfilerServiceSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); CreateProfileSettings = existing.CreateProfileSettings; CreateOfflineProfileSettings = existing.CreateOfflineProfileSettings; UpdateProfileSettings = existing.UpdateProfileSettings; OnCopy(existing); }
/// <summary> /// Constructs a client wrapper for the ProfilerService service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="ProfilerServiceSettings"/> used within this client.</param> public ProfilerServiceClientImpl(ProfilerService.ProfilerServiceClient grpcClient, ProfilerServiceSettings settings) { GrpcClient = grpcClient; ProfilerServiceSettings effectiveSettings = settings ?? ProfilerServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callCreateProfile = clientHelper.BuildApiCall <CreateProfileRequest, Profile>(grpcClient.CreateProfileAsync, grpcClient.CreateProfile, effectiveSettings.CreateProfileSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callCreateProfile); Modify_CreateProfileApiCall(ref _callCreateProfile); _callCreateOfflineProfile = clientHelper.BuildApiCall <CreateOfflineProfileRequest, Profile>(grpcClient.CreateOfflineProfileAsync, grpcClient.CreateOfflineProfile, effectiveSettings.CreateOfflineProfileSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callCreateOfflineProfile); Modify_CreateOfflineProfileApiCall(ref _callCreateOfflineProfile); _callUpdateProfile = clientHelper.BuildApiCall <UpdateProfileRequest, Profile>(grpcClient.UpdateProfileAsync, grpcClient.UpdateProfile, effectiveSettings.UpdateProfileSettings).WithGoogleRequestParam("profile.name", request => request.Profile?.Name); Modify_ApiCall(ref _callUpdateProfile); Modify_UpdateProfileApiCall(ref _callUpdateProfile); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnCopy(ProfilerServiceSettings existing);
partial void OnConstruction(ProfilerService.ProfilerServiceClient grpcClient, ProfilerServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
/// <summary> /// Creates a <see cref="ProfilerServiceClient"/> 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="ProfilerServiceSettings"/>.</param> /// <returns>The created <see cref="ProfilerServiceClient"/>.</returns> internal static ProfilerServiceClient Create(grpccore::CallInvoker callInvoker, ProfilerServiceSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } ProfilerService.ProfilerServiceClient grpcClient = new ProfilerService.ProfilerServiceClient(callInvoker); return(new ProfilerServiceClientImpl(grpcClient, settings)); }