Esempio n. 1
0
        /// <summary>
        /// Constructs a client wrapper for the MediaFileService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="MediaFileServiceSettings"/> used within this client.</param>
        public MediaFileServiceClientImpl(MediaFileService.MediaFileServiceClient grpcClient, MediaFileServiceSettings settings)
        {
            GrpcClient = grpcClient;
            MediaFileServiceSettings effectiveSettings = settings ?? MediaFileServiceSettings.GetDefault();
            gaxgrpc::ClientHelper    clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetMediaFile = clientHelper.BuildApiCall <GetMediaFileRequest, gagvr::MediaFile>(grpcClient.GetMediaFileAsync, grpcClient.GetMediaFile, effectiveSettings.GetMediaFileSettings).WithGoogleRequestParam("resource_name", request => request.ResourceName);
            Modify_ApiCall(ref _callGetMediaFile);
            Modify_GetMediaFileApiCall(ref _callGetMediaFile);
            _callMutateMediaFiles = clientHelper.BuildApiCall <MutateMediaFilesRequest, MutateMediaFilesResponse>(grpcClient.MutateMediaFilesAsync, grpcClient.MutateMediaFiles, effectiveSettings.MutateMediaFilesSettings).WithGoogleRequestParam("customer_id", request => request.CustomerId);
            Modify_ApiCall(ref _callMutateMediaFiles);
            Modify_MutateMediaFilesApiCall(ref _callMutateMediaFiles);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Esempio n. 2
0
        /// <summary>
        /// Constructs a client wrapper for the MediaFileService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="MediaFileServiceSettings"/> used within this client </param>
        public MediaFileServiceClientImpl(MediaFileService.MediaFileServiceClient grpcClient, MediaFileServiceSettings settings)
        {
            GrpcClient = grpcClient;
            MediaFileServiceSettings effectiveSettings = settings ?? MediaFileServiceSettings.GetDefault();
            gaxgrpc::ClientHelper    clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetMediaFile = clientHelper.BuildApiCall <GetMediaFileRequest, gagvr::MediaFile>(
                GrpcClient.GetMediaFileAsync, GrpcClient.GetMediaFile, effectiveSettings.GetMediaFileSettings)
                                .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"resource_name={request.ResourceName}"));
            _callMutateMediaFiles = clientHelper.BuildApiCall <MutateMediaFilesRequest, MutateMediaFilesResponse>(
                GrpcClient.MutateMediaFilesAsync, GrpcClient.MutateMediaFiles, effectiveSettings.MutateMediaFilesSettings)
                                    .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"customer_id={request.CustomerId}"));
            Modify_ApiCall(ref _callGetMediaFile);
            Modify_GetMediaFileApiCall(ref _callGetMediaFile);
            Modify_ApiCall(ref _callMutateMediaFiles);
            Modify_MutateMediaFilesApiCall(ref _callMutateMediaFiles);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }