iron_functions 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +109 -0
  4. data/VERSION +1 -0
  5. data/docs/App.md +8 -0
  6. data/docs/AppWrapper.md +8 -0
  7. data/docs/AppsApi.md +197 -0
  8. data/docs/AppsWrapper.md +8 -0
  9. data/docs/Error.md +8 -0
  10. data/docs/ErrorBody.md +9 -0
  11. data/docs/NewTasksWrapper.md +8 -0
  12. data/docs/Route.md +11 -0
  13. data/docs/RouteWrapper.md +8 -0
  14. data/docs/RoutesApi.md +208 -0
  15. data/docs/RoutesWrapper.md +10 -0
  16. data/docs/Task.md +16 -0
  17. data/docs/TaskWrapper.md +8 -0
  18. data/docs/TasksApi.md +57 -0
  19. data/docs/TasksWrapper.md +10 -0
  20. data/git_push.sh +67 -0
  21. data/iron_functions.gemspec +55 -0
  22. data/lib/iron_functions/api/apps_api.rb +262 -0
  23. data/lib/iron_functions/api/routes_api.rb +273 -0
  24. data/lib/iron_functions/api/tasks_api.rb +90 -0
  25. data/lib/iron_functions/api_client.rb +378 -0
  26. data/lib/iron_functions/api_error.rb +47 -0
  27. data/lib/iron_functions/configuration.rb +207 -0
  28. data/lib/iron_functions/models/app.rb +200 -0
  29. data/lib/iron_functions/models/app_wrapper.rb +200 -0
  30. data/lib/iron_functions/models/apps_wrapper.rb +202 -0
  31. data/lib/iron_functions/models/error.rb +199 -0
  32. data/lib/iron_functions/models/error_body.rb +208 -0
  33. data/lib/iron_functions/models/new_tasks_wrapper.rb +202 -0
  34. data/lib/iron_functions/models/route.rb +230 -0
  35. data/lib/iron_functions/models/route_wrapper.rb +200 -0
  36. data/lib/iron_functions/models/routes_wrapper.rb +221 -0
  37. data/lib/iron_functions/models/task.rb +315 -0
  38. data/lib/iron_functions/models/task_wrapper.rb +200 -0
  39. data/lib/iron_functions/models/tasks_wrapper.rb +221 -0
  40. data/lib/iron_functions/version.rb +26 -0
  41. data/lib/iron_functions.rb +65 -0
  42. data/spec/api/apps_api_spec.rb +94 -0
  43. data/spec/api/routes_api_spec.rb +97 -0
  44. data/spec/api/tasks_api_spec.rb +58 -0
  45. data/spec/api_client_spec.rb +237 -0
  46. data/spec/configuration_spec.rb +53 -0
  47. data/spec/models/app_spec.rb +53 -0
  48. data/spec/models/app_wrapper_spec.rb +53 -0
  49. data/spec/models/apps_wrapper_spec.rb +53 -0
  50. data/spec/models/error_body_spec.rb +59 -0
  51. data/spec/models/error_spec.rb +53 -0
  52. data/spec/models/new_tasks_wrapper_spec.rb +53 -0
  53. data/spec/models/route_spec.rb +71 -0
  54. data/spec/models/route_wrapper_spec.rb +53 -0
  55. data/spec/models/routes_wrapper_spec.rb +65 -0
  56. data/spec/models/task_spec.rb +105 -0
  57. data/spec/models/task_wrapper_spec.rb +53 -0
  58. data/spec/models/tasks_wrapper_spec.rb +65 -0
  59. data/spec/spec_helper.rb +122 -0
  60. metadata +300 -0
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #IronFunctions
3
+
4
+ #null
5
+
6
+ OpenAPI spec version: 0.0.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module IronFunctions
27
+
28
+ class TasksWrapper
29
+ attr_accessor :tasks
30
+
31
+ # Used to paginate results. If this is returned, pass it into the same query again to get more results.
32
+ attr_accessor :cursor
33
+
34
+ attr_accessor :error
35
+
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'tasks' => :'tasks',
41
+ :'cursor' => :'cursor',
42
+ :'error' => :'error'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'tasks' => :'Array<Task>',
50
+ :'cursor' => :'String',
51
+ :'error' => :'ErrorBody'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'tasks')
64
+ if (value = attributes[:'tasks']).is_a?(Array)
65
+ self.tasks = value
66
+ end
67
+ end
68
+
69
+ if attributes.has_key?(:'cursor')
70
+ self.cursor = attributes[:'cursor']
71
+ end
72
+
73
+ if attributes.has_key?(:'error')
74
+ self.error = attributes[:'error']
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
+ return false if @tasks.nil?
90
+ return true
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
+ tasks == o.tasks &&
99
+ cursor == o.cursor &&
100
+ error == o.error
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Fixnum] Hash code
111
+ def hash
112
+ [tasks, cursor, error].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.swagger_types.each_pair do |key, type|
121
+ if type =~ /^Array<(.*)>/i
122
+ # check to ensure the input is an array given that the the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ temp_model = IronFunctions.const_get(type).new
173
+ temp_model.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ next if value.nil?
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map{ |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,26 @@
1
+ =begin
2
+ #IronFunctions
3
+
4
+ #null
5
+
6
+ OpenAPI spec version: 0.0.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ module IronFunctions
25
+ VERSION = "0.0.5"
26
+ end
@@ -0,0 +1,65 @@
1
+ =begin
2
+ #IronFunctions
3
+
4
+ #null
5
+
6
+ OpenAPI spec version: 0.0.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ # Common files
25
+ require 'iron_functions/api_client'
26
+ require 'iron_functions/api_error'
27
+ require 'iron_functions/version'
28
+ require 'iron_functions/configuration'
29
+
30
+ # Models
31
+ require 'iron_functions/models/app'
32
+ require 'iron_functions/models/app_wrapper'
33
+ require 'iron_functions/models/apps_wrapper'
34
+ require 'iron_functions/models/error'
35
+ require 'iron_functions/models/error_body'
36
+ require 'iron_functions/models/new_tasks_wrapper'
37
+ require 'iron_functions/models/route'
38
+ require 'iron_functions/models/route_wrapper'
39
+ require 'iron_functions/models/routes_wrapper'
40
+ require 'iron_functions/models/task'
41
+ require 'iron_functions/models/task_wrapper'
42
+ require 'iron_functions/models/tasks_wrapper'
43
+
44
+ # APIs
45
+ require 'iron_functions/api/apps_api'
46
+ require 'iron_functions/api/routes_api'
47
+ require 'iron_functions/api/tasks_api'
48
+
49
+ module IronFunctions
50
+ class << self
51
+ # Customize default settings for the SDK using block.
52
+ # IronFunctions.configure do |config|
53
+ # config.username = "xxx"
54
+ # config.password = "xxx"
55
+ # end
56
+ # If no block given, return the default Configuration object.
57
+ def configure
58
+ if block_given?
59
+ yield(Configuration.default)
60
+ else
61
+ Configuration.default
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,94 @@
1
+ =begin
2
+ #IronFunctions
3
+
4
+ #null
5
+
6
+ OpenAPI spec version: 0.0.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'spec_helper'
25
+ require 'json'
26
+
27
+ # Unit tests for IronFunctions::AppsApi
28
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
29
+ # Please update as you see appropriate
30
+ describe 'AppsApi' do
31
+ before do
32
+ # run before each test
33
+ @instance = IronFunctions::AppsApi.new
34
+ end
35
+
36
+ after do
37
+ # run after each test
38
+ end
39
+
40
+ describe 'test an instance of AppsApi' do
41
+ it 'should create an instact of AppsApi' do
42
+ expect(@instance).to be_instance_of(IronFunctions::AppsApi)
43
+ end
44
+ end
45
+
46
+ # unit tests for apps_app_get
47
+ # Get information for a app.
48
+ # This gives more details about a app, such as statistics.
49
+ # @param app name of the app.
50
+ # @param [Hash] opts the optional parameters
51
+ # @return [AppWrapper]
52
+ describe 'apps_app_get test' do
53
+ it "should work" do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ # unit tests for apps_app_put
59
+ # Create/update a app.
60
+ # You can set app level settings here.
61
+ # @param app name of the app.
62
+ # @param body App to post.
63
+ # @param [Hash] opts the optional parameters
64
+ # @return [AppWrapper]
65
+ describe 'apps_app_put test' do
66
+ it "should work" do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ # unit tests for apps_get
72
+ # Get all app names.
73
+ # Get a list of all the apps in the system.
74
+ # @param [Hash] opts the optional parameters
75
+ # @return [AppsWrapper]
76
+ describe 'apps_get test' do
77
+ it "should work" do
78
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ # unit tests for apps_post
83
+ # Post new app
84
+ # Insert a new app
85
+ # @param body App to post.
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [AppWrapper]
88
+ describe 'apps_post test' do
89
+ it "should work" do
90
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
91
+ end
92
+ end
93
+
94
+ end
@@ -0,0 +1,97 @@
1
+ =begin
2
+ #IronFunctions
3
+
4
+ #null
5
+
6
+ OpenAPI spec version: 0.0.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'spec_helper'
25
+ require 'json'
26
+
27
+ # Unit tests for IronFunctions::RoutesApi
28
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
29
+ # Please update as you see appropriate
30
+ describe 'RoutesApi' do
31
+ before do
32
+ # run before each test
33
+ @instance = IronFunctions::RoutesApi.new
34
+ end
35
+
36
+ after do
37
+ # run after each test
38
+ end
39
+
40
+ describe 'test an instance of RoutesApi' do
41
+ it 'should create an instact of RoutesApi' do
42
+ expect(@instance).to be_instance_of(IronFunctions::RoutesApi)
43
+ end
44
+ end
45
+
46
+ # unit tests for apps_app_routes_get
47
+ # Get route list by app name.
48
+ # This will list routes for a particular app.
49
+ # @param app Name of app for this set of routes.
50
+ # @param [Hash] opts the optional parameters
51
+ # @return [RoutesWrapper]
52
+ describe 'apps_app_routes_get test' do
53
+ it "should work" do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ # unit tests for apps_app_routes_post
59
+ # Create new Route
60
+ # Create a new route
61
+ # @param app name of the app.
62
+ # @param body Array of routes to post.
63
+ # @param [Hash] opts the optional parameters
64
+ # @return [RoutesWrapper]
65
+ describe 'apps_app_routes_post test' do
66
+ it "should work" do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ # unit tests for apps_app_routes_route_delete
72
+ # Deletes the route
73
+ # Deletes the route.
74
+ # @param app Name of app for this set of routes.
75
+ # @param route Route name
76
+ # @param [Hash] opts the optional parameters
77
+ # @return [nil]
78
+ describe 'apps_app_routes_route_delete test' do
79
+ it "should work" do
80
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
81
+ end
82
+ end
83
+
84
+ # unit tests for apps_app_routes_route_get
85
+ # Gets route by name
86
+ # Gets a route by name.
87
+ # @param app Name of app for this set of routes.
88
+ # @param route Route name
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [RouteWrapper]
91
+ describe 'apps_app_routes_route_get test' do
92
+ it "should work" do
93
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
94
+ end
95
+ end
96
+
97
+ end
@@ -0,0 +1,58 @@
1
+ =begin
2
+ #IronFunctions
3
+
4
+ #null
5
+
6
+ OpenAPI spec version: 0.0.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'spec_helper'
25
+ require 'json'
26
+
27
+ # Unit tests for IronFunctions::TasksApi
28
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
29
+ # Please update as you see appropriate
30
+ describe 'TasksApi' do
31
+ before do
32
+ # run before each test
33
+ @instance = IronFunctions::TasksApi.new
34
+ end
35
+
36
+ after do
37
+ # run after each test
38
+ end
39
+
40
+ describe 'test an instance of TasksApi' do
41
+ it 'should create an instact of TasksApi' do
42
+ expect(@instance).to be_instance_of(IronFunctions::TasksApi)
43
+ end
44
+ end
45
+
46
+ # unit tests for tasks_get
47
+ # Get next task.
48
+ # Gets the next task in the queue, ready for processing. Titan may return &lt;&#x3D;n tasks. Consumers should start processing tasks in order. Each returned task is set to &#x60;status&#x60; \&quot;running\&quot; and &#x60;started_at&#x60; is set to the current time. No other consumer can retrieve this task.
49
+ # @param [Hash] opts the optional parameters
50
+ # @option opts [Integer] :n Number of tasks to return.
51
+ # @return [TasksWrapper]
52
+ describe 'tasks_get test' do
53
+ it "should work" do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ end