alfresco 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +69 -0
  4. data/README.md +119 -0
  5. data/Rakefile +8 -0
  6. data/alfresco.gemspec +45 -0
  7. data/docs/ContentInfo.md +12 -0
  8. data/docs/Error.md +8 -0
  9. data/docs/ErrorError.md +13 -0
  10. data/docs/GenericBucket.md +13 -0
  11. data/docs/GenericBucketBucketInfo.md +11 -0
  12. data/docs/GenericFacetResponse.md +10 -0
  13. data/docs/GenericMetric.md +9 -0
  14. data/docs/Node.md +24 -0
  15. data/docs/Pagination.md +12 -0
  16. data/docs/PathElement.md +9 -0
  17. data/docs/PathInfo.md +10 -0
  18. data/docs/RequestDefaults.md +12 -0
  19. data/docs/RequestFacetField.md +18 -0
  20. data/docs/RequestFacetFields.md +8 -0
  21. data/docs/RequestFacetIntervals.md +9 -0
  22. data/docs/RequestFacetIntervalsIntervals.md +10 -0
  23. data/docs/RequestFacetQueries.md +7 -0
  24. data/docs/RequestFacetQueriesInner.md +9 -0
  25. data/docs/RequestFacetSet.md +12 -0
  26. data/docs/RequestFields.md +7 -0
  27. data/docs/RequestFilterQueries.md +7 -0
  28. data/docs/RequestFilterQueriesInner.md +9 -0
  29. data/docs/RequestHighlight.md +15 -0
  30. data/docs/RequestHighlightFields.md +13 -0
  31. data/docs/RequestInclude.md +7 -0
  32. data/docs/RequestLimits.md +9 -0
  33. data/docs/RequestLocalization.md +9 -0
  34. data/docs/RequestPagination.md +9 -0
  35. data/docs/RequestPivot.md +9 -0
  36. data/docs/RequestQuery.md +10 -0
  37. data/docs/RequestRange.md +16 -0
  38. data/docs/RequestScope.md +8 -0
  39. data/docs/RequestSortDefinition.md +7 -0
  40. data/docs/RequestSortDefinitionInner.md +10 -0
  41. data/docs/RequestSpellcheck.md +8 -0
  42. data/docs/RequestStats.md +23 -0
  43. data/docs/RequestTemplates.md +7 -0
  44. data/docs/RequestTemplatesInner.md +9 -0
  45. data/docs/ResponseConsistency.md +8 -0
  46. data/docs/ResultBuckets.md +9 -0
  47. data/docs/ResultBucketsBuckets.md +11 -0
  48. data/docs/ResultNode.md +29 -0
  49. data/docs/ResultSetContext.md +13 -0
  50. data/docs/ResultSetContextFacetQueries.md +10 -0
  51. data/docs/ResultSetContextSpellcheck.md +9 -0
  52. data/docs/ResultSetPaging.md +8 -0
  53. data/docs/ResultSetPagingList.md +10 -0
  54. data/docs/ResultSetRowEntry.md +8 -0
  55. data/docs/SearchApi.md +62 -0
  56. data/docs/SearchEntry.md +9 -0
  57. data/docs/SearchEntryHighlight.md +9 -0
  58. data/docs/SearchRequest.md +27 -0
  59. data/docs/UserInfo.md +9 -0
  60. data/git_push.sh +55 -0
  61. data/lib/alfresco.rb +92 -0
  62. data/lib/alfresco/api/search_api.rb +78 -0
  63. data/lib/alfresco/api_client.rb +389 -0
  64. data/lib/alfresco/api_error.rb +38 -0
  65. data/lib/alfresco/configuration.rb +209 -0
  66. data/lib/alfresco/models/content_info.rb +239 -0
  67. data/lib/alfresco/models/error.rb +188 -0
  68. data/lib/alfresco/models/error_error.rb +253 -0
  69. data/lib/alfresco/models/generic_bucket.rb +242 -0
  70. data/lib/alfresco/models/generic_bucket_bucket_info.rb +219 -0
  71. data/lib/alfresco/models/generic_facet_response.rb +211 -0
  72. data/lib/alfresco/models/generic_metric.rb +199 -0
  73. data/lib/alfresco/models/node.rb +403 -0
  74. data/lib/alfresco/models/pagination.rb +249 -0
  75. data/lib/alfresco/models/path_element.rb +197 -0
  76. data/lib/alfresco/models/path_info.rb +208 -0
  77. data/lib/alfresco/models/request_defaults.rb +283 -0
  78. data/lib/alfresco/models/request_facet_field.rb +333 -0
  79. data/lib/alfresco/models/request_facet_fields.rb +191 -0
  80. data/lib/alfresco/models/request_facet_intervals.rb +203 -0
  81. data/lib/alfresco/models/request_facet_intervals_intervals.rb +211 -0
  82. data/lib/alfresco/models/request_facet_queries.rb +179 -0
  83. data/lib/alfresco/models/request_facet_queries_inner.rb +199 -0
  84. data/lib/alfresco/models/request_facet_set.rb +233 -0
  85. data/lib/alfresco/models/request_fields.rb +179 -0
  86. data/lib/alfresco/models/request_filter_queries.rb +179 -0
  87. data/lib/alfresco/models/request_filter_queries_inner.rb +201 -0
  88. data/lib/alfresco/models/request_highlight.rb +261 -0
  89. data/lib/alfresco/models/request_highlight_fields.rb +234 -0
  90. data/lib/alfresco/models/request_include.rb +179 -0
  91. data/lib/alfresco/models/request_limits.rb +199 -0
  92. data/lib/alfresco/models/request_localization.rb +201 -0
  93. data/lib/alfresco/models/request_pagination.rb +231 -0
  94. data/lib/alfresco/models/request_pivot.rb +200 -0
  95. data/lib/alfresco/models/request_query.rb +249 -0
  96. data/lib/alfresco/models/request_range.rb +275 -0
  97. data/lib/alfresco/models/request_scope.rb +222 -0
  98. data/lib/alfresco/models/request_sort_definition.rb +179 -0
  99. data/lib/alfresco/models/request_sort_definition_inner.rb +246 -0
  100. data/lib/alfresco/models/request_spellcheck.rb +188 -0
  101. data/lib/alfresco/models/request_stats.rb +367 -0
  102. data/lib/alfresco/models/request_templates.rb +179 -0
  103. data/lib/alfresco/models/request_templates_inner.rb +199 -0
  104. data/lib/alfresco/models/response_consistency.rb +189 -0
  105. data/lib/alfresco/models/result_buckets.rb +201 -0
  106. data/lib/alfresco/models/result_buckets_buckets.rb +219 -0
  107. data/lib/alfresco/models/result_node.rb +448 -0
  108. data/lib/alfresco/models/result_set_context.rb +245 -0
  109. data/lib/alfresco/models/result_set_context_facet_queries.rb +207 -0
  110. data/lib/alfresco/models/result_set_context_spellcheck.rb +233 -0
  111. data/lib/alfresco/models/result_set_paging.rb +188 -0
  112. data/lib/alfresco/models/result_set_paging_list.rb +208 -0
  113. data/lib/alfresco/models/result_set_row_entry.rb +193 -0
  114. data/lib/alfresco/models/search_entry.rb +201 -0
  115. data/lib/alfresco/models/search_entry_highlight.rb +201 -0
  116. data/lib/alfresco/models/search_request.rb +373 -0
  117. data/lib/alfresco/models/user_info.rb +207 -0
  118. data/lib/alfresco/version.rb +15 -0
  119. data/spec/api/search_api_spec.rb +47 -0
  120. data/spec/api_client_spec.rb +226 -0
  121. data/spec/configuration_spec.rb +39 -0
  122. data/spec/models/content_info_spec.rb +66 -0
  123. data/spec/models/error_error_spec.rb +72 -0
  124. data/spec/models/error_spec.rb +42 -0
  125. data/spec/models/generic_bucket_bucket_info_spec.rb +60 -0
  126. data/spec/models/generic_bucket_spec.rb +72 -0
  127. data/spec/models/generic_facet_response_spec.rb +54 -0
  128. data/spec/models/generic_metric_spec.rb +48 -0
  129. data/spec/models/node_spec.rb +138 -0
  130. data/spec/models/pagination_spec.rb +66 -0
  131. data/spec/models/path_element_spec.rb +48 -0
  132. data/spec/models/path_info_spec.rb +54 -0
  133. data/spec/models/request_defaults_spec.rb +74 -0
  134. data/spec/models/request_facet_field_spec.rb +110 -0
  135. data/spec/models/request_facet_fields_spec.rb +42 -0
  136. data/spec/models/request_facet_intervals_intervals_spec.rb +54 -0
  137. data/spec/models/request_facet_intervals_spec.rb +48 -0
  138. data/spec/models/request_facet_queries_inner_spec.rb +48 -0
  139. data/spec/models/request_facet_queries_spec.rb +36 -0
  140. data/spec/models/request_facet_set_spec.rb +66 -0
  141. data/spec/models/request_fields_spec.rb +36 -0
  142. data/spec/models/request_filter_queries_inner_spec.rb +48 -0
  143. data/spec/models/request_filter_queries_spec.rb +36 -0
  144. data/spec/models/request_highlight_fields_spec.rb +72 -0
  145. data/spec/models/request_highlight_spec.rb +84 -0
  146. data/spec/models/request_include_spec.rb +36 -0
  147. data/spec/models/request_limits_spec.rb +48 -0
  148. data/spec/models/request_localization_spec.rb +48 -0
  149. data/spec/models/request_pagination_spec.rb +48 -0
  150. data/spec/models/request_pivot_spec.rb +48 -0
  151. data/spec/models/request_query_spec.rb +58 -0
  152. data/spec/models/request_range_spec.rb +90 -0
  153. data/spec/models/request_scope_spec.rb +46 -0
  154. data/spec/models/request_sort_definition_inner_spec.rb +58 -0
  155. data/spec/models/request_sort_definition_spec.rb +36 -0
  156. data/spec/models/request_spellcheck_spec.rb +42 -0
  157. data/spec/models/request_stats_spec.rb +132 -0
  158. data/spec/models/request_templates_inner_spec.rb +48 -0
  159. data/spec/models/request_templates_spec.rb +36 -0
  160. data/spec/models/response_consistency_spec.rb +42 -0
  161. data/spec/models/result_buckets_buckets_spec.rb +60 -0
  162. data/spec/models/result_buckets_spec.rb +48 -0
  163. data/spec/models/result_node_spec.rb +168 -0
  164. data/spec/models/result_set_context_facet_queries_spec.rb +54 -0
  165. data/spec/models/result_set_context_spec.rb +72 -0
  166. data/spec/models/result_set_context_spellcheck_spec.rb +52 -0
  167. data/spec/models/result_set_paging_list_spec.rb +54 -0
  168. data/spec/models/result_set_paging_spec.rb +42 -0
  169. data/spec/models/result_set_row_entry_spec.rb +42 -0
  170. data/spec/models/search_entry_highlight_spec.rb +48 -0
  171. data/spec/models/search_entry_spec.rb +48 -0
  172. data/spec/models/search_request_spec.rb +156 -0
  173. data/spec/models/user_info_spec.rb +48 -0
  174. data/spec/spec_helper.rb +111 -0
  175. metadata +455 -0
