square.rb 3.20191120.0 → 4.0.0.20191217

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/square/api/apple_pay_api.rb +0 -5
  3. data/lib/square/api/base_api.rb +2 -7
  4. data/lib/square/api/cash_drawers_api.rb +150 -0
  5. data/lib/square/api/catalog_api.rb +0 -5
  6. data/lib/square/api/checkout_api.rb +0 -5
  7. data/lib/square/api/customers_api.rb +0 -5
  8. data/lib/square/api/employees_api.rb +0 -5
  9. data/lib/square/api/inventory_api.rb +0 -5
  10. data/lib/square/api/labor_api.rb +0 -5
  11. data/lib/square/api/locations_api.rb +0 -5
  12. data/lib/square/api/merchants_api.rb +0 -5
  13. data/lib/square/api/mobile_authorization_api.rb +0 -5
  14. data/lib/square/api/o_auth_api.rb +0 -5
  15. data/lib/square/api/orders_api.rb +0 -5
  16. data/lib/square/api/payments_api.rb +0 -5
  17. data/lib/square/api/refunds_api.rb +0 -5
  18. data/lib/square/api/reporting_api.rb +0 -5
  19. data/lib/square/api/transactions_api.rb +0 -5
  20. data/lib/square/api/v1_employees_api.rb +0 -5
  21. data/lib/square/api/v1_items_api.rb +0 -5
  22. data/lib/square/api/v1_locations_api.rb +0 -5
  23. data/lib/square/api/v1_transactions_api.rb +1 -7
  24. data/lib/square/api_helper.rb +0 -5
  25. data/lib/square/client.rb +8 -7
  26. data/lib/square/configuration.rb +0 -5
  27. data/lib/square/exceptions/api_exception.rb +0 -5
  28. data/lib/square/http/api_response.rb +0 -5
  29. data/lib/square/http/auth/o_auth2.rb +0 -5
  30. data/lib/square/http/faraday_client.rb +0 -5
  31. data/lib/square/http/http_call_back.rb +0 -5
  32. data/lib/square/http/http_client.rb +0 -5
  33. data/lib/square/http/http_method_enum.rb +0 -5
  34. data/lib/square/http/http_request.rb +0 -5
  35. data/lib/square/http/http_response.rb +0 -5
  36. data/lib/square.rb +1 -5
  37. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd071af18802847ca0f4c4c2fa3578e295f341a253b464f5f43a1d3ea2822fed
4
- data.tar.gz: 835014bce207c0a306b60c3ca6241534b425443052c5575f0775531821049119
3
+ metadata.gz: 8b79344dfa1ffa7565b23b554bc663e4af18402c6c158d12ed9a5c79b7bf2ea7
4
+ data.tar.gz: 1008fab3f5f0199e49158b99e364f7f3a30796596ba5a4e529b9166026cd69f3
5
5
  SHA512:
6
- metadata.gz: 5aa677990bba8f49076dc13214bd597b90759feaa5438a78fae0834a1332916586d355abd49e895e5527fdf18246611790be72bbf406f92391a5214474ebdde3
7
- data.tar.gz: c7a87fd601213ddbecd02d44e54a7cc56cc0fcd9c45379224327d239fd5e1a62465b8850f71f849d281e80bc2d301db1c807a2a37a03a5955e2ff323a34905a0
6
+ metadata.gz: 2707c254aeacf861c339e949e5b921b26fd052a16382f1e5247a6fc3faa19962ecdbc15f3051385bb6dad64da61a4b869dfd9ab35bf198aef8ed285a0dc355b4
7
+ data.tar.gz: 6d40706c4a8b70a1010883bf81ffbfb5ea1de04273f9ae11979dfc9da0f3527c38f778097eec7ca438d1ea9df090792820f4cfdad98cf07dbdb7cda4026fb4f1
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # ApplePayApi
8
3
  class ApplePayApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # BaseApi.
8
3
  class BaseApi
@@ -13,8 +8,8 @@ module Square
13
8
  @http_call_back = http_call_back
14
9
 
15
10
  @global_headers = {
16
- 'user-agent' => 'Square-Ruby-SDK/3.20191120.0',
17
- 'Square-Version' => '2019-11-20'
11
+ 'user-agent' => 'Square-Ruby-SDK/4.0.0.20191217',
12
+ 'Square-Version' => '2019-12-17'
18
13
  }
19
14
  end
20
15
 
@@ -0,0 +1,150 @@
1
+ module Square
2
+ # CashDrawersApi
3
+ class CashDrawersApi < BaseApi
4
+ def initialize(config, http_call_back: nil)
5
+ super(config, http_call_back: http_call_back)
6
+ end
7
+
8
+ # Provides the details for all of the cash drawer shifts for a location
9
+ # in a date range.
10
+ # @param [String] location_id Required parameter: The ID of the location to
11
+ # query for a list of cash drawer shifts.
12
+ # @param [SortOrder] sort_order Optional parameter: The order in which cash
13
+ # drawer shifts are listed in the response, based on their opened_at field.
14
+ # Default value: ASC
15
+ # @param [String] begin_time Optional parameter: The inclusive start time of
16
+ # the query on opened_at, in ISO 8601 format.
17
+ # @param [String] end_time Optional parameter: The exclusive end date of the
18
+ # query on opened_at, in ISO 8601 format.
19
+ # @param [Integer] limit Optional parameter: Number of cash drawer shift
20
+ # events in a page of results (200 by default, 1000 max).
21
+ # @param [String] cursor Optional parameter: Opaque cursor for fetching the
22
+ # next page of results.
23
+ # @return [ListCashDrawerShiftsResponse Hash] response from the API call
24
+ def list_cash_drawer_shifts(location_id:,
25
+ sort_order: nil,
26
+ begin_time: nil,
27
+ end_time: nil,
28
+ limit: nil,
29
+ cursor: nil)
30
+ # Prepare query url.
31
+ _query_builder = config.get_base_uri
32
+ _query_builder << '/v2/cash-drawers/shifts'
33
+ _query_builder = APIHelper.append_url_with_query_parameters(
34
+ _query_builder,
35
+ 'location_id' => location_id,
36
+ 'sort_order' => sort_order,
37
+ 'begin_time' => begin_time,
38
+ 'end_time' => end_time,
39
+ 'limit' => limit,
40
+ 'cursor' => cursor
41
+ )
42
+ _query_url = APIHelper.clean_url _query_builder
43
+
44
+ # Prepare headers.
45
+ _headers = {
46
+ 'accept' => 'application/json'
47
+ }
48
+
49
+ # Prepare and execute HttpRequest.
50
+ _request = config.http_client.get(
51
+ _query_url,
52
+ headers: _headers
53
+ )
54
+ OAuth2.apply(config, _request)
55
+ _response = execute_request(_request)
56
+
57
+ # Return appropriate response type.
58
+ decoded = APIHelper.json_deserialize(_response.raw_body)
59
+ _errors = APIHelper.map_response(decoded, ['errors'])
60
+ ApiResponse.new(_response, data: decoded, errors: _errors)
61
+ end
62
+
63
+ # Provides the summary details for a single cash drawer shift. See
64
+ # RetrieveCashDrawerShiftEvents for a list of cash drawer shift events.
65
+ # @param [String] location_id Required parameter: The ID of the location to
66
+ # retrieve cash drawer shifts from.
67
+ # @param [String] shift_id Required parameter: The shift ID.
68
+ # @return [RetrieveCashDrawerShiftResponse Hash] response from the API call
69
+ def retrieve_cash_drawer_shift(location_id:,
70
+ shift_id:)
71
+ # Prepare query url.
72
+ _query_builder = config.get_base_uri
73
+ _query_builder << '/v2/cash-drawers/shifts/{shift_id}'
74
+ _query_builder = APIHelper.append_url_with_template_parameters(
75
+ _query_builder,
76
+ 'shift_id' => shift_id
77
+ )
78
+ _query_builder = APIHelper.append_url_with_query_parameters(
79
+ _query_builder,
80
+ 'location_id' => location_id
81
+ )
82
+ _query_url = APIHelper.clean_url _query_builder
83
+
84
+ # Prepare headers.
85
+ _headers = {
86
+ 'accept' => 'application/json'
87
+ }
88
+
89
+ # Prepare and execute HttpRequest.
90
+ _request = config.http_client.get(
91
+ _query_url,
92
+ headers: _headers
93
+ )
94
+ OAuth2.apply(config, _request)
95
+ _response = execute_request(_request)
96
+
97
+ # Return appropriate response type.
98
+ decoded = APIHelper.json_deserialize(_response.raw_body)
99
+ _errors = APIHelper.map_response(decoded, ['errors'])
100
+ ApiResponse.new(_response, data: decoded, errors: _errors)
101
+ end
102
+
103
+ # Provides a paginated list of events for a single cash drawer shift.
104
+ # @param [String] location_id Required parameter: The ID of the location to
105
+ # list cash drawer shifts for.
106
+ # @param [String] shift_id Required parameter: The shift ID.
107
+ # @param [Integer] limit Optional parameter: Number of resources to be
108
+ # returned in a page of results (200 by default, 1000 max).
109
+ # @param [String] cursor Optional parameter: Opaque cursor for fetching the
110
+ # next page of results.
111
+ # @return [ListCashDrawerShiftEventsResponse Hash] response from the API call
112
+ def list_cash_drawer_shift_events(location_id:,
113
+ shift_id:,
114
+ limit: nil,
115
+ cursor: nil)
116
+ # Prepare query url.
117
+ _query_builder = config.get_base_uri
118
+ _query_builder << '/v2/cash-drawers/shifts/{shift_id}/events'
119
+ _query_builder = APIHelper.append_url_with_template_parameters(
120
+ _query_builder,
121
+ 'shift_id' => shift_id
122
+ )
123
+ _query_builder = APIHelper.append_url_with_query_parameters(
124
+ _query_builder,
125
+ 'location_id' => location_id,
126
+ 'limit' => limit,
127
+ 'cursor' => cursor
128
+ )
129
+ _query_url = APIHelper.clean_url _query_builder
130
+
131
+ # Prepare headers.
132
+ _headers = {
133
+ 'accept' => 'application/json'
134
+ }
135
+
136
+ # Prepare and execute HttpRequest.
137
+ _request = config.http_client.get(
138
+ _query_url,
139
+ headers: _headers
140
+ )
141
+ OAuth2.apply(config, _request)
142
+ _response = execute_request(_request)
143
+
144
+ # Return appropriate response type.
145
+ decoded = APIHelper.json_deserialize(_response.raw_body)
146
+ _errors = APIHelper.map_response(decoded, ['errors'])
147
+ ApiResponse.new(_response, data: decoded, errors: _errors)
148
+ end
149
+ end
150
+ end
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # CatalogApi
8
3
  class CatalogApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # CheckoutApi
8
3
  class CheckoutApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # CustomersApi
8
3
  class CustomersApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # EmployeesApi
8
3
  class EmployeesApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # InventoryApi
8
3
  class InventoryApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # LaborApi
8
3
  class LaborApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # LocationsApi
8
3
  class LocationsApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # MerchantsApi
8
3
  class MerchantsApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # MobileAuthorizationApi
8
3
  class MobileAuthorizationApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # OAuthApi
8
3
  class OAuthApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # OrdersApi
8
3
  class OrdersApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # PaymentsApi
8
3
  class PaymentsApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # RefundsApi
8
3
  class RefundsApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # ReportingApi
8
3
  class ReportingApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # TransactionsApi
8
3
  class TransactionsApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # V1EmployeesApi
8
3
  class V1EmployeesApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # V1ItemsApi
8
3
  class V1ItemsApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # V1LocationsApi
8
3
  class V1LocationsApi < BaseApi
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # V1TransactionsApi
8
3
  class V1TransactionsApi < BaseApi
@@ -454,8 +449,7 @@ module Square
454
449
  # *Note**: the ListSettlements endpoint does not provide entry
455
450
  # information.
456
451
  # @param [String] location_id Required parameter: The ID of the location to
457
- # list settlements for. If you specify me, this endpoint returns payments
458
- # aggregated from all of the business's locations.
452
+ # list settlements for.
459
453
  # @param [SortOrder] order Optional parameter: TThe order in which payments
