transferzero-sdk 1.6.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +93 -0
  3. data/README.md +12 -4
  4. data/docs/Currency.md +0 -2
  5. data/docs/CurrencyExchange.md +0 -2
  6. data/docs/CurrencyOpposite.md +3 -3
  7. data/docs/Document.md +2 -0
  8. data/docs/PayoutMethod.md +1 -1
  9. data/docs/PayoutMethodCashProviderEnum.md +16 -0
  10. data/docs/PayoutMethodDetails.md +19 -5
  11. data/docs/PayoutMethodDetailsGBPBank.md +29 -0
  12. data/docs/PayoutMethodDetailsIBAN.md +1 -1
  13. data/docs/PayoutMethodDetailsMobile.md +3 -1
  14. data/docs/PayoutMethodDetailsXOFCash.md +27 -0
  15. data/docs/PayoutMethodDetailsZARBank.md +35 -0
  16. data/docs/ProofOfPayment.md +23 -0
  17. data/docs/ProofOfPaymentListResponse.md +17 -0
  18. data/docs/Recipient.md +3 -1
  19. data/docs/RecipientStateReasonDetails.md +23 -0
  20. data/docs/RecipientsApi.md +63 -1
  21. data/docs/Sender.md +20 -8
  22. data/lib/transferzero-sdk.rb +7 -0
  23. data/lib/transferzero-sdk/api/recipients_api.rb +56 -2
  24. data/lib/transferzero-sdk/api_client.rb +5 -3
  25. data/lib/transferzero-sdk/models/account.rb +70 -69
  26. data/lib/transferzero-sdk/models/account_list_response.rb +67 -66
  27. data/lib/transferzero-sdk/models/account_meta.rb +61 -60
  28. data/lib/transferzero-sdk/models/account_response.rb +66 -65
  29. data/lib/transferzero-sdk/models/account_validation_error.rb +61 -60
  30. data/lib/transferzero-sdk/models/account_validation_request.rb +164 -163
  31. data/lib/transferzero-sdk/models/account_validation_response.rb +66 -65
  32. data/lib/transferzero-sdk/models/account_validation_result.rb +61 -60
  33. data/lib/transferzero-sdk/models/api_log.rb +136 -135
  34. data/lib/transferzero-sdk/models/api_log_list_response.rb +70 -69
  35. data/lib/transferzero-sdk/models/api_log_response.rb +60 -59
  36. data/lib/transferzero-sdk/models/currency.rb +133 -142
  37. data/lib/transferzero-sdk/models/currency_exchange.rb +149 -158
  38. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +62 -61
  39. data/lib/transferzero-sdk/models/currency_list_response.rb +62 -61
  40. data/lib/transferzero-sdk/models/currency_opposite.rb +166 -165
  41. data/lib/transferzero-sdk/models/debit.rb +151 -150
  42. data/lib/transferzero-sdk/models/debit_list_request.rb +61 -60
  43. data/lib/transferzero-sdk/models/debit_list_response.rb +67 -66
  44. data/lib/transferzero-sdk/models/debit_request.rb +60 -59
  45. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +80 -79
  46. data/lib/transferzero-sdk/models/debit_response.rb +60 -59
  47. data/lib/transferzero-sdk/models/document.rb +180 -169
  48. data/lib/transferzero-sdk/models/document_list_response.rb +67 -66
  49. data/lib/transferzero-sdk/models/document_request.rb +60 -59
  50. data/lib/transferzero-sdk/models/document_response.rb +60 -59
  51. data/lib/transferzero-sdk/models/document_webhook.rb +96 -95
  52. data/lib/transferzero-sdk/models/error_status.rb +66 -65
  53. data/lib/transferzero-sdk/models/field_description.rb +95 -94
  54. data/lib/transferzero-sdk/models/field_select_validation.rb +70 -69
  55. data/lib/transferzero-sdk/models/field_validation.rb +78 -77
  56. data/lib/transferzero-sdk/models/pagination.rb +97 -96
  57. data/lib/transferzero-sdk/models/pagination_meta.rb +60 -59
  58. data/lib/transferzero-sdk/models/payin_method.rb +97 -96
  59. data/lib/transferzero-sdk/models/payin_method_details.rb +122 -121
  60. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +62 -61
  61. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +75 -74
  62. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +71 -70
  63. data/lib/transferzero-sdk/models/payin_method_request.rb +60 -59
  64. data/lib/transferzero-sdk/models/payment_method.rb +109 -108
  65. data/lib/transferzero-sdk/models/payment_method_list_response.rb +61 -60
  66. data/lib/transferzero-sdk/models/payment_method_opposite.rb +124 -123
  67. data/lib/transferzero-sdk/models/payout_method.rb +107 -106
  68. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +14 -19
  69. data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +31 -0
  70. data/lib/transferzero-sdk/models/payout_method_details.rb +402 -320
  71. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +61 -60
  72. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +97 -96
  73. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +267 -0
  74. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +97 -96
  75. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +100 -104
  76. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +162 -161
  77. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +93 -83
  78. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -103
  79. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +108 -107
  80. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +263 -0
  81. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
  82. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +324 -0
  83. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +14 -19
  84. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +15 -20
  85. data/lib/transferzero-sdk/models/payout_method_list_response.rb +67 -66
  86. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +17 -19
  87. data/lib/transferzero-sdk/models/payout_method_request.rb +60 -59
  88. data/lib/transferzero-sdk/models/payout_method_response.rb +60 -59
  89. data/lib/transferzero-sdk/models/payout_method_webhook.rb +96 -95
  90. data/lib/transferzero-sdk/models/politically_exposed_person.rb +123 -122
  91. data/lib/transferzero-sdk/models/proof_of_payment.rb +233 -0
  92. data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +204 -0
  93. data/lib/transferzero-sdk/models/recipient.rb +237 -227
  94. data/lib/transferzero-sdk/models/recipient_list_response.rb +67 -66
  95. data/lib/transferzero-sdk/models/recipient_request.rb +60 -59
  96. data/lib/transferzero-sdk/models/recipient_response.rb +60 -59
  97. data/lib/transferzero-sdk/models/recipient_state.rb +22 -27
  98. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +235 -0
  99. data/lib/transferzero-sdk/models/recipient_webhook.rb +96 -95
  100. data/lib/transferzero-sdk/models/sender.rb +565 -480
  101. data/lib/transferzero-sdk/models/sender_list_response.rb +67 -66
  102. data/lib/transferzero-sdk/models/sender_request.rb +60 -59
  103. data/lib/transferzero-sdk/models/sender_response.rb +66 -65
  104. data/lib/transferzero-sdk/models/sender_response_existing.rb +60 -59
  105. data/lib/transferzero-sdk/models/sender_response_meta.rb +60 -59
  106. data/lib/transferzero-sdk/models/sender_state.rb +19 -24
  107. data/lib/transferzero-sdk/models/sender_webhook.rb +96 -95
  108. data/lib/transferzero-sdk/models/transaction.rb +192 -191
  109. data/lib/transferzero-sdk/models/transaction_list_response.rb +67 -66
  110. data/lib/transferzero-sdk/models/transaction_request.rb +60 -59
  111. data/lib/transferzero-sdk/models/transaction_response.rb +66 -65
  112. data/lib/transferzero-sdk/models/transaction_response_existing.rb +66 -65
  113. data/lib/transferzero-sdk/models/transaction_response_meta.rb +60 -59
  114. data/lib/transferzero-sdk/models/transaction_state.rb +23 -28
  115. data/lib/transferzero-sdk/models/transaction_traits.rb +71 -70
  116. data/lib/transferzero-sdk/models/transaction_webhook.rb +96 -95
  117. data/lib/transferzero-sdk/models/validation_error_description.rb +62 -61
  118. data/lib/transferzero-sdk/models/webhook.rb +92 -91
  119. data/lib/transferzero-sdk/models/webhook_definition.rb +107 -106
  120. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +61 -60
  121. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +67 -66
  122. data/lib/transferzero-sdk/models/webhook_definition_request.rb +60 -59
  123. data/lib/transferzero-sdk/models/webhook_definition_response.rb +60 -59
  124. data/lib/transferzero-sdk/models/webhook_log.rb +97 -96
  125. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +70 -69
  126. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +129 -128
  127. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +80 -79
  128. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +81 -80
  129. data/lib/transferzero-sdk/models/webhook_log_response.rb +60 -59
  130. data/lib/transferzero-sdk/version.rb +1 -1
  131. data/spec/models/payout_method_cash_provider_enum_spec.rb +35 -0
  132. data/spec/models/payout_method_details_gbp_bank_spec.rb +77 -0
  133. data/spec/models/payout_method_details_xof_cash_spec.rb +71 -0
  134. data/spec/models/payout_method_details_zar_bank_spec.rb +89 -0
  135. data/spec/models/proof_of_payment_list_response_spec.rb +41 -0
  136. data/spec/models/proof_of_payment_spec.rb +59 -0
  137. data/spec/models/recipient_state_reason_details_spec.rb +59 -0
  138. metadata +32 -3
