コード例 #1
0
 private PredictionApiKeyRegistrySettings(PredictionApiKeyRegistrySettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     CreatePredictionApiKeyRegistrationSettings = existing.CreatePredictionApiKeyRegistrationSettings;
     ListPredictionApiKeyRegistrationsSettings  = existing.ListPredictionApiKeyRegistrationsSettings;
     DeletePredictionApiKeyRegistrationSettings = existing.DeletePredictionApiKeyRegistrationSettings;
     OnCopy(existing);
 }
コード例 #2
0
        /// <summary>
        /// Constructs a client wrapper for the PredictionApiKeyRegistry service, with the specified gRPC client and
        /// settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">
        /// The base <see cref="PredictionApiKeyRegistrySettings"/> used within this client.
        /// </param>
        public PredictionApiKeyRegistryClientImpl(PredictionApiKeyRegistry.PredictionApiKeyRegistryClient grpcClient, PredictionApiKeyRegistrySettings settings)
        {
            GrpcClient = grpcClient;
            PredictionApiKeyRegistrySettings effectiveSettings = settings ?? PredictionApiKeyRegistrySettings.GetDefault();
            gaxgrpc::ClientHelper            clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callCreatePredictionApiKeyRegistration = clientHelper.BuildApiCall <CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration>(grpcClient.CreatePredictionApiKeyRegistrationAsync, grpcClient.CreatePredictionApiKeyRegistration, effectiveSettings.CreatePredictionApiKeyRegistrationSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callCreatePredictionApiKeyRegistration);
            Modify_CreatePredictionApiKeyRegistrationApiCall(ref _callCreatePredictionApiKeyRegistration);
            _callListPredictionApiKeyRegistrations = clientHelper.BuildApiCall <ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse>(grpcClient.ListPredictionApiKeyRegistrationsAsync, grpcClient.ListPredictionApiKeyRegistrations, effectiveSettings.ListPredictionApiKeyRegistrationsSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callListPredictionApiKeyRegistrations);
            Modify_ListPredictionApiKeyRegistrationsApiCall(ref _callListPredictionApiKeyRegistrations);
            _callDeletePredictionApiKeyRegistration = clientHelper.BuildApiCall <DeletePredictionApiKeyRegistrationRequest, wkt::Empty>(grpcClient.DeletePredictionApiKeyRegistrationAsync, grpcClient.DeletePredictionApiKeyRegistration, effectiveSettings.DeletePredictionApiKeyRegistrationSettings).WithGoogleRequestParam("name", request => request.Name);
            Modify_ApiCall(ref _callDeletePredictionApiKeyRegistration);
            Modify_DeletePredictionApiKeyRegistrationApiCall(ref _callDeletePredictionApiKeyRegistration);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
コード例 #3
0
 partial void OnConstruction(PredictionApiKeyRegistry.PredictionApiKeyRegistryClient grpcClient, PredictionApiKeyRegistrySettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
コード例 #4
0
 partial void OnCopy(PredictionApiKeyRegistrySettings existing);
コード例 #5
0
        /// <summary>
        /// Creates a <see cref="PredictionApiKeyRegistryClient"/> 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="PredictionApiKeyRegistrySettings"/>.</param>
        /// <returns>The created <see cref="PredictionApiKeyRegistryClient"/>.</returns>
        internal static PredictionApiKeyRegistryClient Create(grpccore::CallInvoker callInvoker, PredictionApiKeyRegistrySettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            PredictionApiKeyRegistry.PredictionApiKeyRegistryClient grpcClient = new PredictionApiKeyRegistry.PredictionApiKeyRegistryClient(callInvoker);
            return(new PredictionApiKeyRegistryClientImpl(grpcClient, settings));
        }