Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::ActivityContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::ActivityContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ActivityInstance.
-
#fetch ⇒ ActivityInstance
Fetch the ActivityInstance.
-
#initialize(version, workspace_sid, sid) ⇒ ActivityContext
constructor
Initialize the ActivityContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset) ⇒ ActivityInstance
Update the ActivityInstance.
Constructor Details
#initialize(version, workspace_sid, sid) ⇒ ActivityContext
Initialize the ActivityContext
180 181 182 183 184 185 186 187 188 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb', line 180 def initialize(version, workspace_sid, sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, sid: sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/Activities/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ActivityInstance
192 193 194 195 196 197 198 199 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb', line 192 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ ActivityInstance
Fetch the ActivityInstance
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb', line 204 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ActivityInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
258 259 260 261 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb', line 258 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.ActivityContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
251 252 253 254 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb', line 251 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.ActivityContext #{context}>" end |
#update(friendly_name: :unset) ⇒ ActivityInstance
Update the ActivityInstance
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb', line 225 def update( friendly_name: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ActivityInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |