rokka_client_codegen 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +21 -0
  4. data/README.md +123 -0
  5. data/Rakefile +8 -0
  6. data/config.json +5 -0
  7. data/docs/AdminApi.md +398 -0
  8. data/docs/ListSourceImagesResponse.md +11 -0
  9. data/docs/ListStacksResponse.md +8 -0
  10. data/docs/Membership.md +11 -0
  11. data/docs/Organization.md +14 -0
  12. data/docs/OrganizationDefinition.md +10 -0
  13. data/docs/OrganizationOptions.md +10 -0
  14. data/docs/Role.md +8 -0
  15. data/docs/SourceImage.md +24 -0
  16. data/docs/SourceimagesApi.md +1032 -0
  17. data/docs/Stack.md +14 -0
  18. data/docs/StackDefinition.md +10 -0
  19. data/docs/StackExpression.md +9 -0
  20. data/docs/StackExpressionOverrides.md +8 -0
  21. data/docs/StackOperation.md +9 -0
  22. data/docs/StackOperationDescription.md +11 -0
  23. data/docs/StackOptions.md +8 -0
  24. data/docs/StacksApi.md +329 -0
  25. data/docs/User.md +11 -0
  26. data/docs/UserDefinition.md +9 -0
  27. data/examples/createstack.rb +33 -0
  28. data/examples/liststacks.rb +19 -0
  29. data/examples/setsubjectarea.rb +37 -0
  30. data/examples/uploadimage.rb +28 -0
  31. data/generate.sh +3 -0
  32. data/git_push.sh +55 -0
  33. data/lib/rokka_client_codegen.rb +59 -0
  34. data/lib/rokka_client_codegen/api/admin_api.rb +439 -0
  35. data/lib/rokka_client_codegen/api/sourceimages_api.rb +1225 -0
  36. data/lib/rokka_client_codegen/api/stacks_api.rb +371 -0
  37. data/lib/rokka_client_codegen/api_client.rb +389 -0
  38. data/lib/rokka_client_codegen/api_error.rb +38 -0
  39. data/lib/rokka_client_codegen/configuration.rb +209 -0
  40. data/lib/rokka_client_codegen/models/list_source_images_response.rb +217 -0
  41. data/lib/rokka_client_codegen/models/list_stacks_response.rb +190 -0
  42. data/lib/rokka_client_codegen/models/membership.rb +215 -0
  43. data/lib/rokka_client_codegen/models/organization.rb +264 -0
  44. data/lib/rokka_client_codegen/models/organization_definition.rb +211 -0
  45. data/lib/rokka_client_codegen/models/organization_options.rb +208 -0
  46. data/lib/rokka_client_codegen/models/role.rb +194 -0
  47. data/lib/rokka_client_codegen/models/source_image.rb +333 -0
  48. data/lib/rokka_client_codegen/models/stack.rb +246 -0
  49. data/lib/rokka_client_codegen/models/stack_definition.rb +217 -0
  50. data/lib/rokka_client_codegen/models/stack_expression.rb +207 -0
  51. data/lib/rokka_client_codegen/models/stack_expression_overrides.rb +188 -0
  52. data/lib/rokka_client_codegen/models/stack_operation.rb +203 -0
  53. data/lib/rokka_client_codegen/models/stack_operation_description.rb +231 -0
  54. data/lib/rokka_client_codegen/models/stack_options.rb +193 -0
  55. data/lib/rokka_client_codegen/models/user.rb +216 -0
  56. data/lib/rokka_client_codegen/models/user_definition.rb +204 -0
  57. data/lib/rokka_client_codegen/version.rb +15 -0
  58. data/patches/README.patch +59 -0
  59. data/patches/sourceimage_hash_long_hash.patch +62 -0
  60. data/rokka_client_codegen.gemspec +45 -0
  61. data/spec/api/admin_api_spec.rb +125 -0
  62. data/spec/api/sourceimages_api_spec.rb +274 -0
  63. data/spec/api/stacks_api_spec.rb +110 -0
  64. data/spec/api_client_spec.rb +226 -0
  65. data/spec/configuration_spec.rb +42 -0
  66. data/spec/models/list_source_images_response_spec.rb +60 -0
  67. data/spec/models/list_stacks_response_spec.rb +42 -0
  68. data/spec/models/membership_spec.rb +60 -0
  69. data/spec/models/organization_definition_spec.rb +54 -0
  70. data/spec/models/organization_options_spec.rb +54 -0
  71. data/spec/models/organization_spec.rb +78 -0
  72. data/spec/models/role_spec.rb +42 -0
  73. data/spec/models/source_image_spec.rb +138 -0
  74. data/spec/models/stack_definition_spec.rb +54 -0
  75. data/spec/models/stack_expression_overrides_spec.rb +42 -0
  76. data/spec/models/stack_expression_spec.rb +48 -0
  77. data/spec/models/stack_operation_description_spec.rb +60 -0
  78. data/spec/models/stack_operation_spec.rb +48 -0
  79. data/spec/models/stack_options_spec.rb +42 -0
  80. data/spec/models/stack_spec.rb +78 -0
  81. data/spec/models/user_definition_spec.rb +48 -0
  82. data/spec/models/user_spec.rb +60 -0
  83. data/spec/spec_helper.rb +111 -0
  84. metadata +330 -0
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #rokka.io
3
+
4
+ #digital image processing done right. [Documentation](https://rokka.io/documentation). [Changelog](https://api.rokka.io/changelog.md).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module RokkaClientCodegen
16
+
17
+ class User
18
+ attr_accessor :id
19
+
20
+ # Can be changed (v2)
21
+ attr_accessor :email
22
+
23
+ attr_accessor :api_key
24
+
25
+ attr_accessor :api_secret
26
+
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'id' => :'id',
32
+ :'email' => :'email',
33
+ :'api_key' => :'api_key',
34
+ :'api_secret' => :'api_secret'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'id' => :'String',
42
+ :'email' => :'String',
43
+ :'api_key' => :'String',
44
+ :'api_secret' => :'String'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ return unless attributes.is_a?(Hash)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
55
+
56
+ if attributes.has_key?(:'id')
57
+ self.id = attributes[:'id']
58
+ end
59
+
60
+ if attributes.has_key?(:'email')
61
+ self.email = attributes[:'email']
62
+ end
63
+
64
+ if attributes.has_key?(:'api_key')
65
+ self.api_key = attributes[:'api_key']
66
+ end
67
+
68
+ if attributes.has_key?(:'api_secret')
69
+ self.api_secret = attributes[:'api_secret']
70
+ end
71
+
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ return invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ return true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ id == o.id &&
93
+ email == o.email &&
94
+ api_key == o.api_key &&
95
+ api_secret == o.api_secret
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [id, email, api_key, api_secret].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ temp_model = RokkaClientCodegen.const_get(type).new
168
+ temp_model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map{ |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,204 @@
1
+ =begin
2
+ #rokka.io
3
+
4
+ #digital image processing done right. [Documentation](https://rokka.io/documentation). [Changelog](https://api.rokka.io/changelog.md).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module RokkaClientCodegen
16
+
17
+ class UserDefinition
18
+ # Unique email for the new user
19
+ attr_accessor :email
20
+
21
+ # If set, a new organization with that name will be created
22
+ attr_accessor :organization
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'email' => :'email',
29
+ :'organization' => :'organization'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'email' => :'String',
37
+ :'organization' => :'String'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+ if attributes.has_key?(:'email')
50
+ self.email = attributes[:'email']
51
+ end
52
+
53
+ if attributes.has_key?(:'organization')
54
+ self.organization = attributes[:'organization']
55
+ end
56
+
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ if @email.nil?
64
+ invalid_properties.push("invalid value for 'email', email cannot be nil.")
65
+ end
66
+
67
+ return invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ return false if @email.nil?
74
+ return true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ email == o.email &&
83
+ organization == o.organization
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Fixnum] Hash code
94
+ def hash
95
+ [email, organization].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def build_from_hash(attributes)
102
+ return nil unless attributes.is_a?(Hash)
103
+ self.class.swagger_types.each_pair do |key, type|
104
+ if type =~ /\AArray<(.*)>/i
105
+ # check to ensure the input is an array given that the the attribute
106
+ # is documented as an array but the input is not
107
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
108
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
109
+ end
110
+ elsif !attributes[self.class.attribute_map[key]].nil?
111
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
112
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
113
+ end
114
+
115
+ self
116
+ end
117
+
118
+ # Deserializes the data based on type
119
+ # @param string type Data type
120
+ # @param string value Value to be deserialized
121
+ # @return [Object] Deserialized data
122
+ def _deserialize(type, value)
123
+ case type.to_sym
124
+ when :DateTime
125
+ DateTime.parse(value)
126
+ when :Date
127
+ Date.parse(value)
128
+ when :String
129
+ value.to_s
130
+ when :Integer
131
+ value.to_i
132
+ when :Float
133
+ value.to_f
134
+ when :BOOLEAN
135
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
136
+ true
137
+ else
138
+ false
139
+ end
140
+ when :Object
141
+ # generic object (usually a Hash), return directly
142
+ value
143
+ when /\AArray<(?<inner_type>.+)>\z/
144
+ inner_type = Regexp.last_match[:inner_type]
145
+ value.map { |v| _deserialize(inner_type, v) }
146
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
147
+ k_type = Regexp.last_match[:k_type]
148
+ v_type = Regexp.last_match[:v_type]
149
+ {}.tap do |hash|
150
+ value.each do |k, v|
151
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
152
+ end
153
+ end
154
+ else # model
155
+ temp_model = RokkaClientCodegen.const_get(type).new
156
+ temp_model.build_from_hash(value)
157
+ end
158
+ end
159
+
160
+ # Returns the string representation of the object
161
+ # @return [String] String presentation of the object
162
+ def to_s
163
+ to_hash.to_s
164
+ end
165
+
166
+ # to_body is an alias to to_hash (backward compatibility)
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_body
169
+ to_hash
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ next if value.nil?
179
+ hash[param] = _to_hash(value)
180
+ end
181
+ hash
182
+ end
183
+
184
+ # Outputs non-array value in the form of hash
185
+ # For object, use to_hash. Otherwise, just return the value
186
+ # @param [Object] value Any valid value
187
+ # @return [Hash] Returns the value in the form of hash
188
+ def _to_hash(value)
189
+ if value.is_a?(Array)
190
+ value.compact.map{ |v| _to_hash(v) }
191
+ elsif value.is_a?(Hash)
192
+ {}.tap do |hash|
193
+ value.each { |k, v| hash[k] = _to_hash(v) }
194
+ end
195
+ elsif value.respond_to? :to_hash
196
+ value.to_hash
197
+ else
198
+ value
199
+ end
200
+ end
201
+
202
+ end
203
+
204
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #rokka.io
3
+
4
+ #digital image processing done right. [Documentation](https://rokka.io/documentation). [Changelog](https://api.rokka.io/changelog.md).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ module RokkaClientCodegen
14
+ VERSION = "0.0.1"
15
+ end
@@ -0,0 +1,59 @@
1
+ diff --git a/README.md b/README.md
2
+ index ccc7ce3..29d7557 100644
3
+ --- a/README.md
4
+ +++ b/README.md
5
+ @@ -1,10 +1,12 @@
6
+ # rokka_client_codegen
7
+
8
+ -RokkaClientCodegen - the Ruby gem for the rokka.io
9
+ +This Ruby gem for rokka.io was automatically generated by [Swagger Codegen](https://github.com/swagger-api/swagger-codegen).
10
+
11
+ -digital image processing done right. [Documentation](https://rokka.io/documentation). [Changelog](https://api.rokka.io/changelog.md).
12
+ +See the [examples](examples/) directory for some simple rokka specific examples.
13
+
14
+ -This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
15
+ +A thin wrapper package for using this to make some things easier would be welcome. We're [happy to help](https://rokka.io/en/contact/).
16
+ +
17
+ +The gem is currently nowhere published, you have to build it yourself (see below). But if needed, we will publish it.
18
+
19
+ - API version: 1.0.0
20
+ - Package version: 0.0.1
21
+ @@ -49,37 +51,7 @@ ruby -Ilib script.rb
22
+
23
+ ## Getting Started
24
+
25
+ -Please follow the [installation](#installation) procedure and then run the following code:
26
+ -```ruby
27
+ -# Load the gem
28
+ -require 'rokka_client_codegen'
29
+ -
30
+ -# Setup authorization
31
+ -RokkaClientCodegen.configure do |config|
32
+ - # Configure API key authorization: ApiKeyAuth
33
+ - config.api_key['api-key'] = 'YOUR API KEY'
34
+ - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
35
+ - #config.api_key_prefix['api-key'] = 'Bearer'
36
+ -end
37
+ -
38
+ -api_instance = RokkaClientCodegen::AdminApi.new
39
+ -
40
+ -role = RokkaClientCodegen::Role.new # Role | Role specification
41
+ -
42
+ -organization = "organization_example" # String |
43
+ -
44
+ -email = "email_example" # String |
45
+ -
46
+ -
47
+ -begin
48
+ - #Add a rokka user into an organization.
49
+ - result = api_instance.create_membership(role, organization, email)
50
+ - p result
51
+ -rescue RokkaClientCodegen::ApiError => e
52
+ - puts "Exception when calling AdminApi->create_membership: #{e}"
53
+ -end
54
+ -
55
+ -```
56
+ +Please follow the [installation procedure](#installation--usage) and then see the [examples](examples/) directory.
57
+
58
+ ## Documentation for API Endpoints
59
+