@@ -0,0 +1,201 @@
1
+ =begin
2
+ #Alfresco Content Services REST API
3
+
4
+ #**Search API** Provides access to the search features of Alfresco Content Services.
5
+
6
+ OpenAPI spec version: 1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Alfresco
16
+
17
+ class ResultBuckets
18
+ # The field name or its explicit label, if provided on the request
19
+ attr_accessor :label
20
+
21
+ # An array of buckets and values
22
+ attr_accessor :buckets
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'label' => :'label',
29
+ :'buckets' => :'buckets'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'label' => :'String',
37
+ :'buckets' => :'Array<ResultBucketsBuckets>'
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?(:'label')
50
+ self.label = attributes[:'label']
51
+ end
52
+
53
+ if attributes.has_key?(:'buckets')
54
+ if (value = attributes[:'buckets']).is_a?(Array)
55
+ self.buckets = value
56
+ end
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
+ label == o.label &&
80
+ buckets == o.buckets
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Fixnum] Hash code
91
+ def hash
92
+ [label, buckets].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+ self.class.swagger_types.each_pair do |key, type|
101
+ if type =~ /\AArray<(.*)>/i
102
+ # check to ensure the input is an array given that the the attribute
103
+ # is documented as an array but the input is not
104
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
105
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
106
+ end
107
+ elsif !attributes[self.class.attribute_map[key]].nil?
108
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
110
+ end
111
+
112
+ self
113
+ end
114
+
115
+ # Deserializes the data based on type
116
+ # @param string type Data type
117
+ # @param string value Value to be deserialized
118
+ # @return [Object] Deserialized data
119
+ def _deserialize(type, value)
120
+ case type.to_sym
121
+ when :DateTime
122
+ DateTime.parse(value)
123
+ when :Date
124
+ Date.parse(value)
125
+ when :String
126
+ value.to_s
127
+ when :Integer
128
+ value.to_i
129
+ when :Float
130
+ value.to_f
131
+ when :BOOLEAN
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
+ true
134
+ else
135
+ false
136
+ end
137
+ when :Object
138
+ # generic object (usually a Hash), return directly
139
+ value
140
+ when /\AArray<(?<inner_type>.+)>\z/
141
+ inner_type = Regexp.last_match[:inner_type]
142
+ value.map { |v| _deserialize(inner_type, v) }
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
+ k_type = Regexp.last_match[:k_type]
145
+ v_type = Regexp.last_match[:v_type]
146
+ {}.tap do |hash|
147
+ value.each do |k, v|
148
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
+ end
150
+ end
151
+ else # model
152
+ temp_model = Alfresco.const_get(type).new
153
+ temp_model.build_from_hash(value)
154
+ end
155
+ end
156
+
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
159
+ def to_s
160
+ to_hash.to_s
161
+ end
162
+
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ # Outputs non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
183
+ # @param [Object] value Any valid value
184
+ # @return [Hash] Returns the value in the form of hash
185
+ def _to_hash(value)
186
+ if value.is_a?(Array)
187
+ value.compact.map{ |v| _to_hash(v) }
188
+ elsif value.is_a?(Hash)
189
+ {}.tap do |hash|
190
+ value.each { |k, v| hash[k] = _to_hash(v) }
191
+ end
192
+ elsif value.respond_to? :to_hash
193
+ value.to_hash
194
+ else
195
+ value
196
+ end
197
+ end
198
+
199
+ end
200
+
201
+ end
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #Alfresco Content Services REST API
3
+
4
+ #**Search API** Provides access to the search features of Alfresco Content Services.
5
+
6
+ OpenAPI spec version: 1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Alfresco
16
+
17
+ class ResultBucketsBuckets
18
+ # The bucket label
19
+ attr_accessor :label
20
+
21
+ # The filter query you can use to apply this facet
22
+ attr_accessor :filter_query
23
+
24
+ # The count for the bucket
25
+ attr_accessor :count
26
+
27
+ # An optional field for additional display information
28
+ attr_accessor :display
29
+
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'label' => :'label',
35
+ :'filter_query' => :'filterQuery',
36
+ :'count' => :'count',
37
+ :'display' => :'display'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'label' => :'String',
45
+ :'filter_query' => :'String',
46
+ :'count' => :'Integer',
47
+ :'display' => :'Object'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
+
59
+ if attributes.has_key?(:'label')
60
+ self.label = attributes[:'label']
61
+ end
62
+
63
+ if attributes.has_key?(:'filterQuery')
64
+ self.filter_query = attributes[:'filterQuery']
65
+ end
66
+
67
+ if attributes.has_key?(:'count')
68
+ self.count = attributes[:'count']
69
+ end
70
+
71
+ if attributes.has_key?(:'display')
72
+ self.display = attributes[:'display']
73
+ end
74
+
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properies with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ return invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ label == o.label &&
96
+ filter_query == o.filter_query &&
97
+ count == o.count &&
98
+ display == o.display
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Fixnum] Hash code
109
+ def hash
110
+ [label, filter_query, count, display].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.swagger_types.each_pair do |key, type|
119
+ if type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ DateTime.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :BOOLEAN
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ temp_model = Alfresco.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map{ |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -0,0 +1,448 @@
1
+ =begin
2
+ #Alfresco Content Services REST API
3
+
4
+ #**Search API** Provides access to the search features of Alfresco Content Services.
5
+
6
+ OpenAPI spec version: 1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Alfresco
16
+
17
+ class ResultNode
18
+ attr_accessor :id
19
+
20
+ # The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. The character . must not be used at the end of the name.
21
+ attr_accessor :name
22
+
23
+ attr_accessor :node_type
24
+
25
+ attr_accessor :is_folder
26
+
27
+ attr_accessor :is_file
28
+
29
+ attr_accessor :is_locked
30
+
31
+ attr_accessor :modified_at
32
+
33
+ attr_accessor :modified_by_user
34
+
35
+ attr_accessor :created_at
36
+
37
+ attr_accessor :created_by_user
38
+
39
+ attr_accessor :parent_id
40
+
41
+ attr_accessor :is_link
42
+
43
+ attr_accessor :content
44
+
45
+ attr_accessor :aspect_names
46
+
47
+ attr_accessor :properties
48
+
49
+ attr_accessor :allowable_operations
50
+
51
+ attr_accessor :path
52
+
53
+ attr_accessor :search
54
+
55
+ attr_accessor :archived_by_user
56
+
57
+ attr_accessor :archived_at
58
+
59
+ attr_accessor :version_label
60
+
61
+ attr_accessor :version_comment
62
+
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'id' => :'id',
68
+ :'name' => :'name',
69
+ :'node_type' => :'nodeType',
70
+ :'is_folder' => :'isFolder',
71
+ :'is_file' => :'isFile',
72
+ :'is_locked' => :'isLocked',
73
+ :'modified_at' => :'modifiedAt',
74
+ :'modified_by_user' => :'modifiedByUser',
75
+ :'created_at' => :'createdAt',
76
+ :'created_by_user' => :'createdByUser',
77
+ :'parent_id' => :'parentId',
78
+ :'is_link' => :'isLink',
79
+ :'content' => :'content',
80
+ :'aspect_names' => :'aspectNames',
81
+ :'properties' => :'properties',
82
+ :'allowable_operations' => :'allowableOperations',
83
+ :'path' => :'path',
84
+ :'search' => :'search',
85
+ :'archived_by_user' => :'archivedByUser',
86
+ :'archived_at' => :'archivedAt',
87
+ :'version_label' => :'versionLabel',
88
+ :'version_comment' => :'versionComment'
89
+ }
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.swagger_types
94
+ {
95
+ :'id' => :'String',
96
+ :'name' => :'String',
97
+ :'node_type' => :'String',
98
+ :'is_folder' => :'BOOLEAN',
99
+ :'is_file' => :'BOOLEAN',
100
+ :'is_locked' => :'BOOLEAN',
101
+ :'modified_at' => :'DateTime',
102
+ :'modified_by_user' => :'UserInfo',
103
+ :'created_at' => :'DateTime',
104
+ :'created_by_user' => :'UserInfo',
105
+ :'parent_id' => :'String',
106
+ :'is_link' => :'BOOLEAN',
107
+ :'content' => :'ContentInfo',
108
+ :'aspect_names' => :'Array<String>',
109
+ :'properties' => :'Object',
110
+ :'allowable_operations' => :'Array<String>',
111
+ :'path' => :'PathInfo',
112
+ :'search' => :'SearchEntry',
113
+ :'archived_by_user' => :'UserInfo',
114
+ :'archived_at' => :'DateTime',
115
+ :'version_label' => :'String',
116
+ :'version_comment' => :'String'
117
+ }
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ return unless attributes.is_a?(Hash)
124
+
125
+ # convert string to symbol for hash key
126
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
127
+
128
+ if attributes.has_key?(:'id')
129
+ self.id = attributes[:'id']
130
+ end
131
+
132
+ if attributes.has_key?(:'name')
133
+ self.name = attributes[:'name']
134
+ end
135
+
136
+ if attributes.has_key?(:'nodeType')
137
+ self.node_type = attributes[:'nodeType']
138
+ end
139
+
140
+ if attributes.has_key?(:'isFolder')
141
+ self.is_folder = attributes[:'isFolder']
142
+ end
143
+
144
+ if attributes.has_key?(:'isFile')
145
+ self.is_file = attributes[:'isFile']
146
+ end
147
+
148
+ if attributes.has_key?(:'isLocked')
149
+ self.is_locked = attributes[:'isLocked']
150
+ else
151
+ self.is_locked = false
152
+ end
153
+
154
+ if attributes.has_key?(:'modifiedAt')
155
+ self.modified_at = attributes[:'modifiedAt']
156
+ end
157
+
158
+ if attributes.has_key?(:'modifiedByUser')
159
+ self.modified_by_user = attributes[:'modifiedByUser']
160
+ end
161
+
162
+ if attributes.has_key?(:'createdAt')
163
+ self.created_at = attributes[:'createdAt']
164
+ end
165
+
166
+ if attributes.has_key?(:'createdByUser')
167
+ self.created_by_user = attributes[:'createdByUser']
168
+ end
169
+
170
+ if attributes.has_key?(:'parentId')
171
+ self.parent_id = attributes[:'parentId']
172
+ end
173
+
174
+ if attributes.has_key?(:'isLink')
175
+ self.is_link = attributes[:'isLink']
176
+ end
177
+
178
+ if attributes.has_key?(:'content')
179
+ self.content = attributes[:'content']
180
+ end
181
+
182
+ if attributes.has_key?(:'aspectNames')
183
+ if (value = attributes[:'aspectNames']).is_a?(Array)
184
+ self.aspect_names = value
185
+ end
186
+ end
187
+
188
+ if attributes.has_key?(:'properties')
189
+ self.properties = attributes[:'properties']
190
+ end
191
+
192
+ if attributes.has_key?(:'allowableOperations')
193
+ if (value = attributes[:'allowableOperations']).is_a?(Array)
194
+ self.allowable_operations = value
195
+ end
196
+ end
197
+
198
+ if attributes.has_key?(:'path')
199
+ self.path = attributes[:'path']
200
+ end
201
+
202
+ if attributes.has_key?(:'search')
203
+ self.search = attributes[:'search']
204
+ end
205
+
206
+ if attributes.has_key?(:'archivedByUser')
207
+ self.archived_by_user = attributes[:'archivedByUser']
208
+ end
209
+
210
+ if attributes.has_key?(:'archivedAt')
211
+ self.archived_at = attributes[:'archivedAt']
212
+ end
213
+
214
+ if attributes.has_key?(:'versionLabel')
215
+ self.version_label = attributes[:'versionLabel']
216
+ end
217
+
218
+ if attributes.has_key?(:'versionComment')
219
+ self.version_comment = attributes[:'versionComment']
220
+ end
221
+
222
+ end
223
+
224
+ # Show invalid properties with the reasons. Usually used together with valid?
225
+ # @return Array for valid properies with the reasons
226
+ def list_invalid_properties
227
+ invalid_properties = Array.new
228
+ if @id.nil?
229
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
230
+ end
231
+
232
+ if @name.nil?
233
+ invalid_properties.push("invalid value for 'name', name cannot be nil.")
234
+ end
235
+
236
+ if @name !~ Regexp.new(/^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/)
237
+ invalid_properties.push("invalid value for 'name', must conform to the pattern /^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/.")
238
+ end
239
+
240
+ if @node_type.nil?
241
+ invalid_properties.push("invalid value for 'node_type', node_type cannot be nil.")
242
+ end
243
+
244
+ if @is_folder.nil?
245
+ invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
246
+ end
247
+
248
+ if @is_file.nil?
249
+ invalid_properties.push("invalid value for 'is_file', is_file cannot be nil.")
250
+ end
251
+
252
+ if @modified_at.nil?
253
+ invalid_properties.push("invalid value for 'modified_at', modified_at cannot be nil.")
254
+ end
255
+
256
+ if @modified_by_user.nil?
257
+ invalid_properties.push("invalid value for 'modified_by_user', modified_by_user cannot be nil.")
258
+ end
259
+
260
+ if @created_at.nil?
261
+ invalid_properties.push("invalid value for 'created_at', created_at cannot be nil.")
262
+ end
263
+
264
+ if @created_by_user.nil?
265
+ invalid_properties.push("invalid value for 'created_by_user', created_by_user cannot be nil.")
266
+ end
267
+
268
+ return invalid_properties
269
+ end
270
+
271
+ # Check to see if the all the properties in the model are valid
272
+ # @return true if the model is valid
273
+ def valid?
274
+ return false if @id.nil?
275
+ return false if @name.nil?
276
+ return false if @name !~ Regexp.new(/^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/)
277
+ return false if @node_type.nil?
278
+ return false if @is_folder.nil?
279
+ return false if @is_file.nil?
280
+ return false if @modified_at.nil?
281
+ return false if @modified_by_user.nil?
282
+ return false if @created_at.nil?
283
+ return false if @created_by_user.nil?
284
+ return true
285
+ end
286
+
287
+ # Custom attribute writer method with validation
288
+ # @param [Object] name Value to be assigned
289
+ def name=(name)
290
+ if name.nil?
291
+ fail ArgumentError, "name cannot be nil"
292
+ end
293
+
294
+ if name !~ Regexp.new(/^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/)
295
+ fail ArgumentError, "invalid value for 'name', must conform to the pattern /^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/."
296
+ end
297
+
298
+ @name = name
299
+ end
300
+
301
+ # Checks equality by comparing each attribute.
302
+ # @param [Object] Object to be compared
303
+ def ==(o)
304
+ return true if self.equal?(o)
305
+ self.class == o.class &&
306
+ id == o.id &&
307
+ name == o.name &&
308
+ node_type == o.node_type &&
309
+ is_folder == o.is_folder &&
310
+ is_file == o.is_file &&
311
+ is_locked == o.is_locked &&
312
+ modified_at == o.modified_at &&
313
+ modified_by_user == o.modified_by_user &&
314
+ created_at == o.created_at &&
315
+ created_by_user == o.created_by_user &&
316
+ parent_id == o.parent_id &&
317
+ is_link == o.is_link &&
318
+ content == o.content &&
319
+ aspect_names == o.aspect_names &&
320
+ properties == o.properties &&
321
+ allowable_operations == o.allowable_operations &&
322
+ path == o.path &&
323
+ search == o.search &&
324
+ archived_by_user == o.archived_by_user &&
325
+ archived_at == o.archived_at &&
326
+ version_label == o.version_label &&
327
+ version_comment == o.version_comment
328
+ end
329
+
330
+ # @see the `==` method
331
+ # @param [Object] Object to be compared
332
+ def eql?(o)
333
+ self == o
334
+ end
335
+
336
+ # Calculates hash code according to all attributes.
337
+ # @return [Fixnum] Hash code
338
+ def hash
339
+ [id, name, node_type, is_folder, is_file, is_locked, modified_at, modified_by_user, created_at, created_by_user, parent_id, is_link, content, aspect_names, properties, allowable_operations, path, search, archived_by_user, archived_at, version_label, version_comment].hash
340
+ end
341
+
342
+ # Builds the object from hash
343
+ # @param [Hash] attributes Model attributes in the form of hash
344
+ # @return [Object] Returns the model itself
345
+ def build_from_hash(attributes)
346
+ return nil unless attributes.is_a?(Hash)
347
+ self.class.swagger_types.each_pair do |key, type|
348
+ if type =~ /\AArray<(.*)>/i
349
+ # check to ensure the input is an array given that the the attribute
350
+ # is documented as an array but the input is not
351
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
352
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
353
+ end
354
+ elsif !attributes[self.class.attribute_map[key]].nil?
355
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
356
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
357
+ end
358
+
359
+ self
360
+ end
361
+
362
+ # Deserializes the data based on type
363
+ # @param string type Data type
364
+ # @param string value Value to be deserialized
365
+ # @return [Object] Deserialized data
366
+ def _deserialize(type, value)
367
+ case type.to_sym
368
+ when :DateTime
369
+ DateTime.parse(value)
370
+ when :Date
371
+ Date.parse(value)
372
+ when :String
373
+ value.to_s
374
+ when :Integer
375
+ value.to_i
376
+ when :Float
377
+ value.to_f
378
+ when :BOOLEAN
379
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
380
+ true
381
+ else
382
+ false
383
+ end
384
+ when :Object
385
+ # generic object (usually a Hash), return directly
386
+ value
387
+ when /\AArray<(?<inner_type>.+)>\z/
388
+ inner_type = Regexp.last_match[:inner_type]
389
+ value.map { |v| _deserialize(inner_type, v) }
390
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
391
+ k_type = Regexp.last_match[:k_type]
392
+ v_type = Regexp.last_match[:v_type]
393
+ {}.tap do |hash|
394
+ value.each do |k, v|
395
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
396
+ end
397
+ end
398
+ else # model
399
+ temp_model = Alfresco.const_get(type).new
400
+ temp_model.build_from_hash(value)
401
+ end
402
+ end
403
+
404
+ # Returns the string representation of the object
405
+ # @return [String] String presentation of the object
406
+ def to_s
407
+ to_hash.to_s
408
+ end
409
+
410
+ # to_body is an alias to to_hash (backward compatibility)
411
+ # @return [Hash] Returns the object in the form of hash
412
+ def to_body
413
+ to_hash
414
+ end
415
+
416
+ # Returns the object in the form of hash
417
+ # @return [Hash] Returns the object in the form of hash
418
+ def to_hash
419
+ hash = {}
420
+ self.class.attribute_map.each_pair do |attr, param|
421
+ value = self.send(attr)
422
+ next if value.nil?
423
+ hash[param] = _to_hash(value)
424
+ end
425
+ hash
426
+ end
427
+
428
+ # Outputs non-array value in the form of hash
429
+ # For object, use to_hash. Otherwise, just return the value
430
+ # @param [Object] value Any valid value
431
+ # @return [Hash] Returns the value in the form of hash
432
+ def _to_hash(value)
433
+ if value.is_a?(Array)
434
+ value.compact.map{ |v| _to_hash(v) }
435
+ elsif value.is_a?(Hash)
436
+ {}.tap do |hash|
437
+ value.each { |k, v| hash[k] = _to_hash(v) }
438
+ end
439
+ elsif value.respond_to? :to_hash
440
+ value.to_hash
441
+ else
442
+ value
443
+ end
444
+ end
445
+
446
+ end
447
+
448
+ end