square_connect 2.3.1.161 → 2.4.0.170
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +10 -0
- data/README.md +11 -6
- data/docs/ApplePayApi.md +61 -0
- data/docs/CatalogObject.md +1 -1
- data/docs/Location.md +2 -1
- data/docs/LocationCapability.md +1 -1
- data/docs/LocationType.md +13 -0
- data/docs/RegisterDomainRequest.md +12 -0
- data/docs/RegisterDomainResponse.md +13 -0
- data/docs/RegisterDomainResponseStatus.md +13 -0
- data/lib/square_connect.rb +5 -0
- data/lib/square_connect/api/apple_pay_api.rb +73 -0
- data/lib/square_connect/api_client.rb +1 -1
- data/lib/square_connect/models/catalog_object.rb +1 -1
- data/lib/square_connect/models/location.rb +27 -5
- data/lib/square_connect/models/location_type.rb +19 -0
- data/lib/square_connect/models/register_domain_request.rb +219 -0
- data/lib/square_connect/models/register_domain_response.rb +231 -0
- data/lib/square_connect/models/register_domain_response_status.rb +19 -0
- data/lib/square_connect/version.rb +1 -1
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7cfc2e716f5e621d8fa088ef2938d39819713ef
|
4
|
+
data.tar.gz: 014bc43e82ea20963232ea56af27ed67d135c990
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24b135ba25729c8a2741a895e9c49f75ae7e8e3738ffab6f67018b345cbf6df46c44b1a414f393c29c280f55b20de3d58c78a23b6e542811ecba666f4568e5f4
|
7
|
+
data.tar.gz: ad25c3ef959e269b32217b811aae652955259585e9ddfe1bb482536b04c51ef27cd408f8c89aa7e22dfeff4484cf937b33219370c84b3d52a23b58275df92dc8
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## Version 2.4 (2017-09-27)
|
4
|
+
|
5
|
+
### New features: Register Domain for Apple Pay
|
6
|
+
|
7
|
+
* `RegisterDomain` endpoint activates a domain for use with Web Apple Pay.
|
8
|
+
|
9
|
+
### Other Changes
|
10
|
+
|
11
|
+
* `Location.type` used to indicate whether or not the location object represents a physical space.
|
12
|
+
|
3
13
|
## Version 2.3.1 (2017-09-15)
|
4
14
|
|
5
15
|
### New features: Charge Orders
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ for the specification and template files we used to generate this.
|
|
10
10
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
11
11
|
|
12
12
|
- API version: 2.0
|
13
|
-
- Package version: 2.
|
13
|
+
- Package version: 2.4.0
|
14
14
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
15
15
|
|
16
16
|
For more information, please visit [https://squareup.com/developers](https://squareup.com/developers)
|
@@ -57,17 +57,17 @@ SquareConnect.configure do |config|
|
|
57
57
|
config.access_token = 'YOUR ACCESS TOKEN'
|
58
58
|
end
|
59
59
|
|
60
|
-
api_instance = SquareConnect::
|
60
|
+
api_instance = SquareConnect::ApplePayApi.new
|
61
61
|
|
62
|
-
body = SquareConnect::
|
62
|
+
body = SquareConnect::RegisterDomainRequest.new # RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
63
63
|
|
64
64
|
|
65
65
|
begin
|
66
|
-
#
|
67
|
-
result = api_instance.
|
66
|
+
#RegisterDomain
|
67
|
+
result = api_instance.register_domain(body)
|
68
68
|
p result
|
69
69
|
rescue SquareConnect::ApiError => e
|
70
|
-
puts "Exception when calling
|
70
|
+
puts "Exception when calling ApplePayApi->register_domain: #{e}"
|
71
71
|
end
|
72
72
|
|
73
73
|
```
|
@@ -78,6 +78,7 @@ All URIs are relative to *https://connect.squareup.com*
|
|
78
78
|
|
79
79
|
Class | Method | HTTP request | Description
|
80
80
|
------------ | ------------- | ------------- | -------------
|
81
|
+
*SquareConnect::ApplePayApi* | [**register_domain**](docs/ApplePayApi.md#register_domain) | **POST** /v2/apple-pay/domains | RegisterDomain
|
81
82
|
*SquareConnect::CatalogApi* | [**batch_delete_catalog_objects**](docs/CatalogApi.md#batch_delete_catalog_objects) | **POST** /v2/catalog/batch-delete | BatchDeleteCatalogObjects
|
82
83
|
*SquareConnect::CatalogApi* | [**batch_retrieve_catalog_objects**](docs/CatalogApi.md#batch_retrieve_catalog_objects) | **POST** /v2/catalog/batch-retrieve | BatchRetrieveCatalogObjects
|
83
84
|
*SquareConnect::CatalogApi* | [**batch_upsert_catalog_objects**](docs/CatalogApi.md#batch_upsert_catalog_objects) | **POST** /v2/catalog/batch-upsert | BatchUpsertCatalogObjects
|
@@ -269,6 +270,7 @@ Class | Method | HTTP request | Description
|
|
269
270
|
- [SquareConnect::Location](docs/Location.md)
|
270
271
|
- [SquareConnect::LocationCapability](docs/LocationCapability.md)
|
271
272
|
- [SquareConnect::LocationStatus](docs/LocationStatus.md)
|
273
|
+
- [SquareConnect::LocationType](docs/LocationType.md)
|
272
274
|
- [SquareConnect::Money](docs/Money.md)
|
273
275
|
- [SquareConnect::Order](docs/Order.md)
|
274
276
|
- [SquareConnect::OrderLineItem](docs/OrderLineItem.md)
|
@@ -280,6 +282,9 @@ Class | Method | HTTP request | Description
|
|
280
282
|
- [SquareConnect::OrderLineItemTaxType](docs/OrderLineItemTaxType.md)
|
281
283
|
- [SquareConnect::Refund](docs/Refund.md)
|
282
284
|
- [SquareConnect::RefundStatus](docs/RefundStatus.md)
|
285
|
+
- [SquareConnect::RegisterDomainRequest](docs/RegisterDomainRequest.md)
|
286
|
+
- [SquareConnect::RegisterDomainResponse](docs/RegisterDomainResponse.md)
|
287
|
+
- [SquareConnect::RegisterDomainResponseStatus](docs/RegisterDomainResponseStatus.md)
|
283
288
|
- [SquareConnect::RetrieveCatalogObjectRequest](docs/RetrieveCatalogObjectRequest.md)
|
284
289
|
- [SquareConnect::RetrieveCatalogObjectResponse](docs/RetrieveCatalogObjectResponse.md)
|
285
290
|
- [SquareConnect::RetrieveCustomerRequest](docs/RetrieveCustomerRequest.md)
|
data/docs/ApplePayApi.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# SquareConnect::ApplePayApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://connect.squareup.com*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**register_domain**](ApplePayApi.md#register_domain) | **POST** /v2/apple-pay/domains | RegisterDomain
|
8
|
+
|
9
|
+
|
10
|
+
# **register_domain**
|
11
|
+
> RegisterDomainResponse register_domain(body)
|
12
|
+
|
13
|
+
RegisterDomain
|
14
|
+
|
15
|
+
Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide.
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'square_connect'
|
21
|
+
# setup authorization
|
22
|
+
SquareConnect.configure do |config|
|
23
|
+
# Configure OAuth2 access token for authorization: oauth2
|
24
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
25
|
+
end
|
26
|
+
|
27
|
+
api_instance = SquareConnect::ApplePayApi.new
|
28
|
+
|
29
|
+
body = SquareConnect::RegisterDomainRequest.new # RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
30
|
+
|
31
|
+
|
32
|
+
begin
|
33
|
+
#RegisterDomain
|
34
|
+
result = api_instance.register_domain(body)
|
35
|
+
p result
|
36
|
+
rescue SquareConnect::ApiError => e
|
37
|
+
puts "Exception when calling ApplePayApi->register_domain: #{e}"
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
### Parameters
|
42
|
+
|
43
|
+
Name | Type | Description | Notes
|
44
|
+
------------- | ------------- | ------------- | -------------
|
45
|
+
**body** | [**RegisterDomainRequest**](RegisterDomainRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
|
46
|
+
|
47
|
+
### Return type
|
48
|
+
|
49
|
+
[**RegisterDomainResponse**](RegisterDomainResponse.md)
|
50
|
+
|
51
|
+
### Authorization
|
52
|
+
|
53
|
+
[oauth2](../README.md#oauth2)
|
54
|
+
|
55
|
+
### HTTP request headers
|
56
|
+
|
57
|
+
- **Content-Type**: application/json
|
58
|
+
- **Accept**: application/json
|
59
|
+
|
60
|
+
|
61
|
+
|
data/docs/CatalogObject.md
CHANGED
@@ -13,7 +13,7 @@ Name | Type | Description | Notes
|
|
13
13
|
**version** | **Integer** | The version of the object. When updating an object, the version supplied by the must match the version in the database, otherwise the write will be rejected as conflicting. | [optional]
|
14
14
|
**is_deleted** | **BOOLEAN** | If `true`, the object has been deleted from the database. Must be `false` for new objects being inserted. When deleted, the `updated_at` field will equal the deletion time. | [optional]
|
15
15
|
**catalog_v1_ids** | [**Array<CatalogV1Id>**](CatalogV1Id.md) | The Connect V1 IDs for this object at each [location](#type-location) where it is present, where they differ from the object's Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs. | [optional]
|
16
|
-
**present_at_all_locations** | **BOOLEAN** | If `true`, this object is present at all locations (including future locations), except where specified in the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), except where specified in the `present_at_location_ids` field. | [optional]
|
16
|
+
**present_at_all_locations** | **BOOLEAN** | If `true`, this object is present at all locations (including future locations), except where specified in the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. | [optional]
|
17
17
|
**present_at_location_ids** | **Array<String>** | A list of locations where the object is present, even if `present_at_all_locations` is `false`. | [optional]
|
18
18
|
**absent_at_location_ids** | **Array<String>** | A list of locations where the object is not present, even if `present_at_all_locations` is `true`. | [optional]
|
19
19
|
**item_data** | [**CatalogItem**](CatalogItem.md) | Structured data for a [CatalogItem](#type-catalogitem), set for CatalogObjects of type `ITEM`. | [optional]
|
data/docs/Location.md
CHANGED
@@ -8,7 +8,7 @@ Represents one of a business's locations.
|
|
8
8
|
Name | Type | Description | Notes
|
9
9
|
------------ | ------------- | ------------- | -------------
|
10
10
|
**id** | **String** | The location's unique ID. | [optional]
|
11
|
-
**name** | **String** | The location's name. Location names are set by the
|
11
|
+
**name** | **String** | The location's name. Location names are set by the account owner and displayed in the dashboard as the location's nickname | [optional]
|
12
12
|
**address** | [**Address**](Address.md) | The location's physical address. | [optional]
|
13
13
|
**timezone** | **String** | The [IANA Timezone Database](https://www.iana.org/time-zones) identifier for the location's timezone. | [optional]
|
14
14
|
**capabilities** | **Array<String>** | Indicates which Square features are enabled for the location. See [LocationCapability](#type-locationcapability) for possible values. | [optional]
|
@@ -20,5 +20,6 @@ Name | Type | Description | Notes
|
|
20
20
|
**currency** | **String** | The currency used for all transactions at this location, specified in __ISO 4217 format__. For example, the currency for a location processing transactions in the United States is 'USD'. See [Currency](#type-currency) for possible values. | [optional]
|
21
21
|
**phone_number** | **String** | The location's phone_number. | [optional]
|
22
22
|
**business_name** | **String** | The location's business_name which is shown to its customers. For example, this is the name printed on its customer's receipts. | [optional]
|
23
|
+
**type** | **String** | The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values. | [optional]
|
23
24
|
|
24
25
|
|
data/docs/LocationCapability.md
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
# SquareConnect::RegisterDomainRequest
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Defines the parameters that can be included in the body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint.
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**domain_name** | **String** | A domain name as described in RFC-1034 that will be registered with ApplePay |
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# SquareConnect::RegisterDomainResponse
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
Defines the fields that are included in the response body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. Either `errors` or `status` will be present in a given response (never both).
|
6
|
+
|
7
|
+
## Properties
|
8
|
+
Name | Type | Description | Notes
|
9
|
+
------------ | ------------- | ------------- | -------------
|
10
|
+
**errors** | [**Array<Error>**](Error.md) | Any errors that occurred during the request. | [optional]
|
11
|
+
**status** | **String** | Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values. | [optional]
|
12
|
+
|
13
|
+
|
data/lib/square_connect.rb
CHANGED
@@ -103,6 +103,7 @@ require 'square_connect/models/list_transactions_response'
|
|
103
103
|
require 'square_connect/models/location'
|
104
104
|
require 'square_connect/models/location_capability'
|
105
105
|
require 'square_connect/models/location_status'
|
106
|
+
require 'square_connect/models/location_type'
|
106
107
|
require 'square_connect/models/money'
|
107
108
|
require 'square_connect/models/order'
|
108
109
|
require 'square_connect/models/order_line_item'
|
@@ -114,6 +115,9 @@ require 'square_connect/models/order_line_item_tax'
|
|
114
115
|
require 'square_connect/models/order_line_item_tax_type'
|
115
116
|
require 'square_connect/models/refund'
|
116
117
|
require 'square_connect/models/refund_status'
|
118
|
+
require 'square_connect/models/register_domain_request'
|
119
|
+
require 'square_connect/models/register_domain_response'
|
120
|
+
require 'square_connect/models/register_domain_response_status'
|
117
121
|
require 'square_connect/models/retrieve_catalog_object_request'
|
118
122
|
require 'square_connect/models/retrieve_catalog_object_response'
|
119
123
|
require 'square_connect/models/retrieve_customer_request'
|
@@ -183,6 +187,7 @@ require 'square_connect/models/void_transaction_request'
|
|
183
187
|
require 'square_connect/models/void_transaction_response'
|
184
188
|
|
185
189
|
# APIs
|
190
|
+
require 'square_connect/api/apple_pay_api'
|
186
191
|
require 'square_connect/api/catalog_api'
|
187
192
|
require 'square_connect/api/checkout_api'
|
188
193
|
require 'square_connect/api/customers_api'
|
@@ -0,0 +1,73 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
Contact: developers@squareup.com
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require "uri"
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
class ApplePayApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
|
20
|
+
# RegisterDomain
|
21
|
+
# Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide.
|
22
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [RegisterDomainResponse]
|
25
|
+
def register_domain(body, opts = {})
|
26
|
+
data, _status_code, _headers = register_domain_with_http_info(body, opts)
|
27
|
+
return data
|
28
|
+
end
|
29
|
+
|
30
|
+
# RegisterDomain
|
31
|
+
# Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide.
|
32
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(RegisterDomainResponse, Fixnum, Hash)>] RegisterDomainResponse data, response status code and response headers
|
35
|
+
def register_domain_with_http_info(body, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug "Calling API: ApplePayApi.register_domain ..."
|
38
|
+
end
|
39
|
+
# verify the required parameter 'body' is set
|
40
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ApplePayApi.register_domain" if body.nil?
|
41
|
+
# resource path
|
42
|
+
local_var_path = "/v2/apple-pay/domains".sub('{format}','json')
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = @api_client.object_to_http_body(body)
|
59
|
+
auth_names = ['oauth2']
|
60
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names,
|
66
|
+
:return_type => 'RegisterDomainResponse')
|
67
|
+
if @api_client.config.debugging
|
68
|
+
@api_client.config.logger.debug "API called: ApplePayApi#register_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
69
|
+
end
|
70
|
+
return data, status_code, headers
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -30,7 +30,7 @@ module SquareConnect
|
|
30
30
|
@config = config
|
31
31
|
|
32
32
|
# Construct user agent string. Returns slightly different string for JRuby
|
33
|
-
@user_agent = "Square-Connect-Ruby/2.
|
33
|
+
@user_agent = "Square-Connect-Ruby/2.4.0"
|
34
34
|
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => "application/json",
|
@@ -30,7 +30,7 @@ module SquareConnect
|
|
30
30
|
# The Connect V1 IDs for this object at each [location](#type-location) where it is present, where they differ from the object's Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs.
|
31
31
|
attr_accessor :catalog_v1_ids
|
32
32
|
|
33
|
-
# If `true`, this object is present at all locations (including future locations), except where specified in the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), except where specified in the `present_at_location_ids` field.
|
33
|
+
# If `true`, this object is present at all locations (including future locations), except where specified in the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations), except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`.
|
34
34
|
attr_accessor :present_at_all_locations
|
35
35
|
|
36
36
|
# A list of locations where the object is present, even if `present_at_all_locations` is `false`.
|
@@ -15,7 +15,7 @@ module SquareConnect
|
|
15
15
|
# The location's unique ID.
|
16
16
|
attr_accessor :id
|
17
17
|
|
18
|
-
# The location's name. Location names are set by the
|
18
|
+
# The location's name. Location names are set by the account owner and displayed in the dashboard as the location's nickname
|
19
19
|
attr_accessor :name
|
20
20
|
|
21
21
|
# The location's physical address.
|
@@ -51,6 +51,9 @@ module SquareConnect
|
|
51
51
|
# The location's business_name which is shown to its customers. For example, this is the name printed on its customer's receipts.
|
52
52
|
attr_accessor :business_name
|
53
53
|
|
54
|
+
# The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values.
|
55
|
+
attr_accessor :type
|
56
|
+
|
54
57
|
class EnumAttributeValidator
|
55
58
|
attr_reader :datatype
|
56
59
|
attr_reader :allowable_values
|
@@ -88,7 +91,8 @@ module SquareConnect
|
|
88
91
|
:'language_code' => :'language_code',
|
89
92
|
:'currency' => :'currency',
|
90
93
|
:'phone_number' => :'phone_number',
|
91
|
-
:'business_name' => :'business_name'
|
94
|
+
:'business_name' => :'business_name',
|
95
|
+
:'type' => :'type'
|
92
96
|
}
|
93
97
|
end
|
94
98
|
|
@@ -107,7 +111,8 @@ module SquareConnect
|
|
107
111
|
:'language_code' => :'String',
|
108
112
|
:'currency' => :'String',
|
109
113
|
:'phone_number' => :'String',
|
110
|
-
:'business_name' => :'String'
|
114
|
+
:'business_name' => :'String',
|
115
|
+
:'type' => :'String'
|
111
116
|
}
|
112
117
|
end
|
113
118
|
|
@@ -173,6 +178,10 @@ module SquareConnect
|
|
173
178
|
self.business_name = attributes[:'business_name']
|
174
179
|
end
|
175
180
|
|
181
|
+
if attributes.has_key?(:'type')
|
182
|
+
self.type = attributes[:'type']
|
183
|
+
end
|
184
|
+
|
176
185
|
end
|
177
186
|
|
178
187
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -191,6 +200,8 @@ module SquareConnect
|
|
191
200
|
return false unless country_validator.valid?(@country)
|
192
201
|
currency_validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
|
193
202
|
return false unless currency_validator.valid?(@currency)
|
203
|
+
type_validator = EnumAttributeValidator.new('String', ["PHYSICAL", "MOBILE"])
|
204
|
+
return false unless type_validator.valid?(@type)
|
194
205
|
return true
|
195
206
|
end
|
196
207
|
|
@@ -224,6 +235,16 @@ module SquareConnect
|
|
224
235
|
@currency = currency
|
225
236
|
end
|
226
237
|
|
238
|
+
# Custom attribute writer method checking allowed values (enum).
|
239
|
+
# @param [Object] type Object to be assigned
|
240
|
+
def type=(type)
|
241
|
+
validator = EnumAttributeValidator.new('String', ["PHYSICAL", "MOBILE"])
|
242
|
+
unless validator.valid?(type)
|
243
|
+
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
244
|
+
end
|
245
|
+
@type = type
|
246
|
+
end
|
247
|
+
|
227
248
|
# Checks equality by comparing each attribute.
|
228
249
|
# @param [Object] Object to be compared
|
229
250
|
def ==(o)
|
@@ -241,7 +262,8 @@ module SquareConnect
|
|
241
262
|
language_code == o.language_code &&
|
242
263
|
currency == o.currency &&
|
243
264
|
phone_number == o.phone_number &&
|
244
|
-
business_name == o.business_name
|
265
|
+
business_name == o.business_name &&
|
266
|
+
type == o.type
|
245
267
|
end
|
246
268
|
|
247
269
|
# @see the `==` method
|
@@ -253,7 +275,7 @@ module SquareConnect
|
|
253
275
|
# Calculates hash code according to all attributes.
|
254
276
|
# @return [Fixnum] Hash code
|
255
277
|
def hash
|
256
|
-
[id, name, address, timezone, capabilities, status, created_at, merchant_id, country, language_code, currency, phone_number, business_name].hash
|
278
|
+
[id, name, address, timezone, capabilities, status, created_at, merchant_id, country, language_code, currency, phone_number, business_name, type].hash
|
257
279
|
end
|
258
280
|
|
259
281
|
# Builds the object from hash
|
@@ -0,0 +1,19 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
Contact: developers@squareup.com
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
class LocationType
|
14
|
+
|
15
|
+
PHYSICAL = "PHYSICAL".freeze
|
16
|
+
MOBILE = "MOBILE".freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
Contact: developers@squareup.com
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
# Defines the parameters that can be included in the body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint.
|
14
|
+
class RegisterDomainRequest
|
15
|
+
# A domain name as described in RFC-1034 that will be registered with ApplePay
|
16
|
+
attr_accessor :domain_name
|
17
|
+
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'domain_name' => :'domain_name'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'domain_name' => :'String'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
40
|
+
|
41
|
+
if attributes.has_key?(:'domain_name')
|
42
|
+
self.domain_name = attributes[:'domain_name']
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
48
|
+
# @return Array for valid properies with the reasons
|
49
|
+
def list_invalid_properties
|
50
|
+
invalid_properties = Array.new
|
51
|
+
if @domain_name.nil?
|
52
|
+
invalid_properties.push("invalid value for 'domain_name', domain_name cannot be nil.")
|
53
|
+
end
|
54
|
+
|
55
|
+
if @domain_name.to_s.length > 255
|
56
|
+
invalid_properties.push("invalid value for 'domain_name', the character length must be smaller than or equal to 255.")
|
57
|
+
end
|
58
|
+
|
59
|
+
if @domain_name.to_s.length < 1
|
60
|
+
invalid_properties.push("invalid value for 'domain_name', the character length must be great than or equal to 1.")
|
61
|
+
end
|
62
|
+
|
63
|
+
return invalid_properties
|
64
|
+
end
|
65
|
+
|
66
|
+
# Check to see if the all the properties in the model are valid
|
67
|
+
# @return true if the model is valid
|
68
|
+
def valid?
|
69
|
+
return false if @domain_name.nil?
|
70
|
+
return false if @domain_name.to_s.length > 255
|
71
|
+
return false if @domain_name.to_s.length < 1
|
72
|
+
return true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Custom attribute writer method with validation
|
76
|
+
# @param [Object] domain_name Value to be assigned
|
77
|
+
def domain_name=(domain_name)
|
78
|
+
if domain_name.nil?
|
79
|
+
fail ArgumentError, "domain_name cannot be nil"
|
80
|
+
end
|
81
|
+
|
82
|
+
if domain_name.to_s.length > 255
|
83
|
+
fail ArgumentError, "invalid value for 'domain_name', the character length must be smaller than or equal to 255."
|
84
|
+
end
|
85
|
+
|
86
|
+
if domain_name.to_s.length < 1
|
87
|
+
fail ArgumentError, "invalid value for 'domain_name', the character length must be great than or equal to 1."
|
88
|
+
end
|
89
|
+
|
90
|
+
@domain_name = domain_name
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
domain_name == o.domain_name
|
99
|
+
end
|
100
|
+
|
101
|
+
# @see the `==` method
|
102
|
+
# @param [Object] Object to be compared
|
103
|
+
def eql?(o)
|
104
|
+
self == o
|
105
|
+
end
|
106
|
+
|
107
|
+
# Calculates hash code according to all attributes.
|
108
|
+
# @return [Fixnum] Hash code
|
109
|
+
def hash
|
110
|
+
[domain_name].hash
|
111
|
+
end
|
112
|
+
|
113
|
+
# Builds the object from hash
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
# @return [Object] Returns the model itself
|
116
|
+
def build_from_hash(attributes)
|
117
|
+
return nil unless attributes.is_a?(Hash)
|
118
|
+
self.class.swagger_types.each_pair do |key, type|
|
119
|
+
if type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
123
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
124
|
+
end
|
125
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
126
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
127
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
128
|
+
end
|
129
|
+
|
130
|
+
self
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes the data based on type
|
134
|
+
# @param string type Data type
|
135
|
+
# @param string value Value to be deserialized
|
136
|
+
# @return [Object] Deserialized data
|
137
|
+
def _deserialize(type, value)
|
138
|
+
case type.to_sym
|
139
|
+
when :DateTime
|
140
|
+
DateTime.parse(value)
|
141
|
+
when :Date
|
142
|
+
Date.parse(value)
|
143
|
+
when :String
|
144
|
+
value.to_s
|
145
|
+
when :Integer
|
146
|
+
value.to_i
|
147
|
+
when :Float
|
148
|
+
value.to_f
|
149
|
+
when :BOOLEAN
|
150
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
151
|
+
true
|
152
|
+
else
|
153
|
+
false
|
154
|
+
end
|
155
|
+
when :Object
|
156
|
+
# generic object (usually a Hash), return directly
|
157
|
+
value
|
158
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
159
|
+
inner_type = Regexp.last_match[:inner_type]
|
160
|
+
value.map { |v| _deserialize(inner_type, v) }
|
161
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
162
|
+
k_type = Regexp.last_match[:k_type]
|
163
|
+
v_type = Regexp.last_match[:v_type]
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each do |k, v|
|
166
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
else # model
|
170
|
+
temp_model = SquareConnect.const_get(type).new
|
171
|
+
temp_model.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
next if value.nil?
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map{ |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
@@ -0,0 +1,231 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
Contact: developers@squareup.com
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
# Defines the fields that are included in the response body of a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. Either `errors` or `status` will be present in a given response (never both).
|
14
|
+
class RegisterDomainResponse
|
15
|
+
# Any errors that occurred during the request.
|
16
|
+
attr_accessor :errors
|
17
|
+
|
18
|
+
# Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values.
|
19
|
+
attr_accessor :status
|
20
|
+
|
21
|
+
class EnumAttributeValidator
|
22
|
+
attr_reader :datatype
|
23
|
+
attr_reader :allowable_values
|
24
|
+
|
25
|
+
def initialize(datatype, allowable_values)
|
26
|
+
@allowable_values = allowable_values.map do |value|
|
27
|
+
case datatype.to_s
|
28
|
+
when /Integer/i
|
29
|
+
value.to_i
|
30
|
+
when /Float/i
|
31
|
+
value.to_f
|
32
|
+
else
|
33
|
+
value
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def valid?(value)
|
39
|
+
!value || allowable_values.include?(value)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'errors' => :'errors',
|
47
|
+
:'status' => :'status'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute type mapping.
|
52
|
+
def self.swagger_types
|
53
|
+
{
|
54
|
+
:'errors' => :'Array<Error>',
|
55
|
+
:'status' => :'String'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
return unless attributes.is_a?(Hash)
|
63
|
+
|
64
|
+
# convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
66
|
+
|
67
|
+
if attributes.has_key?(:'errors')
|
68
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
69
|
+
self.errors = value
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'status')
|
74
|
+
self.status = attributes[:'status']
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properies with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
return invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
status_validator = EnumAttributeValidator.new('String', ["PENDING", "VERIFIED"])
|
90
|
+
return false unless status_validator.valid?(@status)
|
91
|
+
return true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Custom attribute writer method checking allowed values (enum).
|
95
|
+
# @param [Object] status Object to be assigned
|
96
|
+
def status=(status)
|
97
|
+
validator = EnumAttributeValidator.new('String', ["PENDING", "VERIFIED"])
|
98
|
+
unless validator.valid?(status)
|
99
|
+
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
100
|
+
end
|
101
|
+
@status = status
|
102
|
+
end
|
103
|
+
|
104
|
+
# Checks equality by comparing each attribute.
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def ==(o)
|
107
|
+
return true if self.equal?(o)
|
108
|
+
self.class == o.class &&
|
109
|
+
errors == o.errors &&
|
110
|
+
status == o.status
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(o)
|
116
|
+
self == o
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Fixnum] Hash code
|
121
|
+
def hash
|
122
|
+
[errors, status].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def build_from_hash(attributes)
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
130
|
+
self.class.swagger_types.each_pair do |key, type|
|
131
|
+
if type =~ /\AArray<(.*)>/i
|
132
|
+
# check to ensure the input is an array given that the the attribute
|
133
|
+
# is documented as an array but the input is not
|
134
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
135
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
136
|
+
end
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
138
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
139
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
140
|
+
end
|
141
|
+
|
142
|
+
self
|
143
|
+
end
|
144
|
+
|
145
|
+
# Deserializes the data based on type
|
146
|
+
# @param string type Data type
|
147
|
+
# @param string value Value to be deserialized
|
148
|
+
# @return [Object] Deserialized data
|
149
|
+
def _deserialize(type, value)
|
150
|
+
case type.to_sym
|
151
|
+
when :DateTime
|
152
|
+
DateTime.parse(value)
|
153
|
+
when :Date
|
154
|
+
Date.parse(value)
|
155
|
+
when :String
|
156
|
+
value.to_s
|
157
|
+
when :Integer
|
158
|
+
value.to_i
|
159
|
+
when :Float
|
160
|
+
value.to_f
|
161
|
+
when :BOOLEAN
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
+
true
|
164
|
+
else
|
165
|
+
false
|
166
|
+
end
|
167
|
+
when :Object
|
168
|
+
# generic object (usually a Hash), return directly
|
169
|
+
value
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each do |k, v|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else # model
|
182
|
+
temp_model = SquareConnect.const_get(type).new
|
183
|
+
temp_model.build_from_hash(value)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the string representation of the object
|
188
|
+
# @return [String] String presentation of the object
|
189
|
+
def to_s
|
190
|
+
to_hash.to_s
|
191
|
+
end
|
192
|
+
|
193
|
+
# to_body is an alias to to_hash (backward compatibility)
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_body
|
196
|
+
to_hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Returns the object in the form of hash
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_hash
|
202
|
+
hash = {}
|
203
|
+
self.class.attribute_map.each_pair do |attr, param|
|
204
|
+
value = self.send(attr)
|
205
|
+
next if value.nil?
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map{ |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
Contact: developers@squareup.com
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
class RegisterDomainResponseStatus
|
14
|
+
|
15
|
+
PENDING = "PENDING".freeze
|
16
|
+
VERIFIED = "VERIFIED".freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: square_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0.170
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Square, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- README.md
|
205
205
|
- Rakefile
|
206
206
|
- docs/Address.md
|
207
|
+
- docs/ApplePayApi.md
|
207
208
|
- docs/BatchDeleteCatalogObjectsRequest.md
|
208
209
|
- docs/BatchDeleteCatalogObjectsResponse.md
|
209
210
|
- docs/BatchRetrieveCatalogObjectsRequest.md
|
@@ -295,6 +296,7 @@ files:
|
|
295
296
|
- docs/Location.md
|
296
297
|
- docs/LocationCapability.md
|
297
298
|
- docs/LocationStatus.md
|
299
|
+
- docs/LocationType.md
|
298
300
|
- docs/LocationsApi.md
|
299
301
|
- docs/Money.md
|
300
302
|
- docs/Order.md
|
@@ -308,6 +310,9 @@ files:
|
|
308
310
|
- docs/OrdersApi.md
|
309
311
|
- docs/Refund.md
|
310
312
|
- docs/RefundStatus.md
|
313
|
+
- docs/RegisterDomainRequest.md
|
314
|
+
- docs/RegisterDomainResponse.md
|
315
|
+
- docs/RegisterDomainResponseStatus.md
|
311
316
|
- docs/RetrieveCatalogObjectRequest.md
|
312
317
|
- docs/RetrieveCatalogObjectResponse.md
|
313
318
|
- docs/RetrieveCustomerRequest.md
|
@@ -381,6 +386,7 @@ files:
|
|
381
386
|
- docs/VoidTransactionRequest.md
|
382
387
|
- docs/VoidTransactionResponse.md
|
383
388
|
- lib/square_connect.rb
|
389
|
+
- lib/square_connect/api/apple_pay_api.rb
|
384
390
|
- lib/square_connect/api/catalog_api.rb
|
385
391
|
- lib/square_connect/api/checkout_api.rb
|
386
392
|
- lib/square_connect/api/customers_api.rb
|
@@ -483,6 +489,7 @@ files:
|
|
483
489
|
- lib/square_connect/models/location.rb
|
484
490
|
- lib/square_connect/models/location_capability.rb
|
485
491
|
- lib/square_connect/models/location_status.rb
|
492
|
+
- lib/square_connect/models/location_type.rb
|
486
493
|
- lib/square_connect/models/money.rb
|
487
494
|
- lib/square_connect/models/order.rb
|
488
495
|
- lib/square_connect/models/order_line_item.rb
|
@@ -494,6 +501,9 @@ files:
|
|
494
501
|
- lib/square_connect/models/order_line_item_tax_type.rb
|
495
502
|
- lib/square_connect/models/refund.rb
|
496
503
|
- lib/square_connect/models/refund_status.rb
|
504
|
+
- lib/square_connect/models/register_domain_request.rb
|
505
|
+
- lib/square_connect/models/register_domain_response.rb
|
506
|
+
- lib/square_connect/models/register_domain_response_status.rb
|
497
507
|
- lib/square_connect/models/retrieve_catalog_object_request.rb
|
498
508
|
- lib/square_connect/models/retrieve_catalog_object_response.rb
|
499
509
|
- lib/square_connect/models/retrieve_customer_request.rb
|