Class: Twilio::REST::Intelligence::V2::CustomOperatorContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Intelligence::V2::CustomOperatorContext
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CustomOperatorInstance.
-
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance.
-
#initialize(version, sid) ⇒ CustomOperatorContext
constructor
Initialize the CustomOperatorContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance.
Constructor Details
#initialize(version, sid) ⇒ CustomOperatorContext
Initialize the CustomOperatorContext
172 173 174 175 176 177 178 179 180 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 172 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Operators/Custom/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the CustomOperatorInstance
184 185 186 187 188 189 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 184 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance
194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 194 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) CustomOperatorInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
243 244 245 246 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 243 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.CustomOperatorContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
236 237 238 239 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 236 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.CustomOperatorContext #{context}>" end |
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 212 def update( friendly_name: nil, config: nil, if_match: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Config' => Twilio.serialize_object(config), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) payload = @version.update('POST', @uri, data: data, headers: headers) CustomOperatorInstance.new( @version, payload, sid: @solution[:sid], ) end |