Class: Reach::REST::Api::Authentix::ConfigurationItemContext::AuthenticationItemList
- Inherits:
-
ListResource
- Object
- ListResource
- Reach::REST::Api::Authentix::ConfigurationItemContext::AuthenticationItemList
- Defined in:
- lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb
Instance Method Summary collapse
-
#each ⇒ Object
When passed a block, yields AuthenticationItemInstance records from the API.
-
#get_page(target_url) ⇒ Page
Retrieve a single page of AuthenticationItemInstance records from the API.
-
#initialize(version, configuration_id: nil) ⇒ AuthenticationItemList
constructor
Initialize the AuthenticationItemList.
-
#list(limit: nil, page_size: nil) ⇒ Array
Lists AuthenticationItemInstance records from the API as a list.
-
#page(page_token: :unset, page_number: :unset, page_size: :unset) ⇒ Page
Retrieve a single page of AuthenticationItemInstance records from the API.
-
#start(dest: nil, channel: nil, service_name: :unset, custom_code: :unset, payment_info: :unset, template_id: :unset, template_data_map: :unset) ⇒ AuthenticationItemInstance
Start the AuthenticationItemInstance.
-
#stream(limit: nil, page_size: nil) ⇒ Enumerable
Streams Instance records from the API as an Enumerable.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, configuration_id: nil) ⇒ AuthenticationItemList
Initialize the AuthenticationItemList
28 29 30 31 32 33 34 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 28 def initialize(version, configuration_id: nil) super(version) # Path Solution @solution = { configuration_id: configuration_id } @uri = "/authentix/v1/configurations/#{@solution[:configuration_id]}/authentications" end |
Instance Method Details
#each ⇒ Object
When passed a block, yields AuthenticationItemInstance records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.
120 121 122 123 124 125 126 127 128 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 120 def each limits = @version.read_limits page = self.page(page_size: limits[:page_size], ) @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]).each {|x| yield x} end |
#get_page(target_url) ⇒ Page
Retrieve a single page of AuthenticationItemInstance records from the API. Request is executed immediately.
154 155 156 157 158 159 160 161 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 154 def get_page(target_url) baseUrl = @version.url_without_pagination_info(target_url) response = @version.domain.request( 'GET', target_url ) AuthenticationItemPage.new(baseUrl, @version, response, @solution) end |
#list(limit: nil, page_size: nil) ⇒ Array
Lists AuthenticationItemInstance records from the API as a list. Unlike stream(), this operation is eager and will load ‘limit` records into memory before returning.
89 90 91 92 93 94 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 89 def list(limit: nil, page_size: nil) self.stream( limit: limit, page_size: page_size ).entries end |
#page(page_token: :unset, page_number: :unset, page_size: :unset) ⇒ Page
Retrieve a single page of AuthenticationItemInstance records from the API. Request is executed immediately.
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 136 def page(page_token: :unset, page_number: :unset, page_size: :unset) params = Reach::Values.of({ 'page' => page_number, 'pageSize' => page_size, }) baseUrl = @version.url_without_pagination_info(@version.absolute_url(@uri), params) response = @version.page('GET', @uri, params: params) AuthenticationItemPage.new(baseUrl, @version, response, @solution) end |
#start(dest: nil, channel: nil, service_name: :unset, custom_code: :unset, payment_info: :unset, template_id: :unset, template_data_map: :unset) ⇒ AuthenticationItemInstance
Start the AuthenticationItemInstance
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 45 def start( dest: nil, channel: nil, service_name: :unset, custom_code: :unset, payment_info: :unset, template_id: :unset, template_data_map: :unset ) baseParams = { } data = Reach::Values.of(baseParams.merge({ 'dest' => dest, 'channel' => channel, 'serviceName' => service_name, 'customCode' => custom_code, 'paymentInfo' => payment_info, 'templateId' => template_id, 'templateDataMap' => template_data_map, })) payload = @version.start('POST', @uri, data: data) AuthenticationItemInstance.new( @version, payload, configuration_id: @solution[:configuration_id], ) end |
#stream(limit: nil, page_size: nil) ⇒ Enumerable
Streams Instance records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached.
107 108 109 110 111 112 113 114 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 107 def stream(limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( page_size: limits[:page_size], ) @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) end |
#to_s ⇒ Object
Provide a user friendly representation
166 167 168 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 166 def to_s '#<Reach.Api.Authentix.AuthenticationItemList>' end |