square.rb 15.0.0.20211020 → 17.1.0.20220120

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: 25322287d3387bc053e23f58c5a3b74476789df2145f9648f46b330517aa7574
4
- data.tar.gz: a5476f517732ce5df169b402fded9909cefa155e02c90d9af5996e4dc087a887
3
+ metadata.gz: 407147246777f8a4eda2d4848cad5edb62be5801c25b6361f0dfb21d58663fd9
4
+ data.tar.gz: 735c7e92297b1d4a79ebd856dbe39cc304051536622f0277ddd9489811652cb6
5
5
  SHA512:
6
- metadata.gz: 2d30c67ff2493a1dded81c4078d3549c0c195f092f9826735cd1f98bb6749153bd45d6614419f95f6d6fb32ed505459abc11ab0508b3fa51f0ad089f8a0cce51
7
- data.tar.gz: 2b4a9e0bdb771a3658ec3a46b9838421c154ff1b280da9d27e589111dbb010c2d3c5672ae38d5b22e52ae26f864ae6d8cd76e53effc65e65fdefafcf0b949aa4
6
+ metadata.gz: 90ccb1516f8ff8998787d63a168c8c8688b9a12691d85cac3a2b6af35ce52af93bbc013e11336d5319cc252ec75ce7f790165ea5c38c69367f092e5ef62b365d
7
+ data.tar.gz: 05a3eb69caf678ad7f071b66a27c3ed4375ac96470ba09e51df9db6eba1401b80bd461c7fd6cb7bde91f30bb7ee5d11b9f7f293a59d40c70ab5ed52b25b9d180
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2021 Square, Inc.
1
+ Copyright 2022 Square, Inc.
2
2
  Licensed under the Apache License, Version 2.0 (the "License");
3
3
  you may not use this file except in compliance with the License.
4
4
  You may obtain a copy of the License at
data/README.md CHANGED
@@ -10,7 +10,7 @@ Use this gem to integrate Square payments into your app and grow your business w
10
10
 
11
11
  ## Requirements
12
12
 
13
- We support Ruby 2.5.x, 2.6.x, and 2.7.x.
13
+ We support Ruby 2.5.x, 2.6.x, 2.7.x, and 3.0.x.
14
14
 
15
15
  ## Installation
16
16
 
@@ -349,4 +349,4 @@ You can also use the Square API to create applications or services that work wit
349
349
  [Snippets]: doc/api/snippets.md
350
350
  [Cards]: doc/api/cards.md
351
351
  [Gift Cards]: doc/api/gift-cards.md
352
- [Gift Card Activities]: doc/api/gift-card-activities.md
352
+ [Gift Card Activities]: doc/api/gift-card-activities.md
@@ -30,7 +30,7 @@ module Square
30
30
  # Prepare headers.
31
31
  _headers = {
32
32
  'accept' => 'application/json',
33
- 'content-type' => 'application/json; charset=utf-8'
33
+ 'Content-Type' => 'application/json'
34
34
  }
35
35
 
36
36
  # Prepare and execute HttpRequest.
@@ -1,3 +1,4 @@
1
+ require 'erb'
1
2
  module Square
2
3
  # BaseApi.
3
4
  class BaseApi
@@ -8,7 +9,7 @@ module Square
8
9
  @http_call_back = http_call_back
9
10
 
10
11
  @global_headers = {
11
- 'user-agent' => 'Square-Ruby-SDK/15.0.0.20211020',
12
+ 'user-agent' => get_user_agent,
12
13
  'Square-Version' => config.square_version
13
14
  }
14
15
  end
@@ -35,5 +36,19 @@ module Square
35
36
 
36
37
  response
37
38
  end
39
+
40
+ def get_user_agent
41
+ user_agent = 'Square-Ruby-SDK/17.1.0.20220120 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
42
+ user_agent['{engine}'] = RUBY_ENGINE
43
+ user_agent['{engine-version}'] = RUBY_ENGINE_VERSION
44
+ user_agent['{os-info}'] = RUBY_PLATFORM
45
+ user_agent['{api-version}'] = config.square_version
46
+ if config.user_agent_detail.nil? || config.user_agent_detail.empty?
47
+ user_agent = user_agent.gsub('{detail}', '')
48
+ else
49
+ user_agent['{detail}'] = ERB::Util.url_encode(config.user_agent_detail.to_s)
50
+ end
51
+ user_agent
52
+ end
38
53
  end
39
54
  end
@@ -5,7 +5,75 @@ module Square
5
5
  super(config, http_call_back: http_call_back)
6
6
  end
7
7
 
8
+ # Retrieve a collection of bookings.
9
+ # To call this endpoint with buyer-level permissions, set
10
+ # `APPOINTMENTS_READ` for the OAuth scope.
11
+ # To call this endpoint with seller-level permissions, set
12
+ # `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
13
+ # @param [Integer] limit Optional parameter: The maximum number of results
14
+ # per page to return in a paged response.
15
+ # @param [String] cursor Optional parameter: The pagination cursor from the
16
+ # preceding response to return the next page of the results. Do not set this
17
+ # when retrieving the first page of the results.
18
+ # @param [String] team_member_id Optional parameter: The team member for
19
+ # whom to retrieve bookings. If this is not set, bookings of all members are
20
+ # retrieved.
21
+ # @param [String] location_id Optional parameter: The location for which to
22
+ # retrieve bookings. If this is not set, all locations' bookings are
23
+ # retrieved.
24
+ # @param [String] start_at_min Optional parameter: The RFC 3339 timestamp
25
+ # specifying the earliest of the start time. If this is not set, the current
26
+ # time is used.
27
+ # @param [String] start_at_max Optional parameter: The RFC 3339 timestamp
28
+ # specifying the latest of the start time. If this is not set, the time of
29
+ # 31 days after `start_at_min` is used.
30
+ # @return [ListBookingsResponse Hash] response from the API call
31
+ def list_bookings(limit: nil,
32
+ cursor: nil,
33
+ team_member_id: nil,
34
+ location_id: nil,
35
+ start_at_min: nil,
36
+ start_at_max: nil)
37
+ # Prepare query url.
38
+ _query_builder = config.get_base_uri
39
+ _query_builder << '/v2/bookings'
40
+ _query_builder = APIHelper.append_url_with_query_parameters(
41
+ _query_builder,
42
+ 'limit' => limit,
43
+ 'cursor' => cursor,
44
+ 'team_member_id' => team_member_id,
45
+ 'location_id' => location_id,
46
+ 'start_at_min' => start_at_min,
47
+ 'start_at_max' => start_at_max
48
+ )
49
+ _query_url = APIHelper.clean_url _query_builder
50
+
51
+ # Prepare headers.
52
+ _headers = {
53
+ 'accept' => 'application/json'
54
+ }
55
+
56
+ # Prepare and execute HttpRequest.
57
+ _request = config.http_client.get(
58
+ _query_url,
59
+ headers: _headers
60
+ )
61
+ OAuth2.apply(config, _request)
62
+ _response = execute_request(_request)
63
+
64
+ # Return appropriate response type.
65
+ decoded = APIHelper.json_deserialize(_response.raw_body)
66
+ _errors = APIHelper.map_response(decoded, ['errors'])
67
+ ApiResponse.new(
68
+ _response, data: decoded, errors: _errors
69
+ )
70
+ end
71
+
8
72
  # Creates a booking.
73
+ # To call this endpoint with buyer-level permissions, set
74
+ # `APPOINTMENTS_WRITE` for the OAuth scope.
75
+ # To call this endpoint with seller-level permissions, set
76
+ # `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.
9
77
  # @param [CreateBookingRequest] body Required parameter: An object
10
78
  # containing the fields to POST for the request. See the corresponding
11
79
  # object definition for field details.
@@ -19,7 +87,7 @@ module Square
19
87
  # Prepare headers.
20
88
  _headers = {
21
89
  'accept' => 'application/json',
22
- 'content-type' => 'application/json; charset=utf-8'
90
+ 'Content-Type' => 'application/json'
23
91
  }
24
92
 
25
93
  # Prepare and execute HttpRequest.
@@ -40,6 +108,10 @@ module Square
40
108
  end
41
109
 
42
110
  # Searches for availabilities for booking.
111
+ # To call this endpoint with buyer-level permissions, set
112
+ # `APPOINTMENTS_READ` for the OAuth scope.
113
+ # To call this endpoint with seller-level permissions, set
114
+ # `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
43
115
  # @param [SearchAvailabilityRequest] body Required parameter: An object
44
116
  # containing the fields to POST for the request. See the corresponding
45
117
  # object definition for field details.
@@ -53,7 +125,7 @@ module Square
53
125
  # Prepare headers.
54
126
  _headers = {
55
127
  'accept' => 'application/json',
56
- 'content-type' => 'application/json; charset=utf-8'
128
+ 'Content-Type' => 'application/json'
57
129
  }
58
130
 
59
131
  # Prepare and execute HttpRequest.
@@ -107,9 +179,10 @@ module Square
107
179
  # include only bookable team members in the returned result (`true`) or not
108
180
  # (`false`).
109
181
  # @param [Integer] limit Optional parameter: The maximum number of results
110
- # to return.
111
- # @param [String] cursor Optional parameter: The cursor for paginating
112
- # through the results.
182
+ # to return in a paged response.
183
+ # @param [String] cursor Optional parameter: The pagination cursor from the
184
+ # preceding response to return the next page of the results. Do not set this
185
+ # when retrieving the first page of the results.
113
186
  # @param [String] location_id Optional parameter: Indicates whether to
114
187
  # include only team members enabled at the given location in the returned
115
188
  # result.
@@ -187,6 +260,10 @@ module Square
187
260
  end
188
261
 
189
262
  # Retrieves a booking.
263
+ # To call this endpoint with buyer-level permissions, set
264
+ # `APPOINTMENTS_READ` for the OAuth scope.
265
+ # To call this endpoint with seller-level permissions, set
266
+ # `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
190
267
  # @param [String] booking_id Required parameter: The ID of the
191
268
  # [Booking]($m/Booking) object representing the to-be-retrieved booking.
192
269
  # @return [RetrieveBookingResponse Hash] response from the API call
@@ -222,6 +299,10 @@ module Square
222
299
  end
223
300
 
224
301
  # Updates a booking.
302
+ # To call this endpoint with buyer-level permissions, set
303
+ # `APPOINTMENTS_WRITE` for the OAuth scope.
304
+ # To call this endpoint with seller-level permissions, set
305
+ # `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.
225
306
  # @param [String] booking_id Required parameter: The ID of the
226
307
  # [Booking]($m/Booking) object representing the to-be-updated booking.
227
308
  # @param [UpdateBookingRequest] body Required parameter: An object
@@ -242,7 +323,7 @@ module Square
242
323
  # Prepare headers.
243
324
  _headers = {
244
325
  'accept' => 'application/json',
245
- 'content-type' => 'application/json; charset=utf-8'
326
+ 'Content-Type' => 'application/json'
246
327
  }
247
328
 
248
329
  # Prepare and execute HttpRequest.
@@ -263,6 +344,10 @@ module Square
263
344
  end
264
345
 
265
346
  # Cancels an existing booking.
347
+ # To call this endpoint with buyer-level permissions, set
348
+ # `APPOINTMENTS_WRITE` for the OAuth scope.
349
+ # To call this endpoint with seller-level permissions, set
350
+ # `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.
266
351
  # @param [String] booking_id Required parameter: The ID of the
267
352
  # [Booking]($m/Booking) object representing the to-be-cancelled booking.
268
353
  # @param [CancelBookingRequest] body Required parameter: An object
@@ -283,7 +368,7 @@ module Square
283
368
  # Prepare headers.
284
369
  _headers = {
285
370
  'accept' => 'application/json',
286
- 'content-type' => 'application/json; charset=utf-8'
371
+ 'Content-Type' => 'application/json'
287
372
  }
288
373
 
289
374
  # Prepare and execute HttpRequest.
@@ -76,7 +76,7 @@ module Square
76
76
  # Prepare headers.
77
77
  _headers = {
78
78
  'accept' => 'application/json',
79
- 'content-type' => 'application/json; charset=utf-8'
79
+ 'Content-Type' => 'application/json'
80
80
  }
81
81
 
82
82
  # Prepare and execute HttpRequest.
@@ -29,7 +29,7 @@ module Square
29
29
  # Prepare headers.
30
30
  _headers = {
31
31
  'accept' => 'application/json',
32
- 'content-type' => 'application/json; charset=utf-8'
32
+ 'Content-Type' => 'application/json'
33
33
  }
34
34
 
35
35
  # Prepare and execute HttpRequest.
@@ -68,7 +68,7 @@ module Square
68
68
  # Prepare headers.
69
69
  _headers = {
70
70
  'accept' => 'application/json',
71
- 'content-type' => 'application/json; charset=utf-8'
71
+ 'Content-Type' => 'application/json'
72
72
  }