460
454
  # are listed in the response.
461
455
  # @param [String] begin_time Optional parameter: The beginning of the
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # API utility class
8
3
  class APIHelper
data/lib/square/client.rb CHANGED
@@ -1,19 +1,14 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # square client class.
8
3
  class Client
9
4
  attr_reader :config
10
5
 
11
6
  def sdk_version
12
- '3.20191120.0'
7
+ '4.0.0.20191217'
13
8
  end
14
9
 
15
10
  def square_version
16
- '2019-11-20'
11
+ '2019-12-17'
17
12
  end
18
13
 
19
14
  # Access to mobile_authorization controller.
@@ -58,6 +53,12 @@ module Square
58
53
  @apple_pay ||= ApplePayApi.new config
59
54
  end
60
55
 
56
+ # Access to cash_drawers controller.
57
+ # @return [CashDrawersApi] Returns the controller instance.
58
+ def cash_drawers
59
+ @cash_drawers ||= CashDrawersApi.new config
60
+ end
61
+
61
62
  # Access to catalog controller.
62
63
  # @return [CatalogApi] Returns the controller instance.
63
64
  def catalog
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # All configuration including auth info and base URI for the API access
8
3
  # are configured in this class.
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # Class for exceptions when there is a network error, status code error, etc.
8
3
  class APIException < StandardError
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # Http response received.
8
3
  class ApiResponse
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # Utility class for OAuth 2 authorization and token management.
8
3
  class OAuth2
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  require 'faraday/http_cache'
7
2
  require 'faraday_middleware'
8
3
 
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # HttpCallBack allows defining callables for pre and post API calls.
8
3
  class HttpCallBack
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # An interface for the methods that an HTTP Client must implement.
8
3
  #
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # HTTP Methods Enumeration.
8
3
  class HttpMethodEnum
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # Represents a single Http Request.
8
3
  class HttpRequest
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  module Square
7
2
  # Http response received.
8
3
  class HttpResponse
data/lib/square.rb CHANGED
@@ -1,8 +1,3 @@
1
- # square
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
1
  require 'date'
7
2
  require 'json'
8
3
  require 'faraday'
@@ -38,6 +33,7 @@ require_relative 'square/api/v1_employees_api.rb'
38
33
  require_relative 'square/api/v1_transactions_api.rb'
39
34
  require_relative 'square/api/v1_items_api.rb'
40
35
  require_relative 'square/api/apple_pay_api.rb'
36
+ require_relative 'square/api/cash_drawers_api.rb'
41
37
  require_relative 'square/api/catalog_api.rb'
42
38
  require_relative 'square/api/customers_api.rb'
43
39
  require_relative 'square/api/employees_api.rb'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: square.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.20191120.0
4
+ version: 4.0.0.20191217
5
5
  platform: ruby
6
6
  authors:
7
7
  - Square Developer Platform
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-20 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -120,6 +120,7 @@ files:
120
120
  - lib/square.rb
121
121
  - lib/square/api/apple_pay_api.rb
122
122
  - lib/square/api/base_api.rb
123
+ - lib/square/api/cash_drawers_api.rb
123
124
  - lib/square/api/catalog_api.rb
124
125
  - lib/square/api/checkout_api.rb
125
126
  - lib/square/api/customers_api.rb