dwolla_swagger 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/dwolla_swagger.gemspec +32 -0
  3. data/lib/dwolla_swagger/api/accounts_api.rb +54 -0
  4. data/lib/dwolla_swagger/api/customers_api.rb +223 -0
  5. data/lib/dwolla_swagger/api/documents_api.rb +54 -0
  6. data/lib/dwolla_swagger/api/events_api.rb +98 -0
  7. data/lib/dwolla_swagger/api/fundingsources_api.rb +231 -0
  8. data/lib/dwolla_swagger/api/transfers_api.rb +143 -0
  9. data/lib/dwolla_swagger/api/webhooks_api.rb +190 -0
  10. data/lib/dwolla_swagger/api/webhooksubscriptions_api.rb +179 -0
  11. data/lib/dwolla_swagger/models/account_info.rb +62 -0
  12. data/lib/dwolla_swagger/models/amount.rb +44 -0
  13. data/lib/dwolla_swagger/models/application_event.rb +86 -0
  14. data/lib/dwolla_swagger/models/base_object.rb +84 -0
  15. data/lib/dwolla_swagger/models/create_customer.rb +132 -0
  16. data/lib/dwolla_swagger/models/create_funding_source_request.rb +60 -0
  17. data/lib/dwolla_swagger/models/create_webhook.rb +44 -0
  18. data/lib/dwolla_swagger/models/customer.rb +102 -0
  19. data/lib/dwolla_swagger/models/customer_list_response.rb +54 -0
  20. data/lib/dwolla_swagger/models/document.rb +78 -0
  21. data/lib/dwolla_swagger/models/document_list_response.rb +54 -0
  22. data/lib/dwolla_swagger/models/event_list_response.rb +54 -0
  23. data/lib/dwolla_swagger/models/funding_source.rb +96 -0
  24. data/lib/dwolla_swagger/models/funding_source_list_response.rb +46 -0
  25. data/lib/dwolla_swagger/models/hal_link.rb +44 -0
  26. data/lib/dwolla_swagger/models/money.rb +44 -0
  27. data/lib/dwolla_swagger/models/transfer.rb +86 -0
  28. data/lib/dwolla_swagger/models/transfer_list_response.rb +54 -0
  29. data/lib/dwolla_swagger/models/transfer_request_body.rb +54 -0
  30. data/lib/dwolla_swagger/models/unit__.rb +28 -0
  31. data/lib/dwolla_swagger/models/webhook.rb +96 -0
  32. data/lib/dwolla_swagger/models/webhook_attempt.rb +52 -0
  33. data/lib/dwolla_swagger/models/webhook_event_list_response.rb +54 -0
  34. data/lib/dwolla_swagger/models/webhook_header.rb +44 -0
  35. data/lib/dwolla_swagger/models/webhook_http_request.rb +62 -0
  36. data/lib/dwolla_swagger/models/webhook_http_response.rb +62 -0
  37. data/lib/dwolla_swagger/models/webhook_list_response.rb +54 -0
  38. data/lib/dwolla_swagger/models/webhook_retry.rb +70 -0
  39. data/lib/dwolla_swagger/models/webhook_retry_request_list_response.rb +54 -0
  40. data/lib/dwolla_swagger/models/webhook_subscription.rb +70 -0
  41. data/lib/dwolla_swagger/monkey.rb +90 -0
  42. data/lib/dwolla_swagger/swagger/configuration.rb +29 -0
  43. data/lib/dwolla_swagger/swagger/request.rb +264 -0
  44. data/lib/dwolla_swagger/swagger/response.rb +70 -0
  45. data/lib/dwolla_swagger/swagger/version.rb +5 -0
  46. data/lib/dwolla_swagger/swagger.rb +78 -0
  47. data/lib/dwolla_swagger.rb +54 -0
  48. metadata +294 -0