73
73
 
74
74
  # Prepare and execute HttpRequest.
@@ -115,7 +115,7 @@ module Square
115
115
  # Prepare headers.
116
116
  _headers = {
117
117
  'accept' => 'application/json',
118
- 'content-type' => 'application/json; charset=utf-8'
118
+ 'Content-Type' => 'application/json'
119
119
  }
120
120
 
121
121
  # Prepare and execute HttpRequest.
@@ -136,10 +136,10 @@ module Square
136
136
  end
137
137
 
138
138
  # Uploads an image file to be represented by a
139
- # [CatalogImage]($m/CatalogImage) object linked to an existing
140
- # [CatalogObject]($m/CatalogObject) instance. A call to this endpoint can
141
- # upload an image, link an image to
142
- # a catalog object, or do both.
139
+ # [CatalogImage]($m/CatalogImage) object that can be linked to an existing
140
+ # [CatalogObject]($m/CatalogObject) instance. The resulting `CatalogImage`
141
+ # is unattached to any `CatalogObject` if the `object_id`
142
+ # is not specified.
143
143
  # This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data
144
144
  # requests with a JSON part and an image file part in
145
145
  # JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
@@ -196,6 +196,71 @@ module Square
196
196
  )
197
197
  end
198
198
 
199
+ # Uploads a new image file to replace the existing one in the specified
200
+ # [CatalogImage]($m/CatalogImage) object.
201
+ # This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data
202
+ # requests with a JSON part and an image file part in
203
+ # JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
204
+ # @param [String] image_id Required parameter: The ID of the `CatalogImage`
205
+ # object to update the encapsulated image file.
206
+ # @param [UpdateCatalogImageRequest] request Optional parameter: Example:
207
+ # @param [File | UploadIO] image_file Optional parameter: Example:
208
+ # @return [UpdateCatalogImageResponse Hash] response from the API call
209
+ def update_catalog_image(image_id:,
210
+ request: nil,
211
+ image_file: nil)
212
+ # Prepare query url.
213
+ _query_builder = config.get_base_uri
214
+ _query_builder << '/v2/catalog/images/{image_id}'
215
+ _query_builder = APIHelper.append_url_with_template_parameters(
216
+ _query_builder,
217
+ 'image_id' => { 'value' => image_id, 'encode' => true }
218
+ )
219
+ _query_url = APIHelper.clean_url _query_builder
220
+
221
+ if image_file.is_a? FileWrapper
222
+ image_file_wrapper = image_file.file
223
+ image_file_content_type = image_file.content_type
224
+ else
225
+ image_file_wrapper = image_file
226
+ image_file_content_type = 'image/jpeg'
227
+ end
228
+
229
+ # Prepare headers.
230
+ _headers = {
231
+ 'accept' => 'application/json'
232
+ }
233
+
234
+ # Prepare form parameters.
235
+ _parameters = {
236
+ 'request' => Faraday::UploadIO.new(
237
+ StringIO.new(request.to_json),
238
+ 'application/json'
239
+ ),
240
+ 'image_file' => Faraday::UploadIO.new(
241
+ image_file_wrapper,
242
+ image_file_content_type
243
+ )
244
+ }
245
+ _parameters = APIHelper.form_encode_parameters(_parameters)
246
+
247
+ # Prepare and execute HttpRequest.
248
+ _request = config.http_client.put(
249
+ _query_url,
250
+ headers: _headers,
251
+ parameters: _parameters
252
+ )
253
+ OAuth2.apply(config, _request)
254
+ _response = execute_request(_request)
255
+
256
+ # Return appropriate response type.
257
+ decoded = APIHelper.json_deserialize(_response.raw_body)
258
+ _errors = APIHelper.map_response(decoded, ['errors'])
259
+ ApiResponse.new(
260
+ _response, data: decoded, errors: _errors
261
+ )
262
+ end
263
+
199
264
  # Retrieves information about the Square Catalog API, such as batch size
200
265
  # limits that can be used by the `BatchUpsertCatalogObjects` endpoint.
201
266
  # @return [CatalogInfoResponse Hash] response from the API call
@@ -226,15 +291,12 @@ module Square
226
291
  )
227
292
  end
228
293
 
229
- # Returns a list of [CatalogObject]($m/CatalogObject)s that includes
230
- # all objects of a set of desired types (for example, all
231
- # [CatalogItem]($m/CatalogItem)
232
- # and [CatalogTax]($m/CatalogTax) objects) in the catalog. The `types`
233
- # parameter
234
- # is specified as a comma-separated list of valid
235
- # [CatalogObject]($m/CatalogObject) types:
236
- # `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`,
237
- # `DISCOUNT`, `TAX`, `IMAGE`.
294
+ # Returns a list of all [CatalogObject]($m/CatalogObject)s of the specified
295
+ # types in the catalog.
296
+ # The `types` parameter is specified as a comma-separated list of the
297
+ # [CatalogObjectType]($m/CatalogObjectType) values,
298
+ # for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`,
299
+ # `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`".
238
300
  # __Important:__ ListCatalog does not return deleted catalog items. To
239
301
  # retrieve
240
302
  # deleted catalog items, use
@@ -247,16 +309,22 @@ module Square
247
309
  # for more information.
248
310
  # @param [String] types Optional parameter: An optional case-insensitive,
249
311
  # comma-separated list of object types to retrieve. The valid values are
250
- # defined in the [CatalogObjectType]($m/CatalogObjectType) enum, including
251
- # `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`,
252
- # `MODIFIER_LIST`, or `IMAGE`. If this is unspecified, the operation
253
- # returns objects of all the types at the version of the Square API used to
254
- # make the request.
312
+ # defined in the [CatalogObjectType]($m/CatalogObjectType) enum, for
313
+ # example, `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,
314
+ # `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. If this is unspecified, the
315
+ # operation returns objects of all the top level types at the version of the
316
+ # Square API used to make the request. Object types that are nested onto
317
+ # other object types are not included in the defaults. At the current API
318
+ # version the default object types are: ITEM, CATEGORY, TAX, DISCOUNT,
319
+ # MODIFIER_LIST, DINING_OPTION, TAX_EXEMPTION, SERVICE_CHARGE, PRICING_RULE,
320
+ # PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, SUBSCRIPTION_PLAN,
321
+ # ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.
255
322
  # @param [Long] catalog_version Optional parameter: The specific version of
256
323
  # the catalog objects to be included in the response. This allows you to
257
324
  # retrieve historical versions of objects. The specified version value is
258
325
  # matched against the [CatalogObject]($m/CatalogObject)s' `version`
259
- # attribute.
326
+ # attribute. If not included, results will be from the current version of
327
+ # the catalog.
260
328
  # @return [ListCatalogResponse Hash] response from the API call
261
329
  def list_catalog(cursor: nil,
262
330
  types: nil,
@@ -307,7 +375,7 @@ module Square
307
375
  # Prepare headers.
308
376
  _headers = {
309
377
  'accept' => 'application/json',
310
- 'content-type' => 'application/json; charset=utf-8'
378
+ 'Content-Type' => 'application/json'
311
379
  }
312
380
 
313
381
  # Prepare and execute HttpRequest.
@@ -382,17 +450,24 @@ module Square
382
450
  # catalog objects to be retrieved.
383
451
  # @param [Boolean] include_related_objects Optional parameter: If `true`,
384
452
  # the response will include additional objects that are related to the
385
- # requested object, as follows: If the `object` field of the response
386
- # contains a `CatalogItem`, its associated `CatalogCategory`, `CatalogTax`,
387
- # `CatalogImage` and `CatalogModifierList` objects will be returned in the
388
- # `related_objects` field of the response. If the `object` field of the
389
- # response contains a `CatalogItemVariation`, its parent `CatalogItem` will
390
- # be returned in the `related_objects` field of the response. Default
391
- # value: `false`
453
+ # requested objects. Related objects are defined as any objects referenced
454
+ # by ID by the results in the `objects` field of the response. These objects
455
+ # are put in the `related_objects` field. Setting this to `true` is helpful
456
+ # when the objects are needed for immediate display to a user. This process
457
+ # only goes one level deep. Objects referenced by the related objects will
458
+ # not be included. For example, if the `objects` field of the response
459
+ # contains a CatalogItem, its associated CatalogCategory objects, CatalogTax
460
+ # objects, CatalogImage objects and CatalogModifierLists will be returned in
461
+ # the `related_objects` field of the response. If the `objects` field of the
462
+ # response contains a CatalogItemVariation, its parent CatalogItem will be
463
+ # returned in the `related_objects` field of the response. Default value:
464
+ # `false`
392
465
  # @param [Long] catalog_version Optional parameter: Requests objects as of a
393
466
  # specific version of the catalog. This allows you to retrieve historical
394
467
  # versions of objects. The value to retrieve a specific version of an object
395
468
  # can be found in the version field of [CatalogObject]($m/CatalogObject)s.
469
+ # If not included, results will be from the current version of the
470
+ # catalog.
396
471
  # @return [RetrieveCatalogObjectResponse Hash] response from the API call
397
472
  def retrieve_catalog_object(object_id:,
398
473
  include_related_objects: false,
@@ -462,7 +537,7 @@ module Square
462
537
  # Prepare headers.
463
538
  _headers = {
464
539
  'accept' => 'application/json',
465
- 'content-type' => 'application/json; charset=utf-8'
540
+ 'Content-Type' => 'application/json'
466
541
  }
467
542
 
468
543
  # Prepare and execute HttpRequest.
@@ -512,7 +587,7 @@ module Square
512
587
  # Prepare headers.
513
588
  _headers = {
514
589
  'accept' => 'application/json',
515
- 'content-type' => 'application/json; charset=utf-8'
590
+ 'Content-Type' => 'application/json'
516
591
  }
517
592
 
518
593
  # Prepare and execute HttpRequest.
@@ -548,7 +623,7 @@ module Square
548
623
  # Prepare headers.
549
624
  _headers = {
550
625
  'accept' => 'application/json',
551
- 'content-type' => 'application/json; charset=utf-8'
626
+ 'Content-Type' => 'application/json'
552
627
  }
553
628
 
554
629
  # Prepare and execute HttpRequest.
@@ -584,7 +659,7 @@ module Square
584
659
  # Prepare headers.
585
660
  _headers = {
586
661
  'accept' => 'application/json',
587
- 'content-type' => 'application/json; charset=utf-8'
662
+ 'Content-Type' => 'application/json'
588
663
  }
589
664
 
590
665
  # Prepare and execute HttpRequest.
@@ -28,7 +28,7 @@ module Square
28
28
  # Prepare headers.
29
29
  _headers = {
30
30
  'accept' => 'application/json',
31
- 'content-type' => 'application/json; charset=utf-8'
31
+ 'Content-Type' => 'application/json'
32
32
  }
33
33
 
34
34
  # Prepare and execute HttpRequest.
@@ -66,7 +66,7 @@ module Square
66
66
  # Prepare headers.
67
67
  _headers = {
68
68
  'accept' => 'application/json',
69
- 'content-type' => 'application/json; charset=utf-8'
69
+ 'Content-Type' => 'application/json'
70
70
  }
71
71
 
72
72
  # Prepare and execute HttpRequest.
@@ -177,7 +177,7 @@ module Square
177
177
  # Prepare headers.
178
178
  _headers = {
179
179
  'accept' => 'application/json',
180
- 'content-type' => 'application/json; charset=utf-8'
180
+ 'Content-Type' => 'application/json'
181
181
  }
182
182
 
183
183
  # Prepare and execute HttpRequest.
@@ -88,7 +88,7 @@ module Square
88
88
  # Prepare headers.
89
89
  _headers = {
90
90
  'accept' => 'application/json',
91
- 'content-type' => 'application/json; charset=utf-8'
91
+ 'Content-Type' => 'application/json'
92
92
  }
93
93
 
94
94
  # Prepare and execute HttpRequest.
@@ -132,7 +132,7 @@ module Square
132
132
  # Prepare headers.
133
133
  _headers = {
134
134
  'accept' => 'application/json',
135
- 'content-type' => 'application/json; charset=utf-8'
135
+ 'Content-Type' => 'application/json'
136
136
  }
137
137
 
138
138
  # Prepare and execute HttpRequest.
@@ -274,7 +274,7 @@ module Square
274
274
  # Prepare headers.
275
275
  _headers = {
276
276
  'accept' => 'application/json',
277
- 'content-type' => 'application/json; charset=utf-8'
277
+ 'Content-Type' => 'application/json'
278
278
  }
279
279
 
280
280
  # Prepare and execute HttpRequest.
@@ -320,7 +320,7 @@ module Square
320
320
  # Prepare headers.
321
321
  _headers = {
322
322
  'accept' => 'application/json',
323
- 'content-type' => 'application/json; charset=utf-8'
323
+ 'Content-Type' => 'application/json'
324
324
  }
325
325
 
326
326
  # Prepare and execute HttpRequest.
@@ -74,7 +74,7 @@ module Square
74
74
  # Prepare headers.
75
75
  _headers = {
76
76
  'accept' => 'application/json',
77
- 'content-type' => 'application/json; charset=utf-8'
77
+ 'Content-Type' => 'application/json'
78
78
  }
79
79
 
80
80
  # Prepare and execute HttpRequest.
@@ -259,7 +259,7 @@ module Square
259
259
  # Prepare headers.
260
260
  _headers = {
261
261
  'accept' => 'application/json',
262
- 'content-type' => 'application/json; charset=utf-8'
262
+ 'Content-Type' => 'application/json'
263
263
  }
264
264
 
265
265
  # Prepare and execute HttpRequest.
@@ -13,29 +13,35 @@ module Square
13
13
  # for a gift card,
14
14
  # for all gift cards in a specific region, or for activities within a time
15
15
  # window.
16
- # @param [String] gift_card_id Optional parameter: If you provide a gift
17
- # card ID, the endpoint returns activities that belong to the specified
18
- # gift card. Otherwise, the endpoint returns all gift card activities for
19
- # the seller.
20
- # @param [String] type Optional parameter: If you provide a type, the
21
- # endpoint returns gift card activities of this type. Otherwise, the
22
- # endpoint returns all types of gift card activities.
23
- # @param [String] location_id Optional parameter: If you provide a location
24
- # ID, the endpoint returns gift card activities for that location.
25
- # Otherwise, the endpoint returns gift card activities for all locations.
16
+ # @param [String] gift_card_id Optional parameter: If a gift card ID is
17
+ # provided, the endpoint returns activities related to the specified gift
18
+ # card. Otherwise, the endpoint returns all gift card activities for the
19
+ # seller.
20
+ # @param [String] type Optional parameter: If a
21
+ # [type]($m/GiftCardActivityType) is provided, the endpoint returns gift
22
+ # card activities of the specified type. Otherwise, the endpoint returns
23
+ # all types of gift card activities.
24
+ # @param [String] location_id Optional parameter: If a location ID is
25
+ # provided, the endpoint returns gift card activities for the specified
26
+ # location. Otherwise, the endpoint returns gift card activities for all
27
+ # locations.
26
28
  # @param [String] begin_time Optional parameter: The timestamp for the
27
- # beginning of the reporting period, in RFC 3339 format. Inclusive. Default:
28
- # The current time minus one year.
29
+ # beginning of the reporting period, in RFC 3339 format. This start time is
30
+ # inclusive. The default value is the current time minus one year.
29
31
  # @param [String] end_time Optional parameter: The timestamp for the end of
30
- # the reporting period, in RFC 3339 format. Inclusive. Default: The current
31
- # time.
32
- # @param [Integer] limit Optional parameter: If you provide a limit value,
33
- # the endpoint returns the specified number of results (or less) per page.
34
- # A maximum value is 100. The default value is 50.
32
+ # the reporting period, in RFC 3339 format. This end time is inclusive. The
33
+ # default value is the current time.
34
+ # @param [Integer] limit Optional parameter: If a limit is provided, the
35
+ # endpoint returns the specified number of results (or fewer) per page. The
36
+ # maximum value is 100. The default value is 50. For more information, see
37
+ # [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
38
+ # ion).
35
39
  # @param [String] cursor Optional parameter: A pagination cursor returned by
36
40
  # a previous call to this endpoint. Provide this cursor to retrieve the next
37
- # set of results for the original query. If you do not provide the cursor,
38
- # the call returns the first page of the results.
41
+ # set of results for the original query. If a cursor is not provided, the
42
+ # endpoint returns the first page of the results. For more information, see
43
+ # [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
44
+ # ion).
39
45
  # @param [String] sort_order Optional parameter: The order in which the
40
46
  # endpoint returns the activities, based on `created_at`. - `ASC` - Oldest
41
47
  # to newest. - `DESC` - Newest to oldest (default).
@@ -104,7 +110,7 @@ module Square
104
110
  # Prepare headers.
105
111
  _headers = {
106
112
  'accept' => 'application/json',
107
- 'content-type' => 'application/json; charset=utf-8'
113
+ 'Content-Type' => 'application/json'
108
114
  }
109
115
 
110
116
  # Prepare and execute HttpRequest.