class Twilio::REST::Verify::V2::ServiceContext::RateLimitContext

Public Class Methods

new(version, service_sid, sid) click to toggle source

Initialize the RateLimitContext @param [Version] version Version that contains the resource @param [String] service_sid The SID of the

{Service}[https://www.twilio.com/docs/verify/api/service] the resource is
associated with.

@param [String] sid The Twilio-provided string that uniquely identifies the Rate

Limit resource to fetch.

@return [RateLimitContext] RateLimitContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
171 def initialize(version, service_sid, sid)
172   super(version)
173 
174   # Path Solution
175   @solution = {service_sid: service_sid, sid: sid, }
176   @uri = "/Services/#{@solution[:service_sid]}/RateLimits/#{@solution[:sid]}"
177 
178   # Dependents
179   @buckets = nil
180 end

Public Instance Methods

buckets(sid=:unset) click to toggle source

Access the buckets @return [BucketList] @return [BucketContext] if sid was passed.

    # File lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
214 def buckets(sid=:unset)
215   raise ArgumentError, 'sid cannot be nil' if sid.nil?
216 
217   if sid != :unset
218     return BucketContext.new(@version, @solution[:service_sid], @solution[:sid], sid, )
219   end
220 
221   unless @buckets
222     @buckets = BucketList.new(
223         @version,
224         service_sid: @solution[:service_sid],
225         rate_limit_sid: @solution[:sid],
226     )
227   end
228 
229   @buckets
230 end
delete() click to toggle source

Delete the RateLimitInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
206 def delete
207    @version.delete('DELETE', @uri)
208 end
fetch() click to toggle source

Fetch the RateLimitInstance @return [RateLimitInstance] Fetched RateLimitInstance

    # File lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
197 def fetch
198   payload = @version.fetch('GET', @uri)
199 
200   RateLimitInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], )
201 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
241 def inspect
242   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
243   "#<Twilio.Verify.V2.RateLimitContext #{context}>"
244 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
234 def to_s
235   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
236   "#<Twilio.Verify.V2.RateLimitContext #{context}>"
237 end
update(description: :unset) click to toggle source

Update the RateLimitInstance @param [String] description Description of this Rate Limit @return [RateLimitInstance] Updated RateLimitInstance

    # File lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb
186 def update(description: :unset)
187   data = Twilio::Values.of({'Description' => description, })
188 
189   payload = @version.update('POST', @uri, data: data)
190 
191   RateLimitInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], )
192 end