Exemplo n.º 1
0
 private ResourceSettingsServiceSettings(ResourceSettingsServiceSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     ListSettingsSettings  = existing.ListSettingsSettings;
     GetSettingSettings    = existing.GetSettingSettings;
     UpdateSettingSettings = existing.UpdateSettingSettings;
     OnCopy(existing);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs a client wrapper for the ResourceSettingsService service, with the specified gRPC client and
        /// settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">
        /// The base <see cref="ResourceSettingsServiceSettings"/> used within this client.
        /// </param>
        public ResourceSettingsServiceClientImpl(ResourceSettingsService.ResourceSettingsServiceClient grpcClient, ResourceSettingsServiceSettings settings)
        {
            GrpcClient = grpcClient;
            ResourceSettingsServiceSettings effectiveSettings = settings ?? ResourceSettingsServiceSettings.GetDefault();
            gaxgrpc::ClientHelper           clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callListSettings = clientHelper.BuildApiCall <ListSettingsRequest, ListSettingsResponse>(grpcClient.ListSettingsAsync, grpcClient.ListSettings, effectiveSettings.ListSettingsSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callListSettings);
            Modify_ListSettingsApiCall(ref _callListSettings);
            _callGetSetting = clientHelper.BuildApiCall <GetSettingRequest, Setting>(grpcClient.GetSettingAsync, grpcClient.GetSetting, effectiveSettings.GetSettingSettings).WithGoogleRequestParam("name", request => request.Name);
            Modify_ApiCall(ref _callGetSetting);
            Modify_GetSettingApiCall(ref _callGetSetting);
            _callUpdateSetting = clientHelper.BuildApiCall <UpdateSettingRequest, Setting>(grpcClient.UpdateSettingAsync, grpcClient.UpdateSetting, effectiveSettings.UpdateSettingSettings).WithGoogleRequestParam("setting.name", request => request.Setting?.Name);
            Modify_ApiCall(ref _callUpdateSetting);
            Modify_UpdateSettingApiCall(ref _callUpdateSetting);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Exemplo n.º 3
0
 partial void OnConstruction(ResourceSettingsService.ResourceSettingsServiceClient grpcClient, ResourceSettingsServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
Exemplo n.º 4
0
 partial void OnCopy(ResourceSettingsServiceSettings existing);
Exemplo n.º 5
0
        /// <summary>
        /// Creates a <see cref="ResourceSettingsServiceClient"/> 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="ResourceSettingsServiceSettings"/>.</param>
        /// <returns>The created <see cref="ResourceSettingsServiceClient"/>.</returns>
        internal static ResourceSettingsServiceClient Create(grpccore::CallInvoker callInvoker, ResourceSettingsServiceSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            ResourceSettingsService.ResourceSettingsServiceClient grpcClient = new ResourceSettingsService.ResourceSettingsServiceClient(callInvoker);
            return(new ResourceSettingsServiceClientImpl(grpcClient, settings));
        }