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
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, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset) ⇒ FactorInstance
Update the FactorInstance.
Constructor Details
#initialize(version, service_sid, identity, sid) ⇒ FactorContext
Initialize the FactorContext
141 142 143 144 145 146 147 148 149 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 141 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
153 154 155 156 157 158 159 160 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 153 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ FactorInstance
Fetch the FactorInstance
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 165 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) FactorInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
245 246 247 248 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 245 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.FactorContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
238 239 240 241 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 238 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, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset) ⇒ FactorInstance
Update the FactorInstance
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 195 def update( auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset ) data = Twilio::Values.of({ 'AuthPayload' => auth_payload, 'FriendlyName' => friendly_name, 'Config.NotificationToken' => config_notification_token, 'Config.SdkVersion' => config_sdk_version, 'Config.TimeStep' => config_time_step, 'Config.Skew' => config_skew, 'Config.CodeLength' => config_code_length, 'Config.Alg' => config_alg, 'Config.NotificationPlatform' => config_notification_platform, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) FactorInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], sid: @solution[:sid], ) end |