Class: Twilio::REST::Messaging::V1::ServiceContext::UsAppToPersonContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Messaging::V1::ServiceContext::UsAppToPersonContext
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the UsAppToPersonInstance.
-
#fetch ⇒ UsAppToPersonInstance
Fetch the UsAppToPersonInstance.
-
#initialize(version, messaging_service_sid, sid) ⇒ UsAppToPersonContext
constructor
Initialize the UsAppToPersonContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(has_embedded_links: nil, has_embedded_phone: nil, message_samples: nil, message_flow: nil, description: nil, age_gated: nil, direct_lending: nil) ⇒ UsAppToPersonInstance
Update the UsAppToPersonInstance.
Constructor Details
#initialize(version, messaging_service_sid, sid) ⇒ UsAppToPersonContext
Initialize the UsAppToPersonContext
210 211 212 213 214 215 216 217 218 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 210 def initialize(version, messaging_service_sid, sid) super(version) # Path Solution @solution = { messaging_service_sid: messaging_service_sid, sid: sid, } @uri = "/Services/#{@solution[:messaging_service_sid]}/Compliance/Usa2p/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the UsAppToPersonInstance
222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 222 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ UsAppToPersonInstance
Fetch the UsAppToPersonInstance
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 234 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) UsAppToPersonInstance.new( @version, payload, messaging_service_sid: @solution[:messaging_service_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
306 307 308 309 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 306 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.UsAppToPersonContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
299 300 301 302 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 299 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.UsAppToPersonContext #{context}>" end |
#update(has_embedded_links: nil, has_embedded_phone: nil, message_samples: nil, message_flow: nil, description: nil, age_gated: nil, direct_lending: nil) ⇒ UsAppToPersonInstance
Update the UsAppToPersonInstance
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 261 def update( has_embedded_links: nil, has_embedded_phone: nil, message_samples: nil, message_flow: nil, description: nil, age_gated: nil, direct_lending: nil ) data = Twilio::Values.of({ 'HasEmbeddedLinks' => , 'HasEmbeddedPhone' => , 'MessageSamples' => Twilio.serialize_list() { |e| e }, 'MessageFlow' => , 'Description' => description, 'AgeGated' => age_gated, 'DirectLending' => direct_lending, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) UsAppToPersonInstance.new( @version, payload, messaging_service_sid: @solution[:messaging_service_sid], sid: @solution[:sid], ) end |