Exemplo n.º 1
0
        /// <summary>Set default options for all requests.</summary>
        /// <param name="options">The options to set. (Fields set to <c>null</c> won't change the current value.)</param>
        public IClient SetOptions(FluentClientOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            this.Options.MergeFrom(options);

            return(this);
        }
        /// <summary>Set default options for all requests.</summary>
        /// <param name="options">The options to set. (Fields set to <c>null</c> won't change the current value.)</param>
        public IClient SetOptions(FluentClientOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (options.IgnoreHttpErrors.HasValue)
            {
                this.Options.IgnoreHttpErrors = options.IgnoreHttpErrors;
            }
            if (options.IgnoreNullArguments.HasValue)
            {
                this.Options.IgnoreNullArguments = options.IgnoreNullArguments;
            }

            return(this);
        }