Class: Twilio::REST::PreviewIam::Versionless::OrganizationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview_iam/versionless/organization.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, organization_sid: nil) ⇒ OrganizationInstance

Initialize the OrganizationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Organization resource.

  • sid (String)

    The SID of the Call resource to fetch.



203
204
205
206
207
208
209
210
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 203

def initialize(version , organization_sid: nil)
    super(version)
    

    # Context
    @instance_context = nil
    @params = { 'organization_sid' => organization_sid  || @properties['organization_sid']  , }
end

Instance Method Details

#accountsaccounts

Access the accounts

Returns:



248
249
250
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 248

def accounts
    context.accounts
end

#contextOrganizationContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



216
217
218
219
220
221
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 216

def context
    unless @instance_context
        @instance_context = OrganizationContext.new(@version , @params['organization_sid'])
    end
    @instance_context
end

#fetchOrganizationInstance

Fetch the OrganizationInstance

Returns:



226
227
228
229
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 226

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



268
269
270
271
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 268

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.PreviewIam.Versionless.OrganizationInstance #{values}>"
end

#resource_typesresource_types

Access the resource_types

Returns:



234
235
236
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 234

def resource_types
    context.resource_types
end

#role_assignmentsrole_assignments

Access the role_assignments

Returns:



241
242
243
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 241

def role_assignments
    context.role_assignments
end

#to_sObject

Provide a user friendly representation



261
262
263
264
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 261

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.PreviewIam.Versionless.OrganizationInstance #{values}>"
end

#usersusers

Access the users

Returns:



255
256
257
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization.rb', line 255

def users
    context.users
end