コード例 #1
0
ファイル: DsmAutoBlockApi.cs プロジェクト: nvincent/DsmWebApi
 /// <summary>
 /// Sets the Auto Block configuration.
 /// </summary>
 /// <param name="configuration">The new value of the configuration.</param>
 /// <returns>The response of the set configuration request.</returns>
 public async Task<DsmApiResponse> SetConfig(DsmAutoBlockConfiguration configuration)
 {
     DsmApiResponse response = await this.ApiContext.Request(
         this.ApiInfo.Path,
         DsmAutoBlockApiName,
         this.ApiInfo.MaxVersion,
         "setconfig",
         new Dictionary<string, string>()
         {
             { "attemptmin", configuration.AttemptsPeriod.ToString(CultureInfo.InvariantCulture) },
             { "attempts", configuration.Attempts.ToString(CultureInfo.InvariantCulture) },
             { "expiredday", configuration.ExpiredDay.ToString(CultureInfo.InvariantCulture) }
         });
     return response;
 }
コード例 #2
0
        /// <summary>
        /// Sets the Auto Block configuration.
        /// </summary>
        /// <param name="configuration">The new value of the configuration.</param>
        /// <returns>The response of the set configuration request.</returns>
        public async Task <DsmApiResponse> SetConfig(DsmAutoBlockConfiguration configuration)
        {
            DsmApiResponse response = await this.ApiContext.Request(
                this.ApiInfo.Path,
                DsmAutoBlockApiName,
                this.ApiInfo.MaxVersion,
                "setconfig",
                new Dictionary <string, string>()
            {
                { "attemptmin", configuration.AttemptsPeriod.ToString(CultureInfo.InvariantCulture) },
                { "attempts", configuration.Attempts.ToString(CultureInfo.InvariantCulture) },
                { "expiredday", configuration.ExpiredDay.ToString(CultureInfo.InvariantCulture) }
            });

            return(response);
        }