Class: FdxV660Api::DataProvidersController

Inherits:
BaseController show all
Defined in:
lib/fdx_v660_api/controllers/data_providers_controller.rb

Overview

DataProvidersController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from FdxV660Api::BaseController

Instance Method Details

#get_data_provider(x_fapi_interaction_id, data_provider_id, fdx_api_actor_type: nil, fdx_api_data_recipient_id: nil) ⇒ ApiResponse

Get a specific data provider identifier for this interaction, as defined by [FAPI 2.0 Implementation Advice, 2.2.1 x-fapi-interaction-id](https://openid.bitbucket.io/fapi/fapi-2_0-implement ation_advice.html#name-x-fapi-interaction-id) Identifier. Uniquely identifies a Data Provider whether the customer is present (USER) or it is a BATCH operation for the data recipient(s) on whose behalf the request is being made

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • data_provider_id (String)

    Required parameter: Data Provider

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_data_recipient_id (Array[String]) (defaults to: nil)

    Optional parameter: ID(s)

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/fdx_v660_api/controllers/data_providers_controller.rb', line 64

def get_data_provider(x_fapi_interaction_id,
                      data_provider_id,
                      fdx_api_actor_type: nil,
                      fdx_api_data_recipient_id: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/data-providers/{dataProviderId}',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .template_param(new_parameter(data_provider_id, key: 'dataProviderId')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter(fdx_api_actor_type, key: 'FDX-API-Actor-Type'))
               .header_param(new_parameter(fdx_api_data_recipient_id, key: 'FDX-API-Data-Recipient-Id'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('OAuthFapi1Baseline')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DataProviderAtEcosystemRegistry.method(:from_hash))
                .is_api_response(true))
    .execute
end

#search_for_data_providers(x_fapi_interaction_id, fdx_api_actor_type: nil, fdx_api_data_recipient_id: nil, page_key: nil, limit: nil) ⇒ ApiResponse

Search for data providers identifier for this interaction, as defined by [FAPI 2.0 Implementation Advice, 2.2.1 x-fapi-interaction-id](https://openid.bitbucket.io/fapi/fapi-2_0-implement ation_advice.html#name-x-fapi-interaction-id) whether the customer is present (USER) or it is a BATCH operation for the data recipient(s) on whose behalf the request is being made provider to send the next set of records. Pagination can be implemented per provider's preference consumer wishes to receive. Providers should implement reasonable default/maximum/minimum values based on their internal architecture and update their documentation accordingly

Parameters:

  • x_fapi_interaction_id (UUID | String)

    Required parameter: Unique

  • fdx_api_actor_type (FdxApiActorType) (defaults to: nil)

    Optional parameter: Identifies

  • fdx_api_data_recipient_id (Array[String]) (defaults to: nil)

    Optional parameter: ID(s)

  • page_key (String) (defaults to: nil)

    Optional parameter: Opaque cursor used by the

  • limit (Integer) (defaults to: nil)

    Optional parameter: Number of elements that the

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fdx_v660_api/controllers/data_providers_controller.rb', line 27

def search_for_data_providers(x_fapi_interaction_id,
                              fdx_api_actor_type: nil,
                              fdx_api_data_recipient_id: nil,
                              page_key: nil,
                              limit: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/data-providers',
                                 Server::DEFAULT)
               .header_param(new_parameter(x_fapi_interaction_id, key: 'x-fapi-interaction-id')
                              .is_required(true))
               .header_param(new_parameter(fdx_api_actor_type, key: 'FDX-API-Actor-Type'))
               .header_param(new_parameter(fdx_api_data_recipient_id, key: 'FDX-API-Data-Recipient-Id'))
               .query_param(new_parameter(page_key, key: 'pageKey'))
               .query_param(new_parameter(limit, key: 'limit'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('OAuthFapi1Baseline')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DataProviderRecordsAtEcosystemRegistry.method(:from_hash))
                .is_api_response(true))
    .execute
end