Class: Twilio::REST::Preview::Understand::ServiceContext::ModelBuildContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Understand::ServiceContext::ModelBuildContext
- Defined in:
- lib/twilio-ruby/rest/preview/understand/service/model_build.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the ModelBuildInstance.
-
#fetch ⇒ ModelBuildInstance
Fetch a ModelBuildInstance.
-
#initialize(version, service_sid, sid) ⇒ ModelBuildContext
constructor
Initialize the ModelBuildContext.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(unique_name: :unset) ⇒ ModelBuildInstance
Update the ModelBuildInstance.
Constructor Details
#initialize(version, service_sid, sid) ⇒ ModelBuildContext
Initialize the ModelBuildContext
175 176 177 178 179 180 181 |
# File 'lib/twilio-ruby/rest/preview/understand/service/model_build.rb', line 175 def initialize(version, service_sid, sid) super(version) # Path Solution @solution = {service_sid: service_sid, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/ModelBuilds/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the ModelBuildInstance
227 228 229 |
# File 'lib/twilio-ruby/rest/preview/understand/service/model_build.rb', line 227 def delete @version.delete('delete', @uri) end |
#fetch ⇒ ModelBuildInstance
Fetch a ModelBuildInstance
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/twilio-ruby/rest/preview/understand/service/model_build.rb', line 186 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) ModelBuildInstance.new( @version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
233 234 235 236 |
# File 'lib/twilio-ruby/rest/preview/understand/service/model_build.rb', line 233 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Understand.ModelBuildContext #{context}>" end |
#update(unique_name: :unset) ⇒ ModelBuildInstance
Update the ModelBuildInstance
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/twilio-ruby/rest/preview/understand/service/model_build.rb', line 207 def update(unique_name: :unset) data = Twilio::Values.of({'UniqueName' => unique_name, }) payload = @version.update( 'POST', @uri, data: data, ) ModelBuildInstance.new( @version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end |