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
179 180 181 182 183 184 185 186 187 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 179 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
191 192 193 194 195 196 197 198 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 191 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
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 203 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
260 261 262 263 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 260 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.CustomOperatorContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
253 254 255 256 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 253 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
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 225 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 |