Class: SquareConnect::ReportingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/square_connect/api/reporting_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReportingApi

Returns a new instance of ReportingApi.



16
17
18
# File 'lib/square_connect/api/reporting_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/square_connect/api/reporting_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#list_additional_recipient_receivable_refunds(location_id, opts = {}) ⇒ ListAdditionalRecipientReceivableRefundsResponse

ListAdditionalRecipientReceivableRefunds Returns a list of refunded transactions (across all possible originating locations) relating to monies credited to the provided location ID by another Square account using the ‘additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50

Parameters:

  • location_id

    The ID of the location to list AdditionalRecipientReceivableRefunds for.

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

    the optional parameters

Options Hash (opts):

  • :begin_time (String)

    The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.

  • :sort_order (String)

    The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`

  • :cursor (String)

    A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.

Returns:



29
30
31
32
# File 'lib/square_connect/api/reporting_api.rb', line 29

def list_additional_recipient_receivable_refunds(location_id, opts = {})
  data, _status_code, _headers = list_additional_recipient_receivable_refunds_with_http_info(location_id, opts)
  return data
end

#list_additional_recipient_receivable_refunds_with_http_info(location_id, opts = {}) ⇒ Array<(ListAdditionalRecipientReceivableRefundsResponse, Fixnum, Hash)>

ListAdditionalRecipientReceivableRefunds Returns a list of refunded transactions (across all possible originating locations) relating to monies credited to the provided location ID by another Square account using the &#x60;additional_recipients&#x60; field in a transaction. Max results per [page](#paginatingresults): 50

Parameters:

  • location_id

    The ID of the location to list AdditionalRecipientReceivableRefunds for.

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

    the optional parameters

Options Hash (opts):

  • :begin_time (String)

    The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.

  • :sort_order (String)

    The order in which results are listed in the response (&#x60;ASC&#x60; for oldest first, &#x60;DESC&#x60; for newest first). Default value: &#x60;DESC&#x60;

  • :cursor (String)

    A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.

Returns:



43
44
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
76
77
78
79
80
81
82
83
84
85
# File 'lib/square_connect/api/reporting_api.rb', line 43

def list_additional_recipient_receivable_refunds_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReportingApi.list_additional_recipient_receivable_refunds ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling ReportingApi.list_additional_recipient_receivable_refunds" if location_id.nil?
  # resource path
  local_var_path = "/v2/locations/{location_id}/additional-recipient-receivable-refunds".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'ListAdditionalRecipientReceivableRefundsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReportingApi#list_additional_recipient_receivable_refunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_additional_recipient_receivables(location_id, opts = {}) ⇒ ListAdditionalRecipientReceivablesResponse

ListAdditionalRecipientReceivables Returns a list of receivables (across all possible sending locations) representing monies credited to the provided location ID by another Square account using the ‘additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50

Parameters:

  • location_id

    The ID of the location to list AdditionalRecipientReceivables for.

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

    the optional parameters

Options Hash (opts):

  • :begin_time (String)

    The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.

  • :sort_order (String)

    The order in which results are listed in the response (&#x60;ASC&#x60; for oldest first, &#x60;DESC&#x60; for newest first). Default value: &#x60;DESC&#x60;

  • :cursor (String)

    A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.

Returns:



96
97
98
99
# File 'lib/square_connect/api/reporting_api.rb', line 96

def list_additional_recipient_receivables(location_id, opts = {})
  data, _status_code, _headers = list_additional_recipient_receivables_with_http_info(location_id, opts)
  return data
end

#list_additional_recipient_receivables_with_http_info(location_id, opts = {}) ⇒ Array<(ListAdditionalRecipientReceivablesResponse, Fixnum, Hash)>

ListAdditionalRecipientReceivables Returns a list of receivables (across all possible sending locations) representing monies credited to the provided location ID by another Square account using the &#x60;additional_recipients&#x60; field in a transaction. Max results per [page](#paginatingresults): 50

Parameters:

  • location_id

    The ID of the location to list AdditionalRecipientReceivables for.

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

    the optional parameters

Options Hash (opts):

  • :begin_time (String)

    The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.

  • :end_time (String)

    The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.

  • :sort_order (String)

    The order in which results are listed in the response (&#x60;ASC&#x60; for oldest first, &#x60;DESC&#x60; for newest first). Default value: &#x60;DESC&#x60;

  • :cursor (String)

    A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.

Returns:



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/square_connect/api/reporting_api.rb', line 110

def list_additional_recipient_receivables_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ReportingApi.list_additional_recipient_receivables ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling ReportingApi.list_additional_recipient_receivables" if location_id.nil?
  # resource path
  local_var_path = "/v2/locations/{location_id}/additional-recipient-receivables".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'begin_time'] = opts[:'begin_time'] if !opts[:'begin_time'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'ListAdditionalRecipientReceivablesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReportingApi#list_additional_recipient_receivables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end