Class: TreezorClient::BusinessApi

Inherits:
Object
  • Object
show all
Defined in:
lib/treezor_client/api/business_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BusinessApi

Returns a new instance of BusinessApi.



19
20
21
# File 'lib/treezor_client/api/business_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/treezor_client/api/business_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#businessinformations_get(country, opts = {}) ⇒ InlineResponse2004

get business information The get business information endpoint returns all already known business information. End user will have then to verify/correct it.

Parameters:

  • country

    In which country to search. Format ISO 3166-1 alpha-2

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info here.

  • :access_tag (String)

    Access tag is used for idem potency query. More info here.

  • :access_user_id (Integer)

    Access user's id is used for user's action restriction. More info here.

  • :access_user_ip (String)

    Access user's ip is used for user's action restriction. More info here.

  • :external_id (String)

    External unique business id. As given in businesssearch reponse.

  • :registration_number (String)

    Unique business registration number.

  • :vat_number (String)

    Unique business VAT number.

Returns:



34
35
36
37
# File 'lib/treezor_client/api/business_api.rb', line 34

def businessinformations_get(country, opts = {})
  data, _status_code, _headers = businessinformations_get_with_http_info(country, opts)
  data
end

#businessinformations_get_with_http_info(country, opts = {}) ⇒ Array<(InlineResponse2004, Fixnum, Hash)>

get business information The get business information endpoint returns all already known business information. End user will have then to verify/correct it.

Parameters:

  • country

    In which country to search. Format ISO 3166-1 alpha-2

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info here.

  • :access_tag (String)

    Access tag is used for idem potency query. More info here.

  • :access_user_id (Integer)

    Access user's id is used for user's action restriction. More info here.

  • :access_user_ip (String)

    Access user's ip is used for user's action restriction. More info here.

  • :external_id (String)

    External unique business id. As given in businesssearch reponse.

  • :registration_number (String)

    Unique business registration number.

  • :vat_number (String)

    Unique business VAT number.

Returns:

  • (Array<(InlineResponse2004, Fixnum, Hash)>)

    InlineResponse2004 data, response status code and response headers



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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/treezor_client/api/business_api.rb', line 51

def businessinformations_get_with_http_info(country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessApi.businessinformations_get ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling BusinessApi.businessinformations_get"
  end
  # resource path
  local_var_path = '/businessinformations'

  # query parameters
  query_params = {}
  query_params[:'country'] = country
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'externalId'] = opts[:'external_id'] if !opts[:'external_id'].nil?
  query_params[:'registrationNumber'] = opts[:'registration_number'] if !opts[:'registration_number'].nil?
  query_params[:'vatNumber'] = opts[:'vat_number'] if !opts[:'vat_number'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2004')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BusinessApi#businessinformations_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#businesssearchs_get(country, opts = {}) ⇒ Array<Object>

search businesses The search endpoint returns some business information.

Parameters:

  • country

    In which country to search. Format ISO 3166-1 alpha-2

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info here.

  • :access_tag (String)

    Access tag is used for idem potency query. More info here.

  • :access_user_id (Integer)

    Access user's id is used for user's action restriction. More info here.

  • :access_user_ip (String)

    Access user's ip is used for user's action restriction. More info here.

  • :name_exact (String)

    Business exact name. Exclusive with nameMatchBeginning and nameClosestKeywords.

  • :name_match_beginning (String)

    Business names begin with. Exclusive with nameExact and nameClosestKeywords.

  • :name_closest_keywords (String)

    Business names closed to keywords. Exclusive with nameExact and nameMatchBeginning.

  • :registration_number (String)

    Business registration number.

  • :vat_number (String)

    Business VAT number.

  • :phone_number (String)

    Business phone number.

  • :address_street (String)

    Business' street address.

  • :address_city (String)

    Business' city address.

  • :address_postal_code (String)

    Business' postal code address.

Returns:

  • (Array<Object>)


112
113
114
115
# File 'lib/treezor_client/api/business_api.rb', line 112

def businesssearchs_get(country, opts = {})
  data, _status_code, _headers = businesssearchs_get_with_http_info(country, opts)
  data
end

#businesssearchs_get_with_http_info(country, opts = {}) ⇒ Array<(Array<Object>, Fixnum, Hash)>

search businesses The search endpoint returns some business information.

Parameters:

  • country

    In which country to search. Format ISO 3166-1 alpha-2

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info here.

  • :access_tag (String)

    Access tag is used for idem potency query. More info here.

  • :access_user_id (Integer)

    Access user's id is used for user's action restriction. More info here.

  • :access_user_ip (String)

    Access user's ip is used for user's action restriction. More info here.

  • :name_exact (String)

    Business exact name. Exclusive with nameMatchBeginning and nameClosestKeywords.

  • :name_match_beginning (String)

    Business names begin with. Exclusive with nameExact and nameClosestKeywords.

  • :name_closest_keywords (String)

    Business names closed to keywords. Exclusive with nameExact and nameMatchBeginning.

  • :registration_number (String)

    Business registration number.

  • :vat_number (String)

    Business VAT number.

  • :phone_number (String)

    Business phone number.

  • :address_street (String)

    Business' street address.

  • :address_city (String)

    Business' city address.

  • :address_postal_code (String)

    Business' postal code address.

Returns:

  • (Array<(Array<Object>, Fixnum, Hash)>)

    Array data, response status code and response headers

    
    
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    # File 'lib/treezor_client/api/business_api.rb', line 135
    
    def businesssearchs_get_with_http_info(country, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: BusinessApi.businesssearchs_get ...'
      end
      # verify the required parameter 'country' is set
      if @api_client.config.client_side_validation && country.nil?
        fail ArgumentError, "Missing the required parameter 'country' when calling BusinessApi.businesssearchs_get"
      end
      # resource path
      local_var_path = '/businesssearchs'
    
      # query parameters
      query_params = {}
      query_params[:'country'] = country
      query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
      query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
      query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
      query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
      query_params[:'nameExact'] = opts[:'name_exact'] if !opts[:'name_exact'].nil?
      query_params[:'nameMatchBeginning'] = opts[:'name_match_beginning'] if !opts[:'name_match_beginning'].nil?
      query_params[:'nameClosestKeywords'] = opts[:'name_closest_keywords'] if !opts[:'name_closest_keywords'].nil?
      query_params[:'registrationNumber'] = opts[:'registration_number'] if !opts[:'registration_number'].nil?
      query_params[:'vatNumber'] = opts[:'vat_number'] if !opts[:'vat_number'].nil?
      query_params[:'phoneNumber'] = opts[:'phone_number'] if !opts[:'phone_number'].nil?
      query_params[:'addressStreet'] = opts[:'address_street'] if !opts[:'address_street'].nil?
      query_params[:'addressCity'] = opts[:'address_city'] if !opts[:'address_city'].nil?
      query_params[:'addressPostalCode'] = opts[:'address_postal_code'] if !opts[:'address_postal_code'].nil?
    
      # header parameters
      header_params = {}
    
      # form parameters
      form_params = {}
    
      # http body (model)
      post_body = nil
      auth_names = ['api_key']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<Object>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: BusinessApi#businesssearchs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end