iron_functions 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +0 -0
  3. data/README.md +8 -9
  4. data/VERSION +1 -1
  5. data/docs/App.md +1 -0
  6. data/docs/AppWrapper.md +0 -0
  7. data/docs/AppsApi.md +0 -0
  8. data/docs/AppsWrapper.md +0 -0
  9. data/docs/Error.md +0 -0
  10. data/docs/ErrorBody.md +0 -0
  11. data/docs/NewTask.md +9 -0
  12. data/docs/NewTasksWrapper.md +0 -0
  13. data/docs/Route.md +3 -0
  14. data/docs/RouteWrapper.md +2 -0
  15. data/docs/RoutesApi.md +4 -4
  16. data/docs/RoutesWrapper.md +0 -1
  17. data/docs/Task.md +2 -0
  18. data/docs/TaskWrapper.md +0 -0
  19. data/docs/TasksApi.md +2 -2
  20. data/docs/TasksWrapper.md +0 -0
  21. data/git_push.sh +0 -0
  22. data/iron_functions.gemspec +3 -3
  23. data/lib/iron_functions.rb +3 -4
  24. data/lib/iron_functions/api/apps_api.rb +2 -2
  25. data/lib/iron_functions/api/routes_api.rb +7 -7
  26. data/lib/iron_functions/api/tasks_api.rb +5 -5
  27. data/lib/iron_functions/api_client.rb +2 -2
  28. data/lib/iron_functions/api_error.rb +2 -2
  29. data/lib/iron_functions/configuration.rb +2 -2
  30. data/lib/iron_functions/models/app.rb +18 -6
  31. data/lib/iron_functions/models/app_wrapper.rb +2 -2
  32. data/lib/iron_functions/models/apps_wrapper.rb +2 -2
  33. data/lib/iron_functions/models/error.rb +2 -2
  34. data/lib/iron_functions/models/error_body.rb +2 -2
  35. data/lib/iron_functions/models/new_task.rb +211 -0
  36. data/lib/iron_functions/models/new_tasks_wrapper.rb +1 -1
  37. data/lib/iron_functions/models/route.rb +71 -6
  38. data/lib/iron_functions/models/route_wrapper.rb +21 -3
  39. data/lib/iron_functions/models/routes_wrapper.rb +3 -13
  40. data/lib/iron_functions/models/task.rb +24 -3
  41. data/lib/iron_functions/models/task_wrapper.rb +2 -2
  42. data/lib/iron_functions/models/tasks_wrapper.rb +1 -1
  43. data/lib/iron_functions/version.rb +3 -3
  44. data/spec/api/apps_api_spec.rb +2 -2
  45. data/spec/api/routes_api_spec.rb +4 -4
  46. data/spec/api/tasks_api_spec.rb +3 -3
  47. data/spec/api_client_spec.rb +2 -2
  48. data/spec/configuration_spec.rb +2 -2
  49. data/spec/models/app_spec.rb +8 -2
  50. data/spec/models/app_wrapper_spec.rb +2 -2
  51. data/spec/models/apps_wrapper_spec.rb +2 -2
  52. data/spec/models/error_body_spec.rb +2 -2
  53. data/spec/models/error_spec.rb +2 -2
  54. data/spec/models/new_task_spec.rb +59 -0
  55. data/spec/models/new_tasks_wrapper_spec.rb +1 -1
  56. data/spec/models/route_spec.rb +24 -2
  57. data/spec/models/route_wrapper_spec.rb +14 -2
  58. data/spec/models/routes_wrapper_spec.rb +2 -8
  59. data/spec/models/task_spec.rb +14 -2
  60. data/spec/models/task_wrapper_spec.rb +2 -2
  61. data/spec/models/tasks_wrapper_spec.rb +1 -1
  62. data/spec/spec_helper.rb +2 -2
  63. metadata +11 -7
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #IronFunctions
3
3
 
4
- #null
4
+ #The open source serverless platform.
5
5
 
6
- OpenAPI spec version: 0.0.5
6
+ OpenAPI spec version: 0.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #IronFunctions
3
3
 
4
- #null
4
+ #The open source serverless platform.
5
5
 
6
- OpenAPI spec version: 0.0.5
6
+ OpenAPI spec version: 0.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #IronFunctions
3
3
 
4
- #null
4
+ #The open source serverless platform.
5
5
 
6
- OpenAPI spec version: 0.0.5
6
+ OpenAPI spec version: 0.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -0,0 +1,211 @@
1
+ =begin
2
+ #IronFunctions
3
+
4
+ #The open source serverless platform.
5
+
6
+ OpenAPI spec version: 0.1.0
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 NewTask
29
+ # Name of Docker image to use. This is optional and can be used to override the image defined at the group level.
30
+ attr_accessor :image
31
+
32
+ # Payload for the task. This is what you pass into each task to make it do something.
33
+ attr_accessor :payload
34
+
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'image' => :'image',
40
+ :'payload' => :'payload'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'image' => :'String',
48
+ :'payload' => :'String'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
59
+
60
+ if attributes.has_key?(:'image')
61
+ self.image = attributes[:'image']
62
+ end
63
+
64
+ if attributes.has_key?(:'payload')
65
+ self.payload = attributes[:'payload']
66
+ end
67
+
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properies with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ return invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @image.nil?
81
+ return true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ image == o.image &&
90
+ payload == o.payload
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [image, payload].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /^Array<(.*)>/i
112
+ # check to ensure the input is an array given that the the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = IronFunctions.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map{ |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #null
5
5
 
6
- OpenAPI spec version: 0.0.5
6
+ OpenAPI spec version: 0.0.4
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #IronFunctions
3
3
 
4
- #null
4
+ #The open source serverless platform.
5
5
 
6
- OpenAPI spec version: 0.0.5
6
+ OpenAPI spec version: 0.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -38,6 +38,36 @@ module IronFunctions
38
38
  # Map of http headers that will be sent with the response
39
39
  attr_accessor :headers
40
40
 
41
+ # Max usable memory for this route (MiB).
42
+ attr_accessor :memory
43
+
44
+ # Route type
45
+ attr_accessor :type
46
+
47
+ # Route configuration - overrides application configuration
48
+ attr_accessor :config
49
+
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
53
+
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
66
+
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
41
71
 
42
72
  # Attribute mapping from ruby-style variable name to JSON key.
43
73
  def self.attribute_map
@@ -45,7 +75,10 @@ module IronFunctions
45
75
  :'app_name' => :'app_name',
46
76
  :'path' => :'path',
47
77
  :'image' => :'image',
48
- :'headers' => :'headers'
78
+ :'headers' => :'headers',
79
+ :'memory' => :'memory',
80
+ :'type' => :'type',
81
+ :'config' => :'config'
49
82
  }
50
83
  end
51
84
 
@@ -55,7 +88,10 @@ module IronFunctions
55
88
  :'app_name' => :'String',
56
89
  :'path' => :'String',
57
90
  :'image' => :'String',
58
- :'headers' => :'String'
91
+ :'headers' => :'String',
92
+ :'memory' => :'Integer',
93
+ :'type' => :'String',
94
+ :'config' => :'Hash<String, String>'
59
95
  }
60
96
  end
61
97
 
@@ -83,6 +119,20 @@ module IronFunctions
83
119
  self.headers = attributes[:'headers']
84
120
  end
85
121
 
122
+ if attributes.has_key?(:'memory')
123
+ self.memory = attributes[:'memory']
124
+ end
125
+
126
+ if attributes.has_key?(:'type')
127
+ self.type = attributes[:'type']
128
+ end
129
+
130
+ if attributes.has_key?(:'config')
131
+ if (value = attributes[:'config']).is_a?(Array)
132
+ self.config = value
133
+ end
134
+ end
135
+
86
136
  end
87
137
 
88
138
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -95,9 +145,21 @@ module IronFunctions
95
145
  # Check to see if the all the properties in the model are valid
96
146
  # @return true if the model is valid
97
147
  def valid?
148
+ type_validator = EnumAttributeValidator.new('String', ["sync", "async"])
149
+ return false unless type_validator.valid?(@type)
98
150
  return true
99
151
  end
100
152
 
153
+ # Custom attribute writer method checking allowed values (enum).
154
+ # @param [Object] type Object to be assigned
155
+ def type=(type)
156
+ validator = EnumAttributeValidator.new('String', ["sync", "async"])
157
+ unless validator.valid?(type)
158
+ fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
159
+ end
160
+ @type = type
161
+ end
162
+
101
163
  # Checks equality by comparing each attribute.
102
164
  # @param [Object] Object to be compared
103
165
  def ==(o)
@@ -106,7 +168,10 @@ module IronFunctions
106
168
  app_name == o.app_name &&
107
169
  path == o.path &&
108
170
  image == o.image &&
109
- headers == o.headers
171
+ headers == o.headers &&
172
+ memory == o.memory &&
173
+ type == o.type &&
174
+ config == o.config
110
175
  end
111
176
 
112
177
  # @see the `==` method
@@ -118,7 +183,7 @@ module IronFunctions
118
183
  # Calculates hash code according to all attributes.
119
184
  # @return [Fixnum] Hash code
120
185
  def hash
121
- [app_name, path, image, headers].hash
186
+ [app_name, path, image, headers, memory, type, config].hash
122
187
  end
123
188
 
124
189
  # Builds the object from hash
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #IronFunctions
3
3
 
4
- #null
4
+ #The open source serverless platform.
5
5
 
6
- OpenAPI spec version: 0.0.5
6
+ OpenAPI spec version: 0.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
@@ -26,12 +26,18 @@ require 'date'
26
26
  module IronFunctions
27
27
 
28
28
  class RouteWrapper
29
+ attr_accessor :message
30
+
31
+ attr_accessor :error
32
+
29
33
  attr_accessor :route
30
34
 
31
35
 
32
36
  # Attribute mapping from ruby-style variable name to JSON key.
33
37
  def self.attribute_map
34
38
  {
39
+ :'message' => :'message',
40
+ :'error' => :'error',
35
41
  :'route' => :'route'
36
42
  }
37
43
  end
@@ -39,6 +45,8 @@ module IronFunctions
39
45
  # Attribute type mapping.
40
46
  def self.swagger_types
41
47
  {
48
+ :'message' => :'String',
49
+ :'error' => :'ErrorBody',
42
50
  :'route' => :'Route'
43
51
  }
44
52
  end
@@ -51,6 +59,14 @@ module IronFunctions
51
59
  # convert string to symbol for hash key
52
60
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
61
 
62
+ if attributes.has_key?(:'message')
63
+ self.message = attributes[:'message']
64
+ end
65
+
66
+ if attributes.has_key?(:'error')
67
+ self.error = attributes[:'error']
68
+ end
69
+
54
70
  if attributes.has_key?(:'route')
55
71
  self.route = attributes[:'route']
56
72
  end
@@ -76,6 +92,8 @@ module IronFunctions
76
92
  def ==(o)
77
93
  return true if self.equal?(o)
78
94
  self.class == o.class &&
95
+ message == o.message &&
96
+ error == o.error &&
79
97
  route == o.route
80
98
  end
81
99
 
@@ -88,7 +106,7 @@ module IronFunctions
88
106
  # Calculates hash code according to all attributes.
89
107
  # @return [Fixnum] Hash code
90
108
  def hash
91
- [route].hash
109
+ [message, error, route].hash
92
110
  end
93
111
 
94
112
  # Builds the object from hash