class Twilio::REST::Api::V2010::AccountContext::SipList::DomainContext::AuthTypesList::AuthTypeCallsList::AuthCallsCredentialListMappingList
Public Class Methods
Initialize the AuthCallsCredentialListMappingList
@param [Version] version Version
that contains the resource @param [String] account_sid The SID of the
{Account}[https://www.twilio.com/docs/iam/api/account] that created the SipDomain resource.
@param [String] domain_sid The unique string that that we created to identify
the SipDomain resource.
@return [AuthCallsCredentialListMappingList] AuthCallsCredentialListMappingList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 28 def initialize(version, account_sid: nil, domain_sid: nil) 29 super(version) 30 31 # Path Solution 32 @solution = {account_sid: account_sid, domain_sid: domain_sid} 33 @uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:domain_sid]}/Auth/Calls/CredentialListMappings.json" 34 end
Public Instance Methods
Create the AuthCallsCredentialListMappingInstance
@param [String] credential_list_sid The SID of the CredentialList resource to
map to the SIP domain.
@return [AuthCallsCredentialListMappingInstance] Created AuthCallsCredentialListMappingInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 41 def create(credential_list_sid: nil) 42 data = Twilio::Values.of({'CredentialListSid' => credential_list_sid, }) 43 44 payload = @version.create('POST', @uri, data: data) 45 46 AuthCallsCredentialListMappingInstance.new( 47 @version, 48 payload, 49 account_sid: @solution[:account_sid], 50 domain_sid: @solution[:domain_sid], 51 ) 52 end
When passed a block, yields AuthCallsCredentialListMappingInstance
records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 92 def each 93 limits = @version.read_limits 94 95 page = self.page(page_size: limits[:page_size], ) 96 97 @version.stream(page, 98 limit: limits[:limit], 99 page_limit: limits[:page_limit]).each {|x| yield x} 100 end
Retrieve a single page of AuthCallsCredentialListMappingInstance
records from the API. Request
is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page
of AuthCallsCredentialListMappingInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 126 def get_page(target_url) 127 response = @version.domain.request( 128 'GET', 129 target_url 130 ) 131 AuthCallsCredentialListMappingPage.new(@version, response, @solution) 132 end
Lists AuthCallsCredentialListMappingInstance
records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param [Integer] limit Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
@param [Integer] page_size Number of records to fetch per request, when
not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
@return [Array] Array of up to limit results
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 65 def list(limit: nil, page_size: nil) 66 self.stream(limit: limit, page_size: page_size).entries 67 end
Retrieve a single page of AuthCallsCredentialListMappingInstance
records from the API. Request
is executed immediately. @param [String] page_token PageToken provided by the API @param [Integer] page_number Page
Number, this value is simply for client state @param [Integer] page_size Number of records to return, defaults to 50 @return [Page] Page
of AuthCallsCredentialListMappingInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 109 def page(page_token: :unset, page_number: :unset, page_size: :unset) 110 params = Twilio::Values.of({ 111 'PageToken' => page_token, 112 'Page' => page_number, 113 'PageSize' => page_size, 114 }) 115 116 response = @version.page('GET', @uri, params: params) 117 118 AuthCallsCredentialListMappingPage.new(@version, response, @solution) 119 end
Streams AuthCallsCredentialListMappingInstance
records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached. @param [Integer] limit Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit.
@param [Integer] page_size Number of records to fetch per request, when
not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
@return [Enumerable] Enumerable that will yield up to limit results
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 80 def stream(limit: nil, page_size: nil) 81 limits = @version.read_limits(limit, page_size) 82 83 page = self.page(page_size: limits[:page_size], ) 84 85 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 86 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb 136 def to_s 137 '#<Twilio.Api.V2010.AuthCallsCredentialListMappingList>' 138 end