triglav_client 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +5 -0
  3. data/Gemfile.lock +79 -0
  4. data/LICENSE +201 -0
  5. data/README.md +136 -0
  6. data/Rakefile +1 -0
  7. data/docs/AggregatedResourceEachResponse.md +11 -0
  8. data/docs/AuthApi.md +150 -0
  9. data/docs/BulkinsertResponse.md +8 -0
  10. data/docs/Credential.md +10 -0
  11. data/docs/ErrorModel.md +9 -0
  12. data/docs/JobEachResponse.md +12 -0
  13. data/docs/JobMessageEachResponse.md +11 -0
  14. data/docs/JobMessagesApi.md +117 -0
  15. data/docs/JobRequest.md +12 -0
  16. data/docs/JobResponse.md +14 -0
  17. data/docs/JobsApi.md +217 -0
  18. data/docs/LastJobMessageIdResponse.md +8 -0
  19. data/docs/LastMessageIdResponse.md +8 -0
  20. data/docs/MessageEachResponse.md +16 -0
  21. data/docs/MessageFetchRequest.md +10 -0
  22. data/docs/MessageRequest.md +13 -0
  23. data/docs/MessageResponse.md +16 -0
  24. data/docs/MessagesApi.md +170 -0
  25. data/docs/ResourceEachResponse.md +13 -0
  26. data/docs/ResourceRequest.md +15 -0
  27. data/docs/ResourceResponse.md +17 -0
  28. data/docs/ResourcesApi.md +335 -0
  29. data/docs/TokenResponse.md +9 -0
  30. data/docs/UserEachResponse.md +11 -0
  31. data/docs/UserRequest.md +13 -0
  32. data/docs/UserResponse.md +15 -0
  33. data/docs/UsersApi.md +274 -0
  34. data/example/example.rb +40 -0
  35. data/git_push.sh +67 -0
  36. data/lib/triglav_client.rb +77 -0
  37. data/lib/triglav_client/api/auth_api.rb +196 -0
  38. data/lib/triglav_client/api/job_messages_api.rb +153 -0
  39. data/lib/triglav_client/api/jobs_api.rb +257 -0
  40. data/lib/triglav_client/api/messages_api.rb +208 -0
  41. data/lib/triglav_client/api/resources_api.rb +379 -0
  42. data/lib/triglav_client/api/users_api.rb +318 -0
  43. data/lib/triglav_client/api_client.rb +379 -0
  44. data/lib/triglav_client/api_error.rb +47 -0
  45. data/lib/triglav_client/configuration.rb +214 -0
  46. data/lib/triglav_client/models/aggregated_resource_each_response.rb +230 -0
  47. data/lib/triglav_client/models/bulkinsert_response.rb +200 -0
  48. data/lib/triglav_client/models/credential.rb +252 -0
  49. data/lib/triglav_client/models/error_model.rb +212 -0
  50. data/lib/triglav_client/models/job_each_response.rb +235 -0
  51. data/lib/triglav_client/models/job_message_each_response.rb +229 -0
  52. data/lib/triglav_client/models/job_request.rb +241 -0
  53. data/lib/triglav_client/models/job_response.rb +259 -0
  54. data/lib/triglav_client/models/last_job_message_id_response.rb +200 -0
  55. data/lib/triglav_client/models/last_message_id_response.rb +200 -0
  56. data/lib/triglav_client/models/message_each_response.rb +281 -0
  57. data/lib/triglav_client/models/message_fetch_request.rb +223 -0
  58. data/lib/triglav_client/models/message_request.rb +254 -0
  59. data/lib/triglav_client/models/message_response.rb +281 -0
  60. data/lib/triglav_client/models/resource_each_response.rb +250 -0
  61. data/lib/triglav_client/models/resource_request.rb +269 -0
  62. data/lib/triglav_client/models/resource_response.rb +287 -0
  63. data/lib/triglav_client/models/token_response.rb +208 -0
  64. data/lib/triglav_client/models/user_each_response.rb +262 -0
  65. data/lib/triglav_client/models/user_request.rb +280 -0
  66. data/lib/triglav_client/models/user_response.rb +300 -0
  67. data/lib/triglav_client/version.rb +26 -0
  68. data/spec/api/auth_api_spec.rb +80 -0
  69. data/spec/api/job_messages_api_spec.rb +71 -0
  70. data/spec/api/jobs_api_spec.rb +93 -0
  71. data/spec/api/messages_api_spec.rb +74 -0
  72. data/spec/api/resources_api_spec.rb +109 -0
  73. data/spec/api/users_api_spec.rb +106 -0
  74. data/spec/api_client_spec.rb +237 -0
  75. data/spec/configuration_spec.rb +53 -0
  76. data/spec/models/aggregated_resource_each_response_spec.rb +71 -0
  77. data/spec/models/bulkinsert_response_spec.rb +53 -0
  78. data/spec/models/credential_spec.rb +69 -0
  79. data/spec/models/error_model_spec.rb +59 -0
  80. data/spec/models/job_each_response_spec.rb +77 -0
  81. data/spec/models/job_message_each_response_spec.rb +65 -0
  82. data/spec/models/job_request_spec.rb +71 -0
  83. data/spec/models/job_response_spec.rb +89 -0
  84. data/spec/models/last_job_message_id_response_spec.rb +53 -0
  85. data/spec/models/last_message_id_response_spec.rb +53 -0
  86. data/spec/models/message_each_response_spec.rb +89 -0
  87. data/spec/models/message_fetch_request_spec.rb +65 -0
  88. data/spec/models/message_request_spec.rb +59 -0
  89. data/spec/models/message_response_spec.rb +89 -0
  90. data/spec/models/resource_each_response_spec.rb +71 -0
  91. data/spec/models/resource_request_spec.rb +83 -0
  92. data/spec/models/resource_response_spec.rb +101 -0
  93. data/spec/models/token_response_spec.rb +59 -0
  94. data/spec/models/user_each_response_spec.rb +75 -0
  95. data/spec/models/user_request_spec.rb +87 -0
  96. data/spec/models/user_response_spec.rb +99 -0
  97. data/spec/spec_helper.rb +122 -0
  98. data/triglav_client.gemspec +55 -0
  99. metadata +351 -0
@@ -0,0 +1,200 @@
1
+ =begin
2
+ #Triglav API
3
+
4
+ #Triglav API
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: triglav_admin_my@dena.jp
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 TriglavClient
27
+
28
+ class BulkinsertResponse
29
+ # Number of inserts
30
+ attr_accessor :num_inserts
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'num_inserts' => :'num_inserts'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'num_inserts' => :'Integer'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
+
55
+ if attributes.has_key?(:'num_inserts')
56
+ self.num_inserts = attributes[:'num_inserts']
57
+ end
58
+
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properies with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ return invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ num_inserts == o.num_inserts
80
+ end
81
+
82
+ # @see the `==` method
83
+ # @param [Object] Object to be compared
84
+ def eql?(o)
85
+ self == o
86
+ end
87
+
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Fixnum] Hash code
90
+ def hash
91
+ [num_inserts].hash
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def build_from_hash(attributes)
98
+ return nil unless attributes.is_a?(Hash)
99
+ self.class.swagger_types.each_pair do |key, type|
100
+ if type =~ /^Array<(.*)>/i
101
+ # check to ensure the input is an array given that the the attribute
102
+ # is documented as an array but the input is not
103
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
104
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
105
+ end
106
+ elsif !attributes[self.class.attribute_map[key]].nil?
107
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
108
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
109
+ end
110
+
111
+ self
112
+ end
113
+
114
+ # Deserializes the data based on type
115
+ # @param string type Data type
116
+ # @param string value Value to be deserialized
117
+ # @return [Object] Deserialized data
118
+ def _deserialize(type, value)
119
+ case type.to_sym
120
+ when :DateTime
121
+ DateTime.parse(value)
122
+ when :Date
123
+ Date.parse(value)
124
+ when :String
125
+ value.to_s
126
+ when :Integer
127
+ value.to_i
128
+ when :Float
129
+ value.to_f
130
+ when :BOOLEAN
131
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
132
+ true
133
+ else
134
+ false
135
+ end
136
+ when :Object
137
+ # generic object (usually a Hash), return directly
138
+ value
139
+ when /\AArray<(?<inner_type>.+)>\z/
140
+ inner_type = Regexp.last_match[:inner_type]
141
+ value.map { |v| _deserialize(inner_type, v) }
142
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
143
+ k_type = Regexp.last_match[:k_type]
144
+ v_type = Regexp.last_match[:v_type]
145
+ {}.tap do |hash|
146
+ value.each do |k, v|
147
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
148
+ end
149
+ end
150
+ else # model
151
+ temp_model = TriglavClient.const_get(type).new
152
+ temp_model.build_from_hash(value)
153
+ end
154
+ end
155
+
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
158
+ def to_s
159
+ to_hash.to_s
160
+ end
161
+
162
+ # to_body is an alias to to_hash (backward compatibility)
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_body
165
+ to_hash
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ next if value.nil?
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map{ |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+
198
+ end
199
+
200
+ end
@@ -0,0 +1,252 @@
1
+ =begin
2
+ #Triglav API
3
+
4
+ #Triglav API
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: triglav_admin_my@dena.jp
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 TriglavClient
27
+
28
+ class Credential
29
+ attr_accessor :username
30
+
31
+ attr_accessor :password
32
+
33
+ attr_accessor :authenticator
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'username' => :'username',
61
+ :'password' => :'password',
62
+ :'authenticator' => :'authenticator'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'username' => :'String',
70
+ :'password' => :'String',
71
+ :'authenticator' => :'String'
72
+ }
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ return unless attributes.is_a?(Hash)
79
+
80
+ # convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
82
+
83
+ if attributes.has_key?(:'username')
84
+ self.username = attributes[:'username']
85
+ end
86
+
87
+ if attributes.has_key?(:'password')
88
+ self.password = attributes[:'password']
89
+ end
90
+
91
+ if attributes.has_key?(:'authenticator')
92
+ self.authenticator = attributes[:'authenticator']
93
+ end
94
+
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properies with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ return invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return false if @username.nil?
108
+ return false if @password.nil?
109
+ authenticator_validator = EnumAttributeValidator.new('String', ["local"])
110
+ return false unless authenticator_validator.valid?(@authenticator)
111
+ return true
112
+ end
113
+
114
+ # Custom attribute writer method checking allowed values (enum).
115
+ # @param [Object] authenticator Object to be assigned
116
+ def authenticator=(authenticator)
117
+ validator = EnumAttributeValidator.new('String', ["local"])
118
+ unless validator.valid?(authenticator)
119
+ fail ArgumentError, "invalid value for 'authenticator', must be one of #{validator.allowable_values}."
120
+ end
121
+ @authenticator = authenticator
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ username == o.username &&
130
+ password == o.password &&
131
+ authenticator == o.authenticator
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Fixnum] Hash code
142
+ def hash
143
+ [username, password, authenticator].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.swagger_types.each_pair do |key, type|
152
+ if type =~ /^Array<(.*)>/i
153
+ # check to ensure the input is an array given that the the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :DateTime
173
+ DateTime.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :BOOLEAN
183
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ temp_model = TriglavClient.const_get(type).new
204
+ temp_model.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ next if value.nil?
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map{ |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end