@@ -13,77 +13,77 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- # The description of the error
17
- class ValidationErrorDescription
18
- # Describes what the problem is with the field
19
- attr_accessor :error
20
-
21
- # Attribute mapping from ruby-style variable name to JSON key.
22
- def self.attribute_map
23
- {
24
- :'error' => :'error'
25
- }
26
- end
16
+ # The description of the error
17
+ class ValidationErrorDescription
18
+ # Describes what the problem is with the field
19
+ attr_accessor :error
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'error' => :'error'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'error' => :'String'
32
+ }
33
+ end
27
34
 
28
- # Attribute type mapping.
29
- def self.openapi_types
30
- {
31
- :'error' => :'String'
32
- }
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ if (!attributes.is_a?(Hash))
39
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ValidationErrorDescription` initialize method"
33
40
  end
34
41
 
35
- # Initializes the object
36
- # @param [Hash] attributes Model attributes in the form of hash
37
- def initialize(attributes = {})
38
- if (!attributes.is_a?(Hash))
39
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ValidationErrorDescription` initialize method"
42
+ # check to see if the attribute exists and convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h|
44
+ if (!self.class.attribute_map.key?(k.to_sym))
45
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ValidationErrorDescription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
40
46
  end
47
+ h[k.to_sym] = v
48
+ }
41
49
 