@@ -0,0 +1,179 @@
1
+ require "uri"
2
+
3
+ module DwollaSwagger
4
+ class WebhooksubscriptionsApi
5
+ basePath = "https://localhost/"
6
+ # apiInvoker = APIInvoker
7
+ @auth_names = ['oauth2']
8
+
9
+
10
+ # Get the list of webhooks.
11
+ #
12
+ # @param [Hash] opts the optional parameters
13
+ # @return [WebhookListResponse]
14
+ def self.list(opts = {})
15
+
16
+
17
+ # resource path
18
+ path = "/webhook-subscriptions".sub('{format}','json')
19
+
20
+ # query parameters
21
+ query_params = {}
22
+
23
+ # header parameters
24
+ header_params = {}
25
+
26
+ # HTTP header 'Accept' (if needed)
27
+ _header_accept = ['application/vnd.dwolla.v1.hal+json']
28
+ _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
29
+
30
+ # HTTP header 'Content-Type'
31
+ _header_content_type = []
32
+ header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
33
+
34
+ # form parameters
35
+ form_params = {}
36
+
37
+ # http body (model)
38
+ post_body = nil
39
+
40
+
41
+ if :GET == :POST
42
+ response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.headers
43
+ response['Location']
44
+ else
45
+ response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.body
46
+ obj = WebhookListResponse.new() and obj.build_from_hash(response)
47
+ end
48
+ end
49
+
50
+ # Create a new webhook subscription.
51
+ #
52
+ # @param [Hash] opts the optional parameters
53
+ # @option opts [CreateWebhook] :body Webhook subscription to create.
54
+ # @return [WebhookSubscription]
55
+ def self.create(opts = {})
56
+
57
+
58
+ # resource path
59
+ path = "/webhook-subscriptions".sub('{format}','json')
60
+
61
+ # query parameters
62
+ query_params = {}
63
+
64
+ # header parameters
65
+ header_params = {}
66
+
67
+ # HTTP header 'Accept' (if needed)
68
+ _header_accept = ['application/vnd.dwolla.v1.hal+json']
69
+ _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
70
+
71
+ # HTTP header 'Content-Type'
72
+ _header_content_type = ['application/vnd.dwolla.v1.hal+json']
73
+ header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
74
+
75
+ # form parameters
76
+ form_params = {}
77
+
78
+ # http body (model)
79
+ post_body = Swagger::Request.object_to_http_body(opts[:'body'])
80
+
81
+
82
+ if :POST == :POST
83
+ response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.headers
84
+ response['Location']
85
+ else
86
+ response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.body
87
+ obj = WebhookSubscription.new() and obj.build_from_hash(response)
88
+ end
89
+ end
90
+
91
+ # Get a webhook subscription by id.
92
+ #
93
+ # @param id ID of webhook subscription to get.
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [WebhookSubscription]
96
+ def self.id(id, opts = {})
97
+
98
+ # verify the required parameter 'id' is set
99
+ raise "Missing the required parameter 'id' when calling id" if id.nil?
100
+
101
+
102
+ # resource path
103
+ path = "/webhook-subscriptions/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
104
+
105
+ # query parameters
106
+ query_params = {}
107
+
108
+ # header parameters
109
+ header_params = {}
110
+
111
+ # HTTP header 'Accept' (if needed)
112
+ _header_accept = ['application/vnd.dwolla.v1.hal+json']
113
+ _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
114
+
115
+ # HTTP header 'Content-Type'
116
+ _header_content_type = []
117
+ header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
118
+
119
+ # form parameters
120
+ form_params = {}
121
+
122
+ # http body (model)
123
+ post_body = nil
124
+
125
+
126
+ if :GET == :POST
127
+ response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.headers
128
+ response['Location']
129
+ else
130
+ response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.body
131
+ obj = WebhookSubscription.new() and obj.build_from_hash(response)
132
+ end
133
+ end
134
+
135
+ # Delete a webhook subscription by id.
136
+ #
137
+ # @param id ID of webhook subscription to delete.
138
+ # @param [Hash] opts the optional parameters
139
+ # @return [WebhookSubscription]
140
+ def self.delete_by_id(id, opts = {})
141
+
142
+ # verify the required parameter 'id' is set
143
+ raise "Missing the required parameter 'id' when calling delete_by_id" if id.nil?
144
+
145
+
146
+ # resource path
147
+ path = "/webhook-subscriptions/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
148
+
149
+ # query parameters
150
+ query_params = {}
151
+
152
+ # header parameters
153
+ header_params = {}
154
+
155
+ # HTTP header 'Accept' (if needed)
156
+ _header_accept = ['application/vnd.dwolla.v1.hal+json']
157
+ _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
158
+
159
+ # HTTP header 'Content-Type'
160
+ _header_content_type = []
161
+ header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
162
+
163
+ # form parameters
164
+ form_params = {}
165
+
166
+ # http body (model)
167
+ post_body = nil
168
+
169
+
170
+ if :DELETE == :POST
171
+ response = Swagger::Request.new(:DELETE, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.headers
172
+ response['Location']
173
+ else
174
+ response = Swagger::Request.new(:DELETE, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make.body
175
+ obj = WebhookSubscription.new() and obj.build_from_hash(response)
176
+ end
177
+ end
178
+ end
179
+ end
@@ -0,0 +1,62 @@
1
+ module DwollaSwagger
2
+ #
3
+ class AccountInfo < BaseObject
4
+ attr_accessor :_links, :id, :name, :_embedded
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'_links' => :'_links',
11
+
12
+ #
13
+ :'id' => :'id',
14
+
15
+ #
16
+ :'name' => :'name',
17
+
18
+ #
19
+ :'_embedded' => :'_embedded'
20
+
21
+ }
22
+ end
23
+
24
+ # attribute type
25
+ def self.swagger_types
26
+ {
27
+ :'_links' => :'map[string,HalLink]',
28
+ :'id' => :'string',
29
+ :'name' => :'string',
30
+ :'_embedded' => :'object'
31
+
32
+ }
33
+ end
34
+
35
+ def initialize(attributes = {})
36
+ return if !attributes.is_a?(Hash) || attributes.empty?
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
40
+
41
+
42
+ if attributes[:'_links']
43
+ if (value = attributes[:'_links']).is_a?(Array)
44
+ @_links = value
45
+ end
46
+ end
47
+
48
+ if attributes[:'id']
49
+ @id = attributes[:'id']
50
+ end
51
+
52
+ if attributes[:'name']
53
+ @name = attributes[:'name']
54
+ end
55
+
56
+ if attributes[:'_embedded']
57
+ @_embedded = attributes[:'_embedded']
58
+ end
59
+
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,44 @@
1
+ module DwollaSwagger
2
+ #
3
+ class Amount < BaseObject
4
+ attr_accessor :value, :currency
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'value' => :'value',
11
+
12
+ #
13
+ :'currency' => :'currency'
14
+
15
+ }
16
+ end
17
+
18
+ # attribute type
19
+ def self.swagger_types
20
+ {
21
+ :'value' => :'string',
22
+ :'currency' => :'string'
23
+
24
+ }
25
+ end
26
+
27
+ def initialize(attributes = {})
28
+ return if !attributes.is_a?(Hash) || attributes.empty?
29
+
30
+ # convert string to symbol for hash key
31
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
32
+
33
+
34
+ if attributes[:'value']
35
+ @value = attributes[:'value']
36
+ end
37
+
38
+ if attributes[:'currency']
39
+ @currency = attributes[:'currency']
40
+ end
41
+
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,86 @@
1
+ module DwollaSwagger
2
+ #
3
+ class ApplicationEvent < BaseObject
4
+ attr_accessor :_links, :_embedded, :id, :created, :account_id, :topic, :resource_id
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ #
10
+ :'_links' => :'_links',
11
+
12
+ #
13
+ :'_embedded' => :'_embedded',
14
+
15
+ #
16
+ :'id' => :'id',
17
+
18
+ #
19
+ :'created' => :'created',
20
+
21
+ #
22
+ :'account_id' => :'accountId',
23
+
24
+ #
25
+ :'topic' => :'topic',
26
+
27
+ #
28
+ :'resource_id' => :'resourceId'
29
+
30
+ }
31
+ end
32
+
33
+ # attribute type
34
+ def self.swagger_types
35
+ {
36
+ :'_links' => :'map[string,HalLink]',
37
+ :'_embedded' => :'object',
38
+ :'id' => :'string',
39
+ :'created' => :'DateTime',
40
+ :'account_id' => :'string',
41
+ :'topic' => :'string',
42
+ :'resource_id' => :'string'
43
+
44
+ }
45
+ end
46
+
47
+ def initialize(attributes = {})
48
+ return if !attributes.is_a?(Hash) || attributes.empty?
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
52
+
53
+
54
+ if attributes[:'_links']
55
+ if (value = attributes[:'_links']).is_a?(Array)
56
+ @_links = value
57
+ end
58
+ end
59
+
60
+ if attributes[:'_embedded']
61
+ @_embedded = attributes[:'_embedded']
62
+ end
63
+
64
+ if attributes[:'id']
65
+ @id = attributes[:'id']
66
+ end
67
+
68
+ if attributes[:'created']
69
+ @created = attributes[:'created']
70
+ end
71
+
72
+ if attributes[:'accountId']
73
+ @account_id = attributes[:'accountId']
74
+ end
75
+
76
+ if attributes[:'topic']
77
+ @topic = attributes[:'topic']
78
+ end
79
+
80
+ if attributes[:'resourceId']
81
+ @resource_id = attributes[:'resourceId']
82
+ end
83
+
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,84 @@
1
+ module DwollaSwagger
2
+ # base class containing fundamental method such as to_hash, build_from_hash and more
3
+ class BaseObject
4
+
5
+ # return the object in the form of hash
6
+ def to_body
7
+ body = {}
8
+ self.class.attribute_map.each_pair do |key, value|
9
+ body[value] = self.send(key) unless self.send(key).nil?
10
+ end
11
+ body
12
+ end
13
+
14
+ # build the object from hash
15
+ def build_from_hash(attributes)
16
+ return nil unless attributes.is_a?(Hash)
17
+ self.class.swagger_types.each_pair do |key, type|
18
+ if type =~ /^array\[(.*)\]/i
19
+ # Deserialize array types to lowest denomination
20
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
21
+ elsif !attributes[self.class.attribute_map[key]].nil?
22
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
23
+ else
24
+ # data not found in attributes(hash), not an issue as the data can be optional
25
+ end
26
+ end
27
+
28
+ self
29
+ end
30
+
31
+ def _deserialize(type, value)
32
+ case type.to_sym
33
+ when :DateTime
34
+ DateTime.parse(value)
35
+ when :string
36
+ value.to_s
37
+ when :int
38
+ value.to_i
39
+ when :double
40
+ value.to_f
41
+ when :boolean
42
+ if value =~ /^(true|t|yes|y|1)$/i
43
+ true
44
+ else
45
+ false
46
+ end
47
+ when :object
48
+ value
49
+ when /^map\[(.*)\]/i
50
+ value
51
+ else # model
52
+ _model = DwollaSwagger.const_get(type).new
53
+ _model.build_from_hash(value)
54
+ end
55
+ end
56
+
57
+ # to_body is an alias to to_body (backward compatibility)
58
+ def to_hash
59
+ hash = {}
60
+ self.class.attribute_map.each_pair do |key, value|
61
+ if self.send(key).is_a?(Array)
62
+ next if self.send(key).empty?
63
+ hash[value] = self.send(key).select{|v| !v.nil?}.map{ |v| _to_hash v} unless self.send(key).nil?
64
+ else
65
+ unless (_tmp_value = _to_hash self.send(key)).nil?
66
+ hash[value] = _tmp_value
67
+ end
68
+ end
69
+ end
70
+ hash
71
+ end
72
+
73
+ # Method to output non-array value in the form of hash
74
+ # For object, use to_hash. Otherwise, just return the value
75
+ def _to_hash(value)
76
+ if value.respond_to? :to_hash
77
+ value.to_hash
78
+ else
79
+ value
80
+ end
81
+ end
82
+
83
+ end
84
+ end