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.



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

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)


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

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)


364
365
366
# File 'lib/aho_sdk/issuer.rb', line 364

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)


350
351
352
# File 'lib/aho_sdk/issuer.rb', line 350

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)


339
340
341
342
343
344
345
# File 'lib/aho_sdk/issuer.rb', line 339

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)


371
372
373
# File 'lib/aho_sdk/issuer.rb', line 371

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)


357
358
359
# File 'lib/aho_sdk/issuer.rb', line 357

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