Class: Twilio::REST::Authy::V1::ServiceContext
- Inherits:
- 
      InstanceContext
      
        - Object
- InstanceContext
- Twilio::REST::Authy::V1::ServiceContext
 
- Defined in:
- lib/twilio-ruby/rest/authy/v1/service.rb,
 lib/twilio-ruby/rest/authy/v1/service/entity.rb,
 lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb,
 lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.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].
Defined Under Namespace
Classes: EntityContext, EntityInstance, EntityList, EntityPage
Instance Method Summary collapse
- 
  
    
      #delete  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Deletes the ServiceInstance. 
- 
  
    
      #entities(identity = :unset)  ⇒ EntityList, EntityContext 
    
    
  
  
  
  
  
  
  
  
  
    Access the entities. 
- 
  
    
      #fetch  ⇒ ServiceInstance 
    
    
  
  
  
  
  
  
  
  
  
    Fetch a ServiceInstance. 
- 
  
    
      #initialize(version, sid)  ⇒ ServiceContext 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Initialize the ServiceContext. 
- 
  
    
      #to_s  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Provide a user friendly representation. 
- 
  
    
      #update(friendly_name: :unset)  ⇒ ServiceInstance 
    
    
  
  
  
  
  
  
  
  
  
    Update the ServiceInstance. 
Constructor Details
#initialize(version, sid) ⇒ ServiceContext
Initialize the ServiceContext
| 174 175 176 177 178 179 180 181 182 183 | # File 'lib/twilio-ruby/rest/authy/v1/service.rb', line 174 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Services/#{@solution[:sid]}" # Dependents @entities = nil end | 
Instance Method Details
#delete ⇒ Boolean
Deletes the ServiceInstance
| 188 189 190 | # File 'lib/twilio-ruby/rest/authy/v1/service.rb', line 188 def delete @version.delete('delete', @uri) end | 
#entities(identity = :unset) ⇒ EntityList, EntityContext
Access the entities
| 228 229 230 231 232 233 234 235 236 237 238 239 240 | # File 'lib/twilio-ruby/rest/authy/v1/service.rb', line 228 def entities(identity=:unset) raise ArgumentError, 'identity cannot be nil' if identity.nil? if identity != :unset return EntityContext.new(@version, @solution[:sid], identity, ) end unless @entities @entities = EntityList.new(@version, service_sid: @solution[:sid], ) end @entities end | 
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
| 195 196 197 198 199 200 201 202 203 204 205 | # File 'lib/twilio-ruby/rest/authy/v1/service.rb', line 195 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) ServiceInstance.new(@version, payload, sid: @solution[:sid], ) end | 
#to_s ⇒ Object
Provide a user friendly representation
| 244 245 246 247 | # File 'lib/twilio-ruby/rest/authy/v1/service.rb', line 244 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Authy.V1.ServiceContext #{context}>" end | 
#update(friendly_name: :unset) ⇒ ServiceInstance
Update the ServiceInstance
| 212 213 214 215 216 217 218 219 220 221 222 | # File 'lib/twilio-ruby/rest/authy/v1/service.rb', line 212 def update(friendly_name: :unset) data = Twilio::Values.of({'FriendlyName' => friendly_name, }) payload = @version.update( 'POST', @uri, data: data, ) ServiceInstance.new(@version, payload, sid: @solution[:sid], ) end |