Class: Twilio::REST::PreviewIam::Versionless::OrganizationContext::AccountInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::PreviewIam::Versionless::OrganizationContext::AccountInstance
- Defined in:
- lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Twilio account sid.
-
#context ⇒ AccountContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time when the account was created in the system.
-
#fetch ⇒ AccountInstance
Fetch the AccountInstance.
-
#friendly_name ⇒ String
Account friendly name.
-
#initialize(version, payload, organization_sid: nil, account_sid: nil) ⇒ AccountInstance
constructor
Initialize the AccountInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#owner_sid ⇒ String
Twilio account sid.
-
#status ⇒ String
Account status.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, payload, organization_sid: nil, account_sid: nil) ⇒ AccountInstance
Initialize the AccountInstance
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 222 def initialize(version, payload , organization_sid: nil, account_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'status' => payload['status'], 'owner_sid' => payload['owner_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), } # Context @instance_context = nil @params = { 'organization_sid' => organization_sid || @properties['organization_sid'] ,'account_sid' => account_sid , } end |
Instance Method Details
#account_sid ⇒ String
Returns Twilio account sid.
252 253 254 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 252 def account_sid @properties['account_sid'] end |
#context ⇒ AccountContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
243 244 245 246 247 248 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 243 def context unless @instance_context @instance_context = AccountContext.new(@version , @params['organization_sid'], @params['account_sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time when the account was created in the system.
276 277 278 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 276 def date_created @properties['date_created'] end |
#fetch ⇒ AccountInstance
Fetch the AccountInstance
283 284 285 286 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 283 def fetch context.fetch end |
#friendly_name ⇒ String
Returns Account friendly name.
258 259 260 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 258 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
297 298 299 300 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 297 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.PreviewIam.Versionless.AccountInstance #{values}>" end |
#owner_sid ⇒ String
Returns Twilio account sid.
270 271 272 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 270 def owner_sid @properties['owner_sid'] end |
#status ⇒ String
Returns Account status.
264 265 266 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 264 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
290 291 292 293 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/account.rb', line 290 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.PreviewIam.Versionless.AccountInstance #{values}>" end |