Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext::EngagementContextContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Studio::V1::FlowContext::EngagementContext::EngagementContextContext
- Defined in:
- lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb
Instance Method Summary collapse
-
#fetch ⇒ EngagementContextInstance
Fetch the EngagementContextInstance.
-
#fetch_with_metadata ⇒ EngagementContextInstance
Fetch the EngagementContextInstanceMetadata.
-
#initialize(version, flow_sid, engagement_sid) ⇒ EngagementContextContext
constructor
Initialize the EngagementContextContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, flow_sid, engagement_sid) ⇒ EngagementContextContext
Initialize the EngagementContextContext
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 54 def initialize(version, flow_sid, engagement_sid) super(version) # Path Solution @solution = { flow_sid: flow_sid, engagement_sid: engagement_sid, } @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:engagement_sid]}/Context" end |
Instance Method Details
#fetch ⇒ EngagementContextInstance
Fetch the EngagementContextInstance
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 67 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) EngagementContextInstance.new( @version, payload, flow_sid: @solution[:flow_sid], engagement_sid: @solution[:engagement_sid], ) end |
#fetch_with_metadata ⇒ EngagementContextInstance
Fetch the EngagementContextInstanceMetadata
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 87 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) engagement_context_instance = EngagementContextInstance.new( @version, response.body, flow_sid: @solution[:flow_sid], engagement_sid: @solution[:engagement_sid], ) EngagementContextInstanceMetadata.new( @version, engagement_context_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
120 121 122 123 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 120 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContextContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
113 114 115 116 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 113 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Studio.V1.EngagementContextContext #{context}>" end |