Class: Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext::CredentialInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext::CredentialInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique id of the Account that is responsible for this resource.
-
#context ⇒ CredentialContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#credential_list_sid ⇒ String
The unique id that identifies the credential list that includes this credential.
-
#date_created ⇒ Time
The date that this resource was created, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
-
#date_updated ⇒ Time
The date that this resource was last updated, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
-
#delete ⇒ Boolean
Delete the CredentialInstance.
-
#fetch ⇒ CredentialInstance
Fetch the CredentialInstance.
-
#initialize(version, payload, account_sid: nil, credential_list_sid: nil, sid: nil) ⇒ CredentialInstance
constructor
Initialize the CredentialInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(password: :unset) ⇒ CredentialInstance
Update the CredentialInstance.
-
#uri ⇒ String
The URI for this resource, relative to ‘api.twilio.com`.
-
#username ⇒ String
The username for this credential.
Constructor Details
#initialize(version, payload, account_sid: nil, credential_list_sid: nil, sid: nil) ⇒ CredentialInstance
Initialize the CredentialInstance
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 275 def initialize(version, payload , account_sid: nil, credential_list_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'credential_list_sid' => payload['credential_list_sid'], 'username' => payload['username'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'uri' => payload['uri'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'credential_list_sid' => credential_list_sid || @properties['credential_list_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account that is responsible for this resource.
313 314 315 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 313 def account_sid @properties['account_sid'] end |
#context ⇒ CredentialContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
298 299 300 301 302 303 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 298 def context unless @instance_context @instance_context = CredentialContext.new(@version , @params['account_sid'], @params['credential_list_sid'], @params['sid']) end @instance_context end |
#credential_list_sid ⇒ String
Returns The unique id that identifies the credential list that includes this credential.
319 320 321 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 319 def credential_list_sid @properties['credential_list_sid'] end |
#date_created ⇒ Time
Returns The date that this resource was created, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
331 332 333 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 331 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
337 338 339 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 337 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CredentialInstance
350 351 352 353 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 350 def delete context.delete end |
#fetch ⇒ CredentialInstance
Fetch the CredentialInstance
358 359 360 361 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 358 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
385 386 387 388 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 385 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CredentialInstance #{values}>" end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
307 308 309 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 307 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
378 379 380 381 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 378 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CredentialInstance #{values}>" end |
#update(password: :unset) ⇒ CredentialInstance
Update the CredentialInstance
367 368 369 370 371 372 373 374 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 367 def update( password: :unset ) context.update( password: password, ) end |
#uri ⇒ String
Returns The URI for this resource, relative to ‘api.twilio.com`.
343 344 345 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 343 def uri @properties['uri'] end |
#username ⇒ String
Returns The username for this credential.
325 326 327 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 325 def username @properties['username'] end |