Class: Twilio::REST::Verify::V2::ServiceContext::EntityContext::FactorContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::ServiceContext::EntityContext::FactorContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the FactorInstance.
-
#fetch ⇒ FactorInstance
Fetch the FactorInstance.
-
#initialize(version, service_sid, identity, sid) ⇒ FactorContext
constructor
Initialize the FactorContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset) ⇒ FactorInstance
Update the FactorInstance.
Constructor Details
#initialize(version, service_sid, identity, sid) ⇒ FactorContext
Initialize the FactorContext
211 212 213 214 215 216 217 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 211 def initialize(version, service_sid, identity, sid) super(version) # Path Solution @solution = {service_sid: service_sid, identity: identity, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Factors/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the FactorInstance
222 223 224 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 222 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ FactorInstance
Fetch the FactorInstance
229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 229 def fetch payload = @version.fetch('GET', @uri) FactorInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
280 281 282 283 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 280 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.FactorContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
273 274 275 276 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 273 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.FactorContext #{context}>" end |
#update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset) ⇒ FactorInstance
Update the FactorInstance
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 252 def update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset) data = Twilio::Values.of({ 'AuthPayload' => auth_payload, 'FriendlyName' => friendly_name, 'Config.NotificationToken' => config_notification_token, 'Config.SdkVersion' => config_sdk_version, }) payload = @version.update('POST', @uri, data: data) FactorInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], sid: @solution[:sid], ) end |