Class: AhoSdk::Issuer::DataSourcesResource Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aho_sdk/issuer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Data_sources resource operations

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ DataSourcesResource

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DataSourcesResource.



286
287
288
# File 'lib/aho_sdk/issuer.rb', line 286

def initialize(client)
  @client = client
end

Instance Method Details

#create(body: nil, idempotency_key: nil) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a data source

Returns:

  • (Hash)


293
294
295
# File 'lib/aho_sdk/issuer.rb', line 293

def create(body: nil, idempotency_key: nil)
  @client.post("/v1/issuer/data_sources", body: body, idempotency_key: idempotency_key)
end

#delete(id:) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Delete a data source

Returns:

  • (Hash)


325
326
327
# File 'lib/aho_sdk/issuer.rb', line 325

def delete(id:)
  @client.delete("/v1/issuer/data_sources/#{id}")
end

#get(id:) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get data source details

Returns:

  • (Hash)


311
312
313
# File 'lib/aho_sdk/issuer.rb', line 311

def get(id:)
  @client.get("/v1/issuer/data_sources/#{id}")
end

#list(status: nil, source_type: nil, page: nil, per_page: nil) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

List data sources

Returns:

  • (Hash)


300
301
302
303
304
305
306
# File 'lib/aho_sdk/issuer.rb', line 300

def list(status: nil, source_type: nil, page: nil, per_page: nil)
  fetch_page = ->(p) {
    response = @client.get("/v1/issuer/data_sources", params: { status: status, source_type: source_type, page: p, per_page: per_page })
    Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
  }
  fetch_page.call(page)
end

#test(id:, idempotency_key: nil) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test data source connection

Returns:

  • (Hash)


332
333
334
# File 'lib/aho_sdk/issuer.rb', line 332

def test(id:, idempotency_key: nil)
  @client.post("/v1/issuer/data_sources/#{id}/test", idempotency_key: idempotency_key)
end

#update(id:, body: nil, idempotency_key: nil) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Update a data source

Returns:

  • (Hash)


318
319
320
# File 'lib/aho_sdk/issuer.rb', line 318

def update(id:, body: nil, idempotency_key: nil)
  @client.patch("/v1/issuer/data_sources/#{id}", body: body, idempotency_key: idempotency_key)
end