alfresco 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +119 -0
- data/Rakefile +8 -0
- data/alfresco.gemspec +45 -0
- data/docs/ContentInfo.md +12 -0
- data/docs/Error.md +8 -0
- data/docs/ErrorError.md +13 -0
- data/docs/GenericBucket.md +13 -0
- data/docs/GenericBucketBucketInfo.md +11 -0
- data/docs/GenericFacetResponse.md +10 -0
- data/docs/GenericMetric.md +9 -0
- data/docs/Node.md +24 -0
- data/docs/Pagination.md +12 -0
- data/docs/PathElement.md +9 -0
- data/docs/PathInfo.md +10 -0
- data/docs/RequestDefaults.md +12 -0
- data/docs/RequestFacetField.md +18 -0
- data/docs/RequestFacetFields.md +8 -0
- data/docs/RequestFacetIntervals.md +9 -0
- data/docs/RequestFacetIntervalsIntervals.md +10 -0
- data/docs/RequestFacetQueries.md +7 -0
- data/docs/RequestFacetQueriesInner.md +9 -0
- data/docs/RequestFacetSet.md +12 -0
- data/docs/RequestFields.md +7 -0
- data/docs/RequestFilterQueries.md +7 -0
- data/docs/RequestFilterQueriesInner.md +9 -0
- data/docs/RequestHighlight.md +15 -0
- data/docs/RequestHighlightFields.md +13 -0
- data/docs/RequestInclude.md +7 -0
- data/docs/RequestLimits.md +9 -0
- data/docs/RequestLocalization.md +9 -0
- data/docs/RequestPagination.md +9 -0
- data/docs/RequestPivot.md +9 -0
- data/docs/RequestQuery.md +10 -0
- data/docs/RequestRange.md +16 -0
- data/docs/RequestScope.md +8 -0
- data/docs/RequestSortDefinition.md +7 -0
- data/docs/RequestSortDefinitionInner.md +10 -0
- data/docs/RequestSpellcheck.md +8 -0
- data/docs/RequestStats.md +23 -0
- data/docs/RequestTemplates.md +7 -0
- data/docs/RequestTemplatesInner.md +9 -0
- data/docs/ResponseConsistency.md +8 -0
- data/docs/ResultBuckets.md +9 -0
- data/docs/ResultBucketsBuckets.md +11 -0
- data/docs/ResultNode.md +29 -0
- data/docs/ResultSetContext.md +13 -0
- data/docs/ResultSetContextFacetQueries.md +10 -0
- data/docs/ResultSetContextSpellcheck.md +9 -0
- data/docs/ResultSetPaging.md +8 -0
- data/docs/ResultSetPagingList.md +10 -0
- data/docs/ResultSetRowEntry.md +8 -0
- data/docs/SearchApi.md +62 -0
- data/docs/SearchEntry.md +9 -0
- data/docs/SearchEntryHighlight.md +9 -0
- data/docs/SearchRequest.md +27 -0
- data/docs/UserInfo.md +9 -0
- data/git_push.sh +55 -0
- data/lib/alfresco.rb +92 -0
- data/lib/alfresco/api/search_api.rb +78 -0
- data/lib/alfresco/api_client.rb +389 -0
- data/lib/alfresco/api_error.rb +38 -0
- data/lib/alfresco/configuration.rb +209 -0
- data/lib/alfresco/models/content_info.rb +239 -0
- data/lib/alfresco/models/error.rb +188 -0
- data/lib/alfresco/models/error_error.rb +253 -0
- data/lib/alfresco/models/generic_bucket.rb +242 -0
- data/lib/alfresco/models/generic_bucket_bucket_info.rb +219 -0
- data/lib/alfresco/models/generic_facet_response.rb +211 -0
- data/lib/alfresco/models/generic_metric.rb +199 -0
- data/lib/alfresco/models/node.rb +403 -0
- data/lib/alfresco/models/pagination.rb +249 -0
- data/lib/alfresco/models/path_element.rb +197 -0
- data/lib/alfresco/models/path_info.rb +208 -0
- data/lib/alfresco/models/request_defaults.rb +283 -0
- data/lib/alfresco/models/request_facet_field.rb +333 -0
- data/lib/alfresco/models/request_facet_fields.rb +191 -0
- data/lib/alfresco/models/request_facet_intervals.rb +203 -0
- data/lib/alfresco/models/request_facet_intervals_intervals.rb +211 -0
- data/lib/alfresco/models/request_facet_queries.rb +179 -0
- data/lib/alfresco/models/request_facet_queries_inner.rb +199 -0
- data/lib/alfresco/models/request_facet_set.rb +233 -0
- data/lib/alfresco/models/request_fields.rb +179 -0
- data/lib/alfresco/models/request_filter_queries.rb +179 -0
- data/lib/alfresco/models/request_filter_queries_inner.rb +201 -0
- data/lib/alfresco/models/request_highlight.rb +261 -0
- data/lib/alfresco/models/request_highlight_fields.rb +234 -0
- data/lib/alfresco/models/request_include.rb +179 -0
- data/lib/alfresco/models/request_limits.rb +199 -0
- data/lib/alfresco/models/request_localization.rb +201 -0
- data/lib/alfresco/models/request_pagination.rb +231 -0
- data/lib/alfresco/models/request_pivot.rb +200 -0
- data/lib/alfresco/models/request_query.rb +249 -0
- data/lib/alfresco/models/request_range.rb +275 -0
- data/lib/alfresco/models/request_scope.rb +222 -0
- data/lib/alfresco/models/request_sort_definition.rb +179 -0
- data/lib/alfresco/models/request_sort_definition_inner.rb +246 -0
- data/lib/alfresco/models/request_spellcheck.rb +188 -0
- data/lib/alfresco/models/request_stats.rb +367 -0
- data/lib/alfresco/models/request_templates.rb +179 -0
- data/lib/alfresco/models/request_templates_inner.rb +199 -0
- data/lib/alfresco/models/response_consistency.rb +189 -0
- data/lib/alfresco/models/result_buckets.rb +201 -0
- data/lib/alfresco/models/result_buckets_buckets.rb +219 -0
- data/lib/alfresco/models/result_node.rb +448 -0
- data/lib/alfresco/models/result_set_context.rb +245 -0
- data/lib/alfresco/models/result_set_context_facet_queries.rb +207 -0
- data/lib/alfresco/models/result_set_context_spellcheck.rb +233 -0
- data/lib/alfresco/models/result_set_paging.rb +188 -0
- data/lib/alfresco/models/result_set_paging_list.rb +208 -0
- data/lib/alfresco/models/result_set_row_entry.rb +193 -0
- data/lib/alfresco/models/search_entry.rb +201 -0
- data/lib/alfresco/models/search_entry_highlight.rb +201 -0
- data/lib/alfresco/models/search_request.rb +373 -0
- data/lib/alfresco/models/user_info.rb +207 -0
- data/lib/alfresco/version.rb +15 -0
- data/spec/api/search_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +39 -0
- data/spec/models/content_info_spec.rb +66 -0
- data/spec/models/error_error_spec.rb +72 -0
- data/spec/models/error_spec.rb +42 -0
- data/spec/models/generic_bucket_bucket_info_spec.rb +60 -0
- data/spec/models/generic_bucket_spec.rb +72 -0
- data/spec/models/generic_facet_response_spec.rb +54 -0
- data/spec/models/generic_metric_spec.rb +48 -0
- data/spec/models/node_spec.rb +138 -0
- data/spec/models/pagination_spec.rb +66 -0
- data/spec/models/path_element_spec.rb +48 -0
- data/spec/models/path_info_spec.rb +54 -0
- data/spec/models/request_defaults_spec.rb +74 -0
- data/spec/models/request_facet_field_spec.rb +110 -0
- data/spec/models/request_facet_fields_spec.rb +42 -0
- data/spec/models/request_facet_intervals_intervals_spec.rb +54 -0
- data/spec/models/request_facet_intervals_spec.rb +48 -0
- data/spec/models/request_facet_queries_inner_spec.rb +48 -0
- data/spec/models/request_facet_queries_spec.rb +36 -0
- data/spec/models/request_facet_set_spec.rb +66 -0
- data/spec/models/request_fields_spec.rb +36 -0
- data/spec/models/request_filter_queries_inner_spec.rb +48 -0
- data/spec/models/request_filter_queries_spec.rb +36 -0
- data/spec/models/request_highlight_fields_spec.rb +72 -0
- data/spec/models/request_highlight_spec.rb +84 -0
- data/spec/models/request_include_spec.rb +36 -0
- data/spec/models/request_limits_spec.rb +48 -0
- data/spec/models/request_localization_spec.rb +48 -0
- data/spec/models/request_pagination_spec.rb +48 -0
- data/spec/models/request_pivot_spec.rb +48 -0
- data/spec/models/request_query_spec.rb +58 -0
- data/spec/models/request_range_spec.rb +90 -0
- data/spec/models/request_scope_spec.rb +46 -0
- data/spec/models/request_sort_definition_inner_spec.rb +58 -0
- data/spec/models/request_sort_definition_spec.rb +36 -0
- data/spec/models/request_spellcheck_spec.rb +42 -0
- data/spec/models/request_stats_spec.rb +132 -0
- data/spec/models/request_templates_inner_spec.rb +48 -0
- data/spec/models/request_templates_spec.rb +36 -0
- data/spec/models/response_consistency_spec.rb +42 -0
- data/spec/models/result_buckets_buckets_spec.rb +60 -0
- data/spec/models/result_buckets_spec.rb +48 -0
- data/spec/models/result_node_spec.rb +168 -0
- data/spec/models/result_set_context_facet_queries_spec.rb +54 -0
- data/spec/models/result_set_context_spec.rb +72 -0
- data/spec/models/result_set_context_spellcheck_spec.rb +52 -0
- data/spec/models/result_set_paging_list_spec.rb +54 -0
- data/spec/models/result_set_paging_spec.rb +42 -0
- data/spec/models/result_set_row_entry_spec.rb +42 -0
- data/spec/models/search_entry_highlight_spec.rb +48 -0
- data/spec/models/search_entry_spec.rb +48 -0
- data/spec/models/search_request_spec.rb +156 -0
- data/spec/models/user_info_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +455 -0
@@ -0,0 +1,188 @@
|
|
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
|
+
# Request that spellcheck fragments to be added to result set rows The properties reflect SOLR spellcheck parameters.
|
17
|
+
class RequestSpellcheck
|
18
|
+
attr_accessor :query
|
19
|
+
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'query' => :'query'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.swagger_types
|
30
|
+
{
|
31
|
+
:'query' => :'String'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Initializes the object
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
37
|
+
def initialize(attributes = {})
|
38
|
+
return unless attributes.is_a?(Hash)
|
39
|
+
|
40
|
+
# convert string to symbol for hash key
|
41
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
42
|
+
|
43
|
+
if attributes.has_key?(:'query')
|
44
|
+
self.query = attributes[:'query']
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
50
|
+
# @return Array for valid properies with the reasons
|
51
|
+
def list_invalid_properties
|
52
|
+
invalid_properties = Array.new
|
53
|
+
return invalid_properties
|
54
|
+
end
|
55
|
+
|
56
|
+
# Check to see if the all the properties in the model are valid
|
57
|
+
# @return true if the model is valid
|
58
|
+
def valid?
|
59
|
+
return true
|
60
|
+
end
|
61
|
+
|
62
|
+
# Checks equality by comparing each attribute.
|
63
|
+
# @param [Object] Object to be compared
|
64
|
+
def ==(o)
|
65
|
+
return true if self.equal?(o)
|
66
|
+
self.class == o.class &&
|
67
|
+
query == o.query
|
68
|
+
end
|
69
|
+
|
70
|
+
# @see the `==` method
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def eql?(o)
|
73
|
+
self == o
|
74
|
+
end
|
75
|
+
|
76
|
+
# Calculates hash code according to all attributes.
|
77
|
+
# @return [Fixnum] Hash code
|
78
|
+
def hash
|
79
|
+
[query].hash
|
80
|
+
end
|
81
|
+
|
82
|
+
# Builds the object from hash
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
# @return [Object] Returns the model itself
|
85
|
+
def build_from_hash(attributes)
|
86
|
+
return nil unless attributes.is_a?(Hash)
|
87
|
+
self.class.swagger_types.each_pair do |key, type|
|
88
|
+
if type =~ /\AArray<(.*)>/i
|
89
|
+
# check to ensure the input is an array given that the the attribute
|
90
|
+
# is documented as an array but the input is not
|
91
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
92
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
93
|
+
end
|
94
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
95
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
96
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
97
|
+
end
|
98
|
+
|
99
|
+
self
|
100
|
+
end
|
101
|
+
|
102
|
+
# Deserializes the data based on type
|
103
|
+
# @param string type Data type
|
104
|
+
# @param string value Value to be deserialized
|
105
|
+
# @return [Object] Deserialized data
|
106
|
+
def _deserialize(type, value)
|
107
|
+
case type.to_sym
|
108
|
+
when :DateTime
|
109
|
+
DateTime.parse(value)
|
110
|
+
when :Date
|
111
|
+
Date.parse(value)
|
112
|
+
when :String
|
113
|
+
value.to_s
|
114
|
+
when :Integer
|
115
|
+
value.to_i
|
116
|
+
when :Float
|
117
|
+
value.to_f
|
118
|
+
when :BOOLEAN
|
119
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
120
|
+
true
|
121
|
+
else
|
122
|
+
false
|
123
|
+
end
|
124
|
+
when :Object
|
125
|
+
# generic object (usually a Hash), return directly
|
126
|
+
value
|
127
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
128
|
+
inner_type = Regexp.last_match[:inner_type]
|
129
|
+
value.map { |v| _deserialize(inner_type, v) }
|
130
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
131
|
+
k_type = Regexp.last_match[:k_type]
|
132
|
+
v_type = Regexp.last_match[:v_type]
|
133
|
+
{}.tap do |hash|
|
134
|
+
value.each do |k, v|
|
135
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
else # model
|
139
|
+
temp_model = Alfresco.const_get(type).new
|
140
|
+
temp_model.build_from_hash(value)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Returns the string representation of the object
|
145
|
+
# @return [String] String presentation of the object
|
146
|
+
def to_s
|
147
|
+
to_hash.to_s
|
148
|
+
end
|
149
|
+
|
150
|
+
# to_body is an alias to to_hash (backward compatibility)
|
151
|
+
# @return [Hash] Returns the object in the form of hash
|
152
|
+
def to_body
|
153
|
+
to_hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the object in the form of hash
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
158
|
+
def to_hash
|
159
|
+
hash = {}
|
160
|
+
self.class.attribute_map.each_pair do |attr, param|
|
161
|
+
value = self.send(attr)
|
162
|
+
next if value.nil?
|
163
|
+
hash[param] = _to_hash(value)
|
164
|
+
end
|
165
|
+
hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Outputs non-array value in the form of hash
|
169
|
+
# For object, use to_hash. Otherwise, just return the value
|
170
|
+
# @param [Object] value Any valid value
|
171
|
+
# @return [Hash] Returns the value in the form of hash
|
172
|
+
def _to_hash(value)
|
173
|
+
if value.is_a?(Array)
|
174
|
+
value.compact.map{ |v| _to_hash(v) }
|
175
|
+
elsif value.is_a?(Hash)
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
178
|
+
end
|
179
|
+
elsif value.respond_to? :to_hash
|
180
|
+
value.to_hash
|
181
|
+
else
|
182
|
+
value
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
@@ -0,0 +1,367 @@
|
|
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
|
+
# A list of stats request.
|
17
|
+
class RequestStats
|
18
|
+
# The stats field
|
19
|
+
attr_accessor :field
|
20
|
+
|
21
|
+
# A label to include for reference the stats field
|
22
|
+
attr_accessor :label
|
23
|
+
|
24
|
+
# The minimum value of the field
|
25
|
+
attr_accessor :min
|
26
|
+
|
27
|
+
# The maximum value of the field
|
28
|
+
attr_accessor :max
|
29
|
+
|
30
|
+
# The sum of all values of the field
|
31
|
+
attr_accessor :sum
|
32
|
+
|
33
|
+
# The number which have a value for this field
|
34
|
+
attr_accessor :count_values
|
35
|
+
|
36
|
+
# The number which do not have a value for this field
|
37
|
+
attr_accessor :missing
|
38
|
+
|
39
|
+
# The average
|
40
|
+
attr_accessor :mean
|
41
|
+
|
42
|
+
# Standard deviation
|
43
|
+
attr_accessor :stddev
|
44
|
+
|
45
|
+
# Sum of all values squared
|
46
|
+
attr_accessor :sum_of_squares
|
47
|
+
|
48
|
+
# The set of all distinct values for the field (This can be very expensive to calculate)
|
49
|
+
attr_accessor :distinct_values
|
50
|
+
|
51
|
+
# The number of distinct values (This can be very expensive to calculate)
|
52
|
+
attr_accessor :count_distinct
|
53
|
+
|
54
|
+
# A statistical approximation of the number of distinct values
|
55
|
+
attr_accessor :cardinality
|
56
|
+
|
57
|
+
# Number between 0.0 and 1.0 indicating how aggressively the algorithm should try to be accurate. Used with boolean cardinality flag.
|
58
|
+
attr_accessor :cardinality_accuracy
|
59
|
+
|
60
|
+
# A list of filters to exclude
|
61
|
+
attr_accessor :exclude_filters
|
62
|
+
|
63
|
+
# A list of percentile values, e.g. \"1,99,99.9\"
|
64
|
+
attr_accessor :percentiles
|
65
|
+
|
66
|
+
|
67
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
68
|
+
def self.attribute_map
|
69
|
+
{
|
70
|
+
:'field' => :'field',
|
71
|
+
:'label' => :'label',
|
72
|
+
:'min' => :'min',
|
73
|
+
:'max' => :'max',
|
74
|
+
:'sum' => :'sum',
|
75
|
+
:'count_values' => :'countValues',
|
76
|
+
:'missing' => :'missing',
|
77
|
+
:'mean' => :'mean',
|
78
|
+
:'stddev' => :'stddev',
|
79
|
+
:'sum_of_squares' => :'sumOfSquares',
|
80
|
+
:'distinct_values' => :'distinctValues',
|
81
|
+
:'count_distinct' => :'countDistinct',
|
82
|
+
:'cardinality' => :'cardinality',
|
83
|
+
:'cardinality_accuracy' => :'cardinalityAccuracy',
|
84
|
+
:'exclude_filters' => :'excludeFilters',
|
85
|
+
:'percentiles' => :'percentiles'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# Attribute type mapping.
|
90
|
+
def self.swagger_types
|
91
|
+
{
|
92
|
+
:'field' => :'String',
|
93
|
+
:'label' => :'String',
|
94
|
+
:'min' => :'BOOLEAN',
|
95
|
+
:'max' => :'BOOLEAN',
|
96
|
+
:'sum' => :'BOOLEAN',
|
97
|
+
:'count_values' => :'BOOLEAN',
|
98
|
+
:'missing' => :'BOOLEAN',
|
99
|
+
:'mean' => :'BOOLEAN',
|
100
|
+
:'stddev' => :'BOOLEAN',
|
101
|
+
:'sum_of_squares' => :'BOOLEAN',
|
102
|
+
:'distinct_values' => :'BOOLEAN',
|
103
|
+
:'count_distinct' => :'BOOLEAN',
|
104
|
+
:'cardinality' => :'BOOLEAN',
|
105
|
+
:'cardinality_accuracy' => :'Float',
|
106
|
+
:'exclude_filters' => :'Array<String>',
|
107
|
+
:'percentiles' => :'Array<Float>'
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
# Initializes the object
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
def initialize(attributes = {})
|
114
|
+
return unless attributes.is_a?(Hash)
|
115
|
+
|
116
|
+
# convert string to symbol for hash key
|
117
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
118
|
+
|
119
|
+
if attributes.has_key?(:'field')
|
120
|
+
self.field = attributes[:'field']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.has_key?(:'label')
|
124
|
+
self.label = attributes[:'label']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'min')
|
128
|
+
self.min = attributes[:'min']
|
129
|
+
else
|
130
|
+
self.min = true
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'max')
|
134
|
+
self.max = attributes[:'max']
|
135
|
+
else
|
136
|
+
self.max = true
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'sum')
|
140
|
+
self.sum = attributes[:'sum']
|
141
|
+
else
|
142
|
+
self.sum = true
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'countValues')
|
146
|
+
self.count_values = attributes[:'countValues']
|
147
|
+
else
|
148
|
+
self.count_values = true
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.has_key?(:'missing')
|
152
|
+
self.missing = attributes[:'missing']
|
153
|
+
else
|
154
|
+
self.missing = true
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'mean')
|
158
|
+
self.mean = attributes[:'mean']
|
159
|
+
else
|
160
|
+
self.mean = true
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.has_key?(:'stddev')
|
164
|
+
self.stddev = attributes[:'stddev']
|
165
|
+
else
|
166
|
+
self.stddev = true
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.has_key?(:'sumOfSquares')
|
170
|
+
self.sum_of_squares = attributes[:'sumOfSquares']
|
171
|
+
else
|
172
|
+
self.sum_of_squares = true
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.has_key?(:'distinctValues')
|
176
|
+
self.distinct_values = attributes[:'distinctValues']
|
177
|
+
else
|
178
|
+
self.distinct_values = false
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.has_key?(:'countDistinct')
|
182
|
+
self.count_distinct = attributes[:'countDistinct']
|
183
|
+
else
|
184
|
+
self.count_distinct = false
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.has_key?(:'cardinality')
|
188
|
+
self.cardinality = attributes[:'cardinality']
|
189
|
+
else
|
190
|
+
self.cardinality = false
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.has_key?(:'cardinalityAccuracy')
|
194
|
+
self.cardinality_accuracy = attributes[:'cardinalityAccuracy']
|
195
|
+
else
|
196
|
+
self.cardinality_accuracy = 0.3
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.has_key?(:'excludeFilters')
|
200
|
+
if (value = attributes[:'excludeFilters']).is_a?(Array)
|
201
|
+
self.exclude_filters = value
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.has_key?(:'percentiles')
|
206
|
+
if (value = attributes[:'percentiles']).is_a?(Array)
|
207
|
+
self.percentiles = value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
end
|
212
|
+
|
213
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
214
|
+
# @return Array for valid properies with the reasons
|
215
|
+
def list_invalid_properties
|
216
|
+
invalid_properties = Array.new
|
217
|
+
return invalid_properties
|
218
|
+
end
|
219
|
+
|
220
|
+
# Check to see if the all the properties in the model are valid
|
221
|
+
# @return true if the model is valid
|
222
|
+
def valid?
|
223
|
+
return true
|
224
|
+
end
|
225
|
+
|
226
|
+
# Checks equality by comparing each attribute.
|
227
|
+
# @param [Object] Object to be compared
|
228
|
+
def ==(o)
|
229
|
+
return true if self.equal?(o)
|
230
|
+
self.class == o.class &&
|
231
|
+
field == o.field &&
|
232
|
+
label == o.label &&
|
233
|
+
min == o.min &&
|
234
|
+
max == o.max &&
|
235
|
+
sum == o.sum &&
|
236
|
+
count_values == o.count_values &&
|
237
|
+
missing == o.missing &&
|
238
|
+
mean == o.mean &&
|
239
|
+
stddev == o.stddev &&
|
240
|
+
sum_of_squares == o.sum_of_squares &&
|
241
|
+
distinct_values == o.distinct_values &&
|
242
|
+
count_distinct == o.count_distinct &&
|
243
|
+
cardinality == o.cardinality &&
|
244
|
+
cardinality_accuracy == o.cardinality_accuracy &&
|
245
|
+
exclude_filters == o.exclude_filters &&
|
246
|
+
percentiles == o.percentiles
|
247
|
+
end
|
248
|
+
|
249
|
+
# @see the `==` method
|
250
|
+
# @param [Object] Object to be compared
|
251
|
+
def eql?(o)
|
252
|
+
self == o
|
253
|
+
end
|
254
|
+
|
255
|
+
# Calculates hash code according to all attributes.
|
256
|
+
# @return [Fixnum] Hash code
|
257
|
+
def hash
|
258
|
+
[field, label, min, max, sum, count_values, missing, mean, stddev, sum_of_squares, distinct_values, count_distinct, cardinality, cardinality_accuracy, exclude_filters, percentiles].hash
|
259
|
+
end
|
260
|
+
|
261
|
+
# Builds the object from hash
|
262
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
263
|
+
# @return [Object] Returns the model itself
|
264
|
+
def build_from_hash(attributes)
|
265
|
+
return nil unless attributes.is_a?(Hash)
|
266
|
+
self.class.swagger_types.each_pair do |key, type|
|
267
|
+
if type =~ /\AArray<(.*)>/i
|
268
|
+
# check to ensure the input is an array given that the the attribute
|
269
|
+
# is documented as an array but the input is not
|
270
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
271
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
272
|
+
end
|
273
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
274
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
275
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
276
|
+
end
|
277
|
+
|
278
|
+
self
|
279
|
+
end
|
280
|
+
|
281
|
+
# Deserializes the data based on type
|
282
|
+
# @param string type Data type
|
283
|
+
# @param string value Value to be deserialized
|
284
|
+
# @return [Object] Deserialized data
|
285
|
+
def _deserialize(type, value)
|
286
|
+
case type.to_sym
|
287
|
+
when :DateTime
|
288
|
+
DateTime.parse(value)
|
289
|
+
when :Date
|
290
|
+
Date.parse(value)
|
291
|
+
when :String
|
292
|
+
value.to_s
|
293
|
+
when :Integer
|
294
|
+
value.to_i
|
295
|
+
when :Float
|
296
|
+
value.to_f
|
297
|
+
when :BOOLEAN
|
298
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
299
|
+
true
|
300
|
+
else
|
301
|
+
false
|
302
|
+
end
|
303
|
+
when :Object
|
304
|
+
# generic object (usually a Hash), return directly
|
305
|
+
value
|
306
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
307
|
+
inner_type = Regexp.last_match[:inner_type]
|
308
|
+
value.map { |v| _deserialize(inner_type, v) }
|
309
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
310
|
+
k_type = Regexp.last_match[:k_type]
|
311
|
+
v_type = Regexp.last_match[:v_type]
|
312
|
+
{}.tap do |hash|
|
313
|
+
value.each do |k, v|
|
314
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
else # model
|
318
|
+
temp_model = Alfresco.const_get(type).new
|
319
|
+
temp_model.build_from_hash(value)
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
# Returns the string representation of the object
|
324
|
+
# @return [String] String presentation of the object
|
325
|
+
def to_s
|
326
|
+
to_hash.to_s
|
327
|
+
end
|
328
|
+
|
329
|
+
# to_body is an alias to to_hash (backward compatibility)
|
330
|
+
# @return [Hash] Returns the object in the form of hash
|
331
|
+
def to_body
|
332
|
+
to_hash
|
333
|
+
end
|
334
|
+
|
335
|
+
# Returns the object in the form of hash
|
336
|
+
# @return [Hash] Returns the object in the form of hash
|
337
|
+
def to_hash
|
338
|
+
hash = {}
|
339
|
+
self.class.attribute_map.each_pair do |attr, param|
|
340
|
+
value = self.send(attr)
|
341
|
+
next if value.nil?
|
342
|
+
hash[param] = _to_hash(value)
|
343
|
+
end
|
344
|
+
hash
|
345
|
+
end
|
346
|
+
|
347
|
+
# Outputs non-array value in the form of hash
|
348
|
+
# For object, use to_hash. Otherwise, just return the value
|
349
|
+
# @param [Object] value Any valid value
|
350
|
+
# @return [Hash] Returns the value in the form of hash
|
351
|
+
def _to_hash(value)
|
352
|
+
if value.is_a?(Array)
|
353
|
+
value.compact.map{ |v| _to_hash(v) }
|
354
|
+
elsif value.is_a?(Hash)
|
355
|
+
{}.tap do |hash|
|
356
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
357
|
+
end
|
358
|
+
elsif value.respond_to? :to_hash
|
359
|
+
value.to_hash
|
360
|
+
else
|
361
|
+
value
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
end
|
366
|
+
|
367
|
+
end
|