Class: Twilio::REST::Events::V1::EventTypeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Events::V1::EventTypeContext
- Defined in:
- lib/twilio-ruby/rest/events/v1/event_type.rb
Instance Method Summary collapse
-
#fetch ⇒ EventTypeInstance
Fetch the EventTypeInstance.
-
#fetch_with_metadata ⇒ EventTypeInstance
Fetch the EventTypeInstanceMetadata.
-
#initialize(version, type) ⇒ EventTypeContext
constructor
Initialize the EventTypeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, type) ⇒ EventTypeContext
Initialize the EventTypeContext
167 168 169 170 171 172 173 174 175 176 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 167 def initialize(version, type) super(version) # Path Solution @solution = { type: type, } @uri = "/Types/#{@solution[:type]}" end |
Instance Method Details
#fetch ⇒ EventTypeInstance
Fetch the EventTypeInstance
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 180 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) EventTypeInstance.new( @version, payload, type: @solution[:type], ) end |
#fetch_with_metadata ⇒ EventTypeInstance
Fetch the EventTypeInstanceMetadata
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 199 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) event_type_instance = EventTypeInstance.new( @version, response.body, type: @solution[:type], ) EventTypeInstanceMetadata.new( @version, event_type_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
231 232 233 234 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 231 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Events.V1.EventTypeContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
224 225 226 227 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 224 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Events.V1.EventTypeContext #{context}>" end |