42
- # check to see if the attribute exists and convert string to symbol for hash key
43
- attributes = attributes.each_with_object({}) { |(k, v), h|
44
- if (!self.class.attribute_map.key?(k.to_sym))
45
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ValidationErrorDescription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
46
- end
47
- h[k.to_sym] = v
48
- }
49
-
50
- if attributes.key?(:'error')
51
- self.error = attributes[:'error']
52
- end
50
+ if attributes.key?(:'error')
51
+ self.error = attributes[:'error']
53
52
  end
53
+ end
54
54
 
55
- # Show invalid properties with the reasons. Usually used together with valid?
56
- # @return Array for valid properties with the reasons
57
- def list_invalid_properties
58
- invalid_properties = Array.new
59
- invalid_properties
60
- end
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
61
 
62
- # Check to see if the all the properties in the model are valid
63
- # @return true if the model is valid
64
- def valid?
65
- true
66
- end
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
67
 
68
- # Checks equality by comparing each attribute.
69
- # @param [Object] Object to be compared
70
- def ==(o)
71
- return true if self.equal?(o)
72
- self.class == o.class &&
73
- error == o.error
74
- end
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ error == o.error
74
+ end
75
75
 
76
- # @see the `==` method
77
- # @param [Object] Object to be compared
78
- def eql?(o)
79
- self == o
80
- end
76
+ # @see the `==` method
77
+ # @param [Object] Object to be compared
78
+ def eql?(o)
79
+ self == o
80
+ end
81
81
 
82
- # Calculates hash code according to all attributes.
83
- # @return [Integer] Hash code
84
- def hash
85
- [error].hash
86
- end
82
+ # Calculates hash code according to all attributes.
83
+ # @return [Integer] Hash code
84
+ def hash
85
+ [error].hash
86
+ end
87
87
 
88
88
  require 'active_support/core_ext/hash'
89
89
  require 'active_support/hash_with_indifferent_access.rb'
@@ -199,5 +199,6 @@ def _to_hash(value)
199
199
  end
200
200
  end
201
201
 
202
- end
202
+ end
203
+
203
204
  end
@@ -13,113 +13,113 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- # Whenever objects in the TransferZero API change state, we can optionally send the changed details to a pre-registered webhook address. Webhooks can be created either using the [developer portal](https://developers.transferzero.com), or using the [TransferZero API](#operations-tag-Webhooks). Whenever possible we prefer using webhooks to listen on events (for example when a transaction has been paid out) instead of polling the status, and we expect implementations fully utilising webhooks. Webhooks will always generate a `POST` request to the specified endpoint, and will also include the same authentication headers as described in the [authentication documentation](https://docs.transferzero.com/docs/authentication), so their validity can be verified on the receiver end.
17
- class Webhook
18
- # The ID of the webhook that was used to send out this callback
19
- attr_accessor :webhook
20
-
21
- # The event that triggered this webhook
22
- attr_accessor :event
23
-
24
- # The returned object
25
- attr_accessor :object
26
-
27
- # Attribute mapping from ruby-style variable name to JSON key.
28
- def self.attribute_map
29
- {
30
- :'webhook' => :'webhook',
31
- :'event' => :'event',
32
- :'object' => :'object'
33
- }
34
- end
35
-
36
- # Attribute type mapping.
37
- def self.openapi_types
38
- {
39
- :'webhook' => :'String',
40
- :'event' => :'String',
41
- :'object' => :'Object'
42
- }
43
- end
44
-
45
- # Initializes the object
46
- # @param [Hash] attributes Model attributes in the form of hash
47
- def initialize(attributes = {})
48
- if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Webhook` initialize method"
50
- end
51
-
52
- # check to see if the attribute exists and convert string to symbol for hash key
53
- attributes = attributes.each_with_object({}) { |(k, v), h|
54
- if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Webhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
- end
57
- h[k.to_sym] = v
58
- }
59
-
60
- if attributes.key?(:'webhook')
61
- self.webhook = attributes[:'webhook']
62
- end
16
+ # Whenever objects in the TransferZero API change state, we can optionally send the changed details to a pre-registered webhook address. Webhooks can be created either using the [developer portal](https://developers.transferzero.com), or using the [TransferZero API](#operations-tag-Webhooks). Whenever possible we prefer using webhooks to listen on events (for example when a transaction has been paid out) instead of polling the status, and we expect implementations fully utilising webhooks. Webhooks will always generate a `POST` request to the specified endpoint, and will also include the same authentication headers as described in the [authentication documentation](https://docs.transferzero.com/docs/authentication), so their validity can be verified on the receiver end.
17
+ class Webhook
18
+ # The ID of the webhook that was used to send out this callback
19
+ attr_accessor :webhook
20
+
21
+ # The event that triggered this webhook
22
+ attr_accessor :event
23
+
24
+ # The returned object
25
+ attr_accessor :object
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'webhook' => :'webhook',
31
+ :'event' => :'event',
32
+ :'object' => :'object'
33
+ }
34
+ end
63
35
 
64
- if attributes.key?(:'event')
65
- self.event = attributes[:'event']
66
- end
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'webhook' => :'String',
40
+ :'event' => :'String',
41
+ :'object' => :'Object'
42
+ }
43
+ end
67
44
 
68
- if attributes.key?(:'object')
69
- self.object = attributes[:'object']
70
- end
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Webhook` initialize method"
71
50
  end
72
51
 
73
- # Show invalid properties with the reasons. Usually used together with valid?
74
- # @return Array for valid properties with the reasons
75
- def list_invalid_properties
76
- invalid_properties = Array.new
77
- if @webhook.nil?
78
- invalid_properties.push('invalid value for "webhook", webhook cannot be nil.')
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Webhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
56
  end
57
+ h[k.to_sym] = v
58
+ }
80
59
 
81
- if @event.nil?
82
- invalid_properties.push('invalid value for "event", event cannot be nil.')
83
- end
84
-
85
- if @object.nil?
86
- invalid_properties.push('invalid value for "object", object cannot be nil.')
87
- end
60
+ if attributes.key?(:'webhook')
61
+ self.webhook = attributes[:'webhook']
62
+ end
88
63
 
89
- invalid_properties
64
+ if attributes.key?(:'event')
65
+ self.event = attributes[:'event']
90
66
  end
91
67
 
92
- # Check to see if the all the properties in the model are valid
93
- # @return true if the model is valid
94
- def valid?
95
- return false if @webhook.nil?
96
- return false if @event.nil?
97
- return false if @object.nil?
98
- true
68
+ if attributes.key?(:'object')
69
+ self.object = attributes[:'object']
99
70
  end
71
+ end
100
72
 
101
- # Checks equality by comparing each attribute.
102
- # @param [Object] Object to be compared
103
- def ==(o)
104
- return true if self.equal?(o)
105
- self.class == o.class &&
106
- webhook == o.webhook &&
107
- event == o.event &&
108
- object == o.object
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @webhook.nil?
78
+ invalid_properties.push('invalid value for "webhook", webhook cannot be nil.')
109
79
  end
110
80
 
111
- # @see the `==` method
112
- # @param [Object] Object to be compared
113
- def eql?(o)
114
- self == o
81
+ if @event.nil?
82
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
115
83
  end
116
84
 
117
- # Calculates hash code according to all attributes.
118
- # @return [Integer] Hash code
119
- def hash
120
- [webhook, event, object].hash
85
+ if @object.nil?
86
+ invalid_properties.push('invalid value for "object", object cannot be nil.')
121
87
  end
122
88
 
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ return false if @webhook.nil?
96
+ return false if @event.nil?
97
+ return false if @object.nil?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ webhook == o.webhook &&
107
+ event == o.event &&
108
+ object == o.object
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [webhook, event, object].hash
121
+ end
122
+
123
123
  require 'active_support/core_ext/hash'
124
124
  require 'active_support/hash_with_indifferent_access.rb'
125
125
  # Builds the object from hash
@@ -234,5 +234,6 @@ def _to_hash(value)
234
234
  end
235
235
  end
236
236
 
237
- end
237
+ end
238
+
238
239
  end
@@ -13,130 +13,130 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- # Object that holds where to send webhooks, and what events should it be triggered with
17
- class WebhookDefinition
18
- # The URL to receive the webhook
19
- attr_accessor :url
20
-
21
- # A list of events to subscribe to
22
- attr_accessor :events
23
-
24
- attr_accessor :metadata
25
-
26
- # The ID of the webhook
27
- attr_accessor :id
28
-
29
- # The fields that have some problems and don't pass validation
30
- attr_accessor :errors
31
-
32
- # Attribute mapping from ruby-style variable name to JSON key.
33
- def self.attribute_map
34
- {
35
- :'url' => :'url',
36
- :'events' => :'events',
37
- :'metadata' => :'metadata',
38
- :'id' => :'id',
39
- :'errors' => :'errors'
40
- }
41
- end
42
-
43
- # Attribute type mapping.
44
- def self.openapi_types
45
- {
46
- :'url' => :'String',
47
- :'events' => :'Array<String>',
48
- :'metadata' => :'Object',
49
- :'id' => :'String',
50
- :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
51
- }
52
- end
53
-
54
- # Initializes the object
55
- # @param [Hash] attributes Model attributes in the form of hash
56
- def initialize(attributes = {})
57
- if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::WebhookDefinition` initialize method"
59
- end
16
+ # Object that holds where to send webhooks, and what events should it be triggered with
17
+ class WebhookDefinition
18
+ # The URL to receive the webhook
19
+ attr_accessor :url
20
+
21
+ # A list of events to subscribe to
22
+ attr_accessor :events
23
+
24
+ attr_accessor :metadata
25
+
26
+ # The ID of the webhook
27
+ attr_accessor :id
28
+
29
+ # The fields that have some problems and don't pass validation
30
+ attr_accessor :errors
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'url' => :'url',
36
+ :'events' => :'events',
37
+ :'metadata' => :'metadata',
38
+ :'id' => :'id',
39
+ :'errors' => :'errors'
40
+ }
41
+ end
60
42
 
61
- # check to see if the attribute exists and convert string to symbol for hash key
62
- attributes = attributes.each_with_object({}) { |(k, v), h|
63
- if (!self.class.attribute_map.key?(k.to_sym))
64
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::WebhookDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
- end
66
- h[k.to_sym] = v
67
- }
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'url' => :'String',
47
+ :'events' => :'Array<String>',
48
+ :'metadata' => :'Object',
49
+ :'id' => :'String',
50
+ :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
51
+ }
52
+ end
68
53
 
69
- if attributes.key?(:'url')
70
- self.url = attributes[:'url']
71
- end
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::WebhookDefinition` initialize method"
59
+ end
72
60
 
73
- if attributes.key?(:'events')
74
- if (value = attributes[:'events']).is_a?(Array)
75
- self.events = value
76
- end
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::WebhookDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
65
  end
66
+ h[k.to_sym] = v
67
+ }
78
68
 
79
- if attributes.key?(:'metadata')
80
- self.metadata = attributes[:'metadata']
81
- end
69
+ if attributes.key?(:'url')
70
+ self.url = attributes[:'url']
71
+ end
82
72
 
83
- if attributes.key?(:'id')
84
- self.id = attributes[:'id']
73
+ if attributes.key?(:'events')
74
+ if (value = attributes[:'events']).is_a?(Array)
75
+ self.events = value
85
76
  end
77
+ end
86
78
 
87
- if attributes.key?(:'errors')
88
- if (value = attributes[:'errors']).is_a?(Hash)
89
- self.errors = value
90
- end
91
- end
79
+ if attributes.key?(:'metadata')
80
+ self.metadata = attributes[:'metadata']
92
81
  end
93
82
 
94
- # Show invalid properties with the reasons. Usually used together with valid?
95
- # @return Array for valid properties with the reasons
96
- def list_invalid_properties
97
- invalid_properties = Array.new
98
- if @url.nil?
99
- invalid_properties.push('invalid value for "url", url cannot be nil.')
100
- end
83
+ if attributes.key?(:'id')
84
+ self.id = attributes[:'id']
85
+ end
101
86
 
102
- if @events.nil?
103
- invalid_properties.push('invalid value for "events", events cannot be nil.')
87
+ if attributes.key?(:'errors')
88
+ if (value = attributes[:'errors']).is_a?(Hash)
89
+ self.errors = value
104
90
  end
105
-
106
- invalid_properties
107
91
  end
92
+ end
108
93
 
109
- # Check to see if the all the properties in the model are valid
110
- # @return true if the model is valid
111
- def valid?
112
- return false if @url.nil?
113
- return false if @events.nil?
114
- true
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ if @url.nil?
99
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
115
100
  end
116
101
 
117
- # Checks equality by comparing each attribute.
118
- # @param [Object] Object to be compared
119
- def ==(o)
120
- return true if self.equal?(o)
121
- self.class == o.class &&
122
- url == o.url &&
123
- events == o.events &&
124
- metadata == o.metadata &&
125
- id == o.id &&
126
- errors == o.errors
102
+ if @events.nil?
103
+ invalid_properties.push('invalid value for "events", events cannot be nil.')
127
104
  end
128
105
 
129
- # @see the `==` method
130
- # @param [Object] Object to be compared
131
- def eql?(o)
132
- self == o
133
- end
106
+ invalid_properties
107
+ end
134
108
 
135
- # Calculates hash code according to all attributes.
136
- # @return [Integer] Hash code
137
- def hash
138
- [url, events, metadata, id, errors].hash
139
- end
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return false if @url.nil?
113
+ return false if @events.nil?
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ url == o.url &&
123
+ events == o.events &&
124
+ metadata == o.metadata &&
125
+ id == o.id &&
126
+ errors == o.errors
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [url, events, metadata, id, errors].hash
139
+ end
140
140
 
141
141
  require 'active_support/core_ext/hash'
142
142
  require 'active_support/hash_with_indifferent_access.rb'
@@ -252,5 +252,6 @@ def _to_hash(value)
252
252
  end
253
253
  end
254
254
 
255
- end
255
+ end
256
+
256
257
  end