Esempio n. 1
0
 private AcceleratorTypesSettings(AcceleratorTypesSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     AggregatedListSettings = existing.AggregatedListSettings;
     GetSettings            = existing.GetSettings;
     ListSettings           = existing.ListSettings;
     OnCopy(existing);
 }
Esempio n. 2
0
        /// <summary>
        /// Constructs a client wrapper for the AcceleratorTypes service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="AcceleratorTypesSettings"/> used within this client.</param>
        public AcceleratorTypesClientImpl(AcceleratorTypes.AcceleratorTypesClient grpcClient, AcceleratorTypesSettings settings)
        {
            GrpcClient = grpcClient;
            AcceleratorTypesSettings effectiveSettings = settings ?? AcceleratorTypesSettings.GetDefault();
            gaxgrpc::ClientHelper    clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callAggregatedList = clientHelper.BuildApiCall <AggregatedListAcceleratorTypesRequest, AcceleratorTypeAggregatedList>(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project);
            Modify_ApiCall(ref _callAggregatedList);
            Modify_AggregatedListApiCall(ref _callAggregatedList);
            _callGet = clientHelper.BuildApiCall <GetAcceleratorTypeRequest, AcceleratorType>(grpcClient.GetAsync, grpcClient.Get, effectiveSettings.GetSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("accelerator_type", request => request.AcceleratorType);
            Modify_ApiCall(ref _callGet);
            Modify_GetApiCall(ref _callGet);
            _callList = clientHelper.BuildApiCall <ListAcceleratorTypesRequest, AcceleratorTypeList>(grpcClient.ListAsync, grpcClient.List, effectiveSettings.ListSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone);
            Modify_ApiCall(ref _callList);
            Modify_ListApiCall(ref _callList);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Esempio n. 3
0
 partial void OnConstruction(AcceleratorTypes.AcceleratorTypesClient grpcClient, AcceleratorTypesSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
Esempio n. 4
0
 partial void OnCopy(AcceleratorTypesSettings existing);
Esempio n. 5
0
        /// <summary>
        /// Creates a <see cref="AcceleratorTypesClient"/> 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="AcceleratorTypesSettings"/>.</param>
        /// <returns>The created <see cref="AcceleratorTypesClient"/>.</returns>
        internal static AcceleratorTypesClient Create(grpccore::CallInvoker callInvoker, AcceleratorTypesSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            AcceleratorTypes.AcceleratorTypesClient grpcClient = new AcceleratorTypes.AcceleratorTypesClient(callInvoker);
            return(new AcceleratorTypesClientImpl(grpcClient, settings));
        }