Class: Twilio::REST::Lookups::V2::RateLimitList

Inherits:
Twilio::REST::ListResource show all
Defined in:
lib/twilio-ruby/rest/lookups/v2/rate_limit.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ RateLimitList

Initialize the RateLimitList

Parameters:

  • version (Version)

    Version that contains the resource



26
27
28
29
30
31
32
33
# File 'lib/twilio-ruby/rest/lookups/v2/rate_limit.rb', line 26

def initialize(version)
    super(version)
    
    # Path Solution
    @solution = {  }
    @uri = "/RateLimits"
    
end

Instance Method Details

#fetch(fields: :unset) ⇒ RateLimitInstance

Fetch the RateLimitInstance

Parameters:

  • fields (Array[String]) (defaults to: :unset)

Returns:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/twilio-ruby/rest/lookups/v2/rate_limit.rb', line 38

def fetch(
    fields: :unset
)

    params = Twilio::Values.of({
        'Fields' => Twilio.serialize_list(fields) { |e| e },
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, params: params, headers: headers)
    RateLimitInstance.new(
        @version,
        payload,
    )
end

#fetch_with_metadata(fields: :unset) ⇒ RateLimitInstance

Fetch the RateLimitInstanceMetadata

Parameters:

  • fields (Array[String]) (defaults to: :unset)

Returns:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/twilio-ruby/rest/lookups/v2/rate_limit.rb', line 62

def (
  fields: :unset
)

    params = Twilio::Values.of({
        'Fields' => Twilio.serialize_list(fields) { |e| e },
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    rate_limit_instance = RateLimitInstance.new(
        @version,
        response.body,
    )
    .new(
        @version,
        rate_limit_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



92
93
94
# File 'lib/twilio-ruby/rest/lookups/v2/rate_limit.rb', line 92

def to_s
    '#<Twilio.Lookups.V2.RateLimitList>'
end