square.rb 38.0.0.20240515 → 38.1.0.20240604

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6495ce763a5a125e487f6c89dc548204e3b09ea93cc8a07b1a9014ff3654478d
4
- data.tar.gz: 67b51c072fa51dacd86c5f4ee9ecb8bad36132fe1ee464eed149034569d8626a
3
+ metadata.gz: b73fd15878a8ff8550633dfb652ac398522bb103de8c0e67d357e7587c638da7
4
+ data.tar.gz: 877ad477b92af86e1a709d10c629119c7f4fa8f0b0be6861097aad04ed5e55d8
5
5
  SHA512:
6
- metadata.gz: 901ff8752e5de5167d3cb7544d68f0591b916440da61ff2c53fac4abe6296c70007fb26946eef41952fc83c85ad05735ba464fcf511f4ae1e7e3e4e5f51645ea
7
- data.tar.gz: b89fffe2fca17d46e05c94a0745f2e8dda7d97b757fb8332701902d0c011c5240fa8b39e29feaced02d3788b4bfb319b65037d3bb24106f04083d225def83a08
6
+ metadata.gz: 6fdeb75512114a6047d5545f2dae44cf729a0c2683586098004fc5dd5a6add3f7d5109a258788331c9b9d071b8b6b5df40ef1185abe4b62652dd7c972fcc0b62
7
+ data.tar.gz: 25f54e977e5ab0b4c359db3513803a14a6e5fd201a94fbc1ce3c8225a124b5f6377440a783547d1a3c993e78479c1ca4f01943d447571b4ee0642471a3cc0dd0
@@ -5,7 +5,7 @@ module Square
5
5
  attr_accessor :config, :http_call_back
6
6
 
7
7
  def self.user_agent
8
- 'Square-Ruby-SDK/38.0.0.20240515 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
8
+ 'Square-Ruby-SDK/38.1.0.20240604 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
9
9
  end
10
10
 
11
11
  def self.user_agent_parameters
@@ -0,0 +1,84 @@
1
+ module Square
2
+ # EventsApi
3
+ class EventsApi < BaseApi
4
+ # Search for Square API events that occur within a 28-day timeframe.
5
+ # @param [SearchEventsRequest] body Required parameter: An object containing
6
+ # the fields to POST for the request. See the corresponding object
7
+ # definition for field details.
8
+ # @return [SearchEventsResponse Hash] response from the API call
9
+ def search_events(body:)
10
+ new_api_call_builder
11
+ .request(new_request_builder(HttpMethodEnum::POST,
12
+ '/v2/events',
13
+ 'default')
14
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
15
+ .body_param(new_parameter(body))
16
+ .header_param(new_parameter('application/json', key: 'accept'))
17
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
18
+ .auth(Single.new('global')))
19
+ .response(new_response_handler
20
+ .deserializer(APIHelper.method(:json_deserialize))
21
+ .is_api_response(true)
22
+ .convertor(ApiResponse.method(:create)))
23
+ .execute
24
+ end
25
+
26
+ # Disables events to prevent them from being searchable.
27
+ # All events are disabled by default. You must enable events to make them
28
+ # searchable.
29
+ # Disabling events for a specific time period prevents them from being
30
+ # searchable, even if you re-enable them later.
31
+ # @return [DisableEventsResponse Hash] response from the API call
32
+ def disable_events
33
+ new_api_call_builder
34
+ .request(new_request_builder(HttpMethodEnum::PUT,
35
+ '/v2/events/disable',
36
+ 'default')
37
+ .header_param(new_parameter('application/json', key: 'accept'))
38
+ .auth(Single.new('global')))
39
+ .response(new_response_handler
40
+ .deserializer(APIHelper.method(:json_deserialize))
41
+ .is_api_response(true)
42
+ .convertor(ApiResponse.method(:create)))
43
+ .execute
44
+ end
45
+
46
+ # Enables events to make them searchable. Only events that occur while in
47
+ # the enabled state are searchable.
48
+ # @return [EnableEventsResponse Hash] response from the API call
49
+ def enable_events
50
+ new_api_call_builder
51
+ .request(new_request_builder(HttpMethodEnum::PUT,
52
+ '/v2/events/enable',
53
+ 'default')
54
+ .header_param(new_parameter('application/json', key: 'accept'))
55
+ .auth(Single.new('global')))
56
+ .response(new_response_handler
57
+ .deserializer(APIHelper.method(:json_deserialize))
58
+ .is_api_response(true)
59
+ .convertor(ApiResponse.method(:create)))
60
+ .execute
61
+ end
62
+
63
+ # Lists all event types that you can subscribe to as webhooks or query using
64
+ # the Events API.
65
+ # @param [String] api_version Optional parameter: The API version for which
66
+ # to list event types. Setting this field overrides the default version used
67
+ # by the application.
68
+ # @return [ListEventTypesResponse Hash] response from the API call
69
+ def list_event_types(api_version: nil)
70
+ new_api_call_builder
71
+ .request(new_request_builder(HttpMethodEnum::GET,
72
+ '/v2/events/types',
73
+ 'default')
74
+ .query_param(new_parameter(api_version, key: 'api_version'))
75
+ .header_param(new_parameter('application/json', key: 'accept'))
76
+ .auth(Single.new('global')))
77
+ .response(new_response_handler
78
+ .deserializer(APIHelper.method(:json_deserialize))
79
+ .is_api_response(true)
80
+ .convertor(ApiResponse.method(:create)))
81
+ .execute
82
+ end
83
+ end
84
+ end
data/lib/square/client.rb CHANGED
@@ -5,7 +5,7 @@ module Square
5
5
  attr_reader :config, :auth_managers
6
6
 
7
7
  def sdk_version
8
- '38.0.0.20240515'
8
+ '38.1.0.20240604'
9
9
  end
10
10
 
11
11
  def square_version
@@ -118,6 +118,12 @@ module Square
118
118
  @employees ||= EmployeesApi.new @global_configuration
119
119
  end
120
120
 
121
+ # Access to events controller.
122
+ # @return [EventsApi] Returns the controller instance.
123
+ def events
124
+ @events ||= EventsApi.new @global_configuration
125
+ end
126
+
121
127
  # Access to gift_cards controller.
122
128
  # @return [GiftCardsApi] Returns the controller instance.
123
129
  def gift_cards
@@ -268,7 +274,7 @@ module Square
268
274
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
269
275
  retry_methods: %i[get put], http_callback: nil, environment: 'production',
270
276
  custom_url: 'https://connect.squareup.com', access_token: nil,
271
- bearer_auth_credentials: nil, square_version: '2024-05-15',
277
+ bearer_auth_credentials: nil, square_version: '2024-06-04',
272
278
  user_agent_detail: '', additional_headers: {}, config: nil
273
279
  )
274
280
  @config = if config.nil?
@@ -7,8 +7,8 @@ module Square
7
7
  end
8
8
 
9
9
  # The attribute readers for properties.
10
- attr_reader :environment, :custom_url, :bearer_auth_credentials, :square_version,
11
- :user_agent_detail
10
+ attr_reader :environment, :custom_url, :bearer_auth_credentials,
11
+ :square_version, :user_agent_detail
12
12
 
13
13
  def additional_headers
14
14
  @additional_headers.clone
@@ -24,7 +24,7 @@ module Square
24
24
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
25
25
  retry_methods: %i[get put], http_callback: nil, environment: 'production',
26
26
  custom_url: 'https://connect.squareup.com', access_token: nil,
27
- bearer_auth_credentials: nil, square_version: '2024-05-15',
27
+ bearer_auth_credentials: nil, square_version: '2024-06-04',
28
28
  user_agent_detail: '', additional_headers: {}
29
29
  )
30
30
 
data/lib/square.rb CHANGED
@@ -48,6 +48,7 @@ require_relative 'square/api/customer_segments_api'
48
48
  require_relative 'square/api/devices_api'
49
49
  require_relative 'square/api/disputes_api'
50
50
  require_relative 'square/api/employees_api'
51
+ require_relative 'square/api/events_api'
51
52
  require_relative 'square/api/gift_cards_api'
52
53
  require_relative 'square/api/gift_card_activities_api'
53
54
  require_relative 'square/api/inventory_api'
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: 38.0.0.20240515
4
+ version: 38.1.0.20240604
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: 2024-05-14 00:00:00.000000000 Z
11
+ date: 2024-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apimatic_core_interfaces
@@ -112,6 +112,7 @@ files:
112
112
  - lib/square/api/devices_api.rb
113
113
  - lib/square/api/disputes_api.rb
114
114
  - lib/square/api/employees_api.rb
115
+ - lib/square/api/events_api.rb
115
116
  - lib/square/api/gift_card_activities_api.rb
116
117
  - lib/square/api/gift_cards_api.rb
117
118
  - lib/square/api/inventory_api.rb