Beispiel #1
0
        /// <summary>
        /// Constructs a client wrapper for the ReportErrorsService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="ReportErrorsServiceSettings"/> used within this client </param>
        public ReportErrorsServiceClientImpl(ReportErrorsService.ReportErrorsServiceClient grpcClient, ReportErrorsServiceSettings settings)
        {
            this.GrpcClient = grpcClient;
            ReportErrorsServiceSettings effectiveSettings = settings ?? ReportErrorsServiceSettings.GetDefault();

            _clientHelper         = new ClientHelper(effectiveSettings);
            _callReportErrorEvent = _clientHelper.BuildApiCall <ReportErrorEventRequest, ReportErrorEventResponse>(
                GrpcClient.ReportErrorEventAsync, GrpcClient.ReportErrorEvent, effectiveSettings.ReportErrorEventSettings);
        }
Beispiel #2
0
 private ReportErrorsServiceSettings(ReportErrorsServiceSettings existing) : base(existing)
 {
     GaxPreconditions.CheckNotNull(existing, nameof(existing));
     ReportErrorEventSettings = existing.ReportErrorEventSettings;
 }
Beispiel #3
0
        /// <summary>
        /// Synchronously creates a <see cref="ReportErrorsServiceClient"/>, applying defaults for all unspecified settings,
        /// and creating a channel connecting to the given endpoint with application default credentials where
        /// necessary.
        /// </summary>
        /// <param name="endpoint">Optional <see cref="ServiceEndpoint"/>.</param>
        /// <param name="settings">Optional <see cref="ReportErrorsServiceSettings"/>.</param>
        /// <returns>The created <see cref="ReportErrorsServiceClient"/>.</returns>
        public static ReportErrorsServiceClient Create(ServiceEndpoint endpoint = null, ReportErrorsServiceSettings settings = null)
        {
            Channel channel = s_channelPool.GetChannel(endpoint ?? DefaultEndpoint);

            return(Create(channel, settings));
        }
Beispiel #4
0
 /// <summary>
 /// Creates a <see cref="ReportErrorsServiceClient"/> which uses the specified channel for remote operations.
 /// </summary>
 /// <param name="channel">The <see cref="Channel"/> for remote operations. Must not be null.</param>
 /// <param name="settings">Optional <see cref="ReportErrorsServiceSettings"/>.</param>
 /// <returns>The created <see cref="ReportErrorsServiceClient"/>.</returns>
 public static ReportErrorsServiceClient Create(Channel channel, ReportErrorsServiceSettings settings = null)
 {
     GaxPreconditions.CheckNotNull(channel, nameof(channel));
     ReportErrorsService.ReportErrorsServiceClient grpcClient = new ReportErrorsService.ReportErrorsServiceClient(channel);
     return(new ReportErrorsServiceClientImpl(grpcClient, settings));
 }
Beispiel #5
0
        // Note: we could have parameterless overloads of Create and CreateAsync,
        // documented to just use the default endpoint, settings and credentials.
        // Pros:
        // - Might be more reassuring on first use
        // - Allows method group conversions
        // Con: overloads!

        /// <summary>
        /// Asynchronously creates a <see cref="ReportErrorsServiceClient"/>, applying defaults for all unspecified settings,
        /// and creating a channel connecting to the given endpoint with application default credentials where
        /// necessary.
        /// </summary>
        /// <param name="endpoint">Optional <see cref="ServiceEndpoint"/>.</param>
        /// <param name="settings">Optional <see cref="ReportErrorsServiceSettings"/>.</param>
        /// <returns>The task representing the created <see cref="ReportErrorsServiceClient"/>.</returns>
        public static async Task <ReportErrorsServiceClient> CreateAsync(ServiceEndpoint endpoint = null, ReportErrorsServiceSettings settings = null)
        {
            Channel channel = await s_channelPool.GetChannelAsync(endpoint ?? DefaultEndpoint).ConfigureAwait(false);

            return(Create(channel, settings));
        }