コード例 #1
0
        public ResourceRateLimit(RateLimit core, RateLimit search)
        {
            Ensure.ArgumentNotNull(core, "core");
            Ensure.ArgumentNotNull(search, "search");

            Core   = core;
            Search = search;
        }
コード例 #2
0
        public MiscellaneousRateLimit(ResourceRateLimit resources, RateLimit rate)
        {
            Ensure.ArgumentNotNull(resources, "resource");
            Ensure.ArgumentNotNull(rate, "rate");

            Resources = resources;
            Rate = rate;
        }
コード例 #3
0
        /// <summary>
        /// Constructs an instance of RateLimitExceededException
        /// </summary>
        /// <param name="response">The HTTP payload from the server</param>
        /// <param name="innerException">The inner exception</param>
        public RateLimitExceededException(IResponse response, Exception innerException) : base(response, innerException)
        {
            Ensure.ArgumentNotNull(response, nameof(response));

            _rateLimit = response.ApiInfo.RateLimit;

            _severTimeDiff = response.ApiInfo.ServerTimeDifference;
        }
コード例 #4
0
        public ResourceRateLimit(RateLimit core, RateLimit search)
        {
            Ensure.ArgumentNotNull(core, "core");
            Ensure.ArgumentNotNull(search, "search");

            Core = core;
            Search = search;
        }
コード例 #5
0
        public MiscellaneousRateLimit(ResourceRateLimit resources, RateLimit rate)
        {
            Ensure.ArgumentNotNull(resources, "resource");
            Ensure.ArgumentNotNull(rate, "rate");

            Resources = resources;
            Rate      = rate;
        }
コード例 #6
0
        public ResourceRateLimit(RateLimit core, RateLimit search)
        {
            Ensure.ArgumentNotNull(core, nameof(core));
            Ensure.ArgumentNotNull(search, nameof(search));

            Core   = core;
            Search = search;
        }
コード例 #7
0
ファイル: ApiInfo.cs プロジェクト: stevepentland/octokit.net
 /// <summary>
 /// Allows you to clone ApiInfo
 /// </summary>
 /// <returns>A clone of <seealso cref="ApiInfo"/></returns>
 public ApiInfo Clone()
 {
     return(new ApiInfo(Links.Clone(),
                        OauthScopes.Clone(),
                        AcceptedOauthScopes.Clone(),
                        Etag != null ? new string(Etag.ToCharArray()) : null,
                        RateLimit != null ? RateLimit.Clone() : null,
                        ServerTimeDifference));
 }
コード例 #8
0
 /// <summary>
 /// Constructs an instance of RateLimitExceededException
 /// </summary>
 /// <param name="info">
 /// The <see cref="SerializationInfo"/> that holds the
 /// serialized object data about the exception being thrown.
 /// </param>
 /// <param name="context">
 /// The <see cref="StreamingContext"/> that contains
 /// contextual information about the source or destination.
 /// </param>
 protected RateLimitExceededException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _rateLimit = info.GetValue("RateLimit", typeof(RateLimit)) as RateLimit
                  ?? new RateLimit(new Dictionary <string, string>());
     if (info.GetValue(nameof(ApiInfo.ServerTimeDifference), typeof(TimeSpan)) is TimeSpan serverTimeDiff)
     {
         _severTimeDiff = serverTimeDiff;
     }
 }
コード例 #9
0
ファイル: ApiInfo.cs プロジェクト: alexgyori/octokit.net
        public ApiInfo(IDictionary<string, Uri> links,
            IList<string> oauthScopes,
            IList<string> acceptedOauthScopes,
            string etag,
            RateLimit rateLimit)
        {
            Ensure.ArgumentNotNull(links, "links");
            Ensure.ArgumentNotNull(oauthScopes, "oauthScopes");

            Links = new ReadOnlyDictionary<string, Uri>(links);
            OauthScopes = new ReadOnlyCollection<string>(oauthScopes);
            AcceptedOauthScopes = new ReadOnlyCollection<string>(acceptedOauthScopes);
            Etag = etag;
            RateLimit = rateLimit;
        }
コード例 #10
0
ファイル: ApiInfo.cs プロジェクト: zubanova/octokit.net
        public ApiInfo(IDictionary <string, Uri> links,
                       IList <string> oauthScopes,
                       IList <string> acceptedOauthScopes,
                       string etag,
                       RateLimit rateLimit)
        {
            Ensure.ArgumentNotNull(links, "links");
            Ensure.ArgumentNotNull(oauthScopes, "oauthScopes");

            Links               = new ReadOnlyDictionary <string, Uri>(links);
            OauthScopes         = new ReadOnlyCollection <string>(oauthScopes);
            AcceptedOauthScopes = new ReadOnlyCollection <string>(acceptedOauthScopes);
            Etag      = etag;
            RateLimit = rateLimit;
        }
コード例 #11
0
ファイル: ApiInfo.cs プロジェクト: stevepentland/octokit.net
        public ApiInfo(IDictionary <string, Uri> links,
                       IList <string> oauthScopes,
                       IList <string> acceptedOauthScopes,
                       string etag,
                       RateLimit rateLimit,
                       TimeSpan serverTimeDifference = default)
        {
            Ensure.ArgumentNotNull(links, nameof(links));
            Ensure.ArgumentNotNull(oauthScopes, nameof(oauthScopes));
            Ensure.ArgumentNotNull(acceptedOauthScopes, nameof(acceptedOauthScopes));

            Links               = new ReadOnlyDictionary <string, Uri>(links);
            OauthScopes         = new ReadOnlyCollection <string>(oauthScopes);
            AcceptedOauthScopes = new ReadOnlyCollection <string>(acceptedOauthScopes);
            Etag                 = etag;
            RateLimit            = rateLimit;
            ServerTimeDifference = serverTimeDifference;
        }
コード例 #12
0
 /// <summary>
 /// Constructs an instance of RateLimitExceededException
 /// </summary>
 /// <param name="info">
 /// The <see cref="SerializationInfo"/> that holds the
 /// serialized object data about the exception being thrown.
 /// </param>
 /// <param name="context">
 /// The <see cref="StreamingContext"/> that contains
 /// contextual information about the source or destination.
 /// </param>
 protected RateLimitExceededException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _rateLimit = info.GetValue("RateLimit", typeof(RateLimit)) as RateLimit
                  ?? new RateLimit(new Dictionary <string, string>());
 }
コード例 #13
0
        /// <summary>
        /// Constructs an instance of RateLimitExceededException
        /// </summary>
        /// <param name="response">The HTTP payload from the server</param>
        /// <param name="innerException">The inner exception</param>
        public RateLimitExceededException(IResponse response, Exception innerException) : base(response, innerException)
        {
            Ensure.ArgumentNotNull(response, "response");

            _rateLimit = response.ApiInfo.RateLimit;
        }
コード例 #14
0
 protected RateLimitExceededException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _rateLimit = info.GetValue("RateLimit", typeof(RateLimit)) as RateLimit
                  ?? new RateLimit(new Dictionary<string, string>());
 }
コード例 #15
0
        public RateLimitExceededException(IResponse response, Exception innerException) : base(response, innerException)
        {
            Ensure.ArgumentNotNull(response, "response");

            _rateLimit = response.ApiInfo.RateLimit;
        }