Class: PureCloud::ConversationQueryResponse
- Inherits:
-
Object
- Object
- PureCloud::ConversationQueryResponse
- Defined in:
- lib/purecloud/models/conversation_query_response.rb
Instance Attribute Summary collapse
-
#anchor ⇒ Object
Date time is represented as an ISO-8601 string.
-
#end_query_time ⇒ Object
Date time is represented as an ISO-8601 string.
-
#entities ⇒ Object
Returns the value of attribute entities.
-
#facets ⇒ Object
Returns the value of attribute facets.
-
#first_uri ⇒ Object
Returns the value of attribute first_uri.
-
#has_more_next ⇒ Object
Returns the value of attribute has_more_next.
-
#has_more_prev ⇒ Object
Returns the value of attribute has_more_prev.
-
#iterations ⇒ Object
Returns the value of attribute iterations.
-
#last_uri ⇒ Object
Returns the value of attribute last_uri.
-
#newest_result_time ⇒ Object
Date time is represented as an ISO-8601 string.
-
#next_uri ⇒ Object
Returns the value of attribute next_uri.
-
#oldest_result_time ⇒ Object
Date time is represented as an ISO-8601 string.
-
#page_count ⇒ Object
Returns the value of attribute page_count.
-
#page_number ⇒ Object
Returns the value of attribute page_number.
-
#page_size ⇒ Object
Returns the value of attribute page_size.
-
#previous_uri ⇒ Object
Returns the value of attribute previous_uri.
-
#self_uri ⇒ Object
Returns the value of attribute self_uri.
-
#sort ⇒ Object
Returns the value of attribute sort.
-
#start_query_time ⇒ Object
Date time is represented as an ISO-8601 string.
-
#time_ms ⇒ Object
Returns the value of attribute time_ms.
-
#total ⇒ Object
Returns the value of attribute total.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Check equality by comparing each attribute.
- #_deserialize(type, value) ⇒ Object
-
#_to_hash(value) ⇒ Object
Method to output non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
build the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Object
Calculate hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ConversationQueryResponse
constructor
A new instance of ConversationQueryResponse.
-
#to_body ⇒ Object
to_body is an alias to to_body (backward compatibility)).
-
#to_hash ⇒ Object
return the object in the form of hash.
- #to_s ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ ConversationQueryResponse
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 129 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} if attributes[:'pageSize'] self.page_size = attributes[:'pageSize'] end if attributes[:'pageNumber'] self.page_number = attributes[:'pageNumber'] end if attributes[:'total'] self.total = attributes[:'total'] end if attributes[:'entities'] if (value = attributes[:'entities']).is_a?(Array) self.entities = value end end if attributes[:'hasMorePrev'] self.has_more_prev = attributes[:'hasMorePrev'] else self.has_more_prev = false end if attributes[:'hasMoreNext'] self.has_more_next = attributes[:'hasMoreNext'] else self.has_more_next = false end if attributes[:'startQueryTime'] self.start_query_time = attributes[:'startQueryTime'] end if attributes[:'endQueryTime'] self.end_query_time = attributes[:'endQueryTime'] end if attributes[:'newestResultTime'] self.newest_result_time = attributes[:'newestResultTime'] end if attributes[:'oldestResultTime'] self.oldest_result_time = attributes[:'oldestResultTime'] end if attributes[:'timeMs'] self.time_ms = attributes[:'timeMs'] end if attributes[:'iterations'] self.iterations = attributes[:'iterations'] end if attributes[:'anchor'] self.anchor = attributes[:'anchor'] end if attributes[:'sort'] self.sort = attributes[:'sort'] end if attributes[:'facets'] self.facets = attributes[:'facets'] end if attributes[:'selfUri'] self.self_uri = attributes[:'selfUri'] end if attributes[:'firstUri'] self.first_uri = attributes[:'firstUri'] end if attributes[:'previousUri'] self.previous_uri = attributes[:'previousUri'] end if attributes[:'nextUri'] self.next_uri = attributes[:'nextUri'] end if attributes[:'lastUri'] self.last_uri = attributes[:'lastUri'] end if attributes[:'pageCount'] self.page_count = attributes[:'pageCount'] end end |
Instance Attribute Details
#anchor ⇒ Object
Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
34 35 36 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 34 def anchor @anchor end |
#end_query_time ⇒ Object
Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
21 22 23 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 21 def end_query_time @end_query_time end |
#entities ⇒ Object
Returns the value of attribute entities.
11 12 13 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 11 def entities @entities end |
#facets ⇒ Object
Returns the value of attribute facets.
38 39 40 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 38 def facets @facets end |
#first_uri ⇒ Object
Returns the value of attribute first_uri.
42 43 44 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 42 def first_uri @first_uri end |
#has_more_next ⇒ Object
Returns the value of attribute has_more_next.
15 16 17 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 15 def has_more_next @has_more_next end |
#has_more_prev ⇒ Object
Returns the value of attribute has_more_prev.
13 14 15 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 13 def has_more_prev @has_more_prev end |
#iterations ⇒ Object
Returns the value of attribute iterations.
31 32 33 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 31 def iterations @iterations end |
#last_uri ⇒ Object
Returns the value of attribute last_uri.
48 49 50 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 48 def last_uri @last_uri end |
#newest_result_time ⇒ Object
Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
24 25 26 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 24 def newest_result_time @newest_result_time end |
#next_uri ⇒ Object
Returns the value of attribute next_uri.
46 47 48 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 46 def next_uri @next_uri end |
#oldest_result_time ⇒ Object
Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
27 28 29 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 27 def oldest_result_time @oldest_result_time end |
#page_count ⇒ Object
Returns the value of attribute page_count.
50 51 52 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 50 def page_count @page_count end |
#page_number ⇒ Object
Returns the value of attribute page_number.
7 8 9 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 7 def page_number @page_number end |
#page_size ⇒ Object
Returns the value of attribute page_size.
5 6 7 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 5 def page_size @page_size end |
#previous_uri ⇒ Object
Returns the value of attribute previous_uri.
44 45 46 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 44 def previous_uri @previous_uri end |
#self_uri ⇒ Object
Returns the value of attribute self_uri.
40 41 42 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 40 def self_uri @self_uri end |
#sort ⇒ Object
Returns the value of attribute sort.
36 37 38 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 36 def sort @sort end |
#start_query_time ⇒ Object
Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
18 19 20 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 18 def start_query_time @start_query_time end |
#time_ms ⇒ Object
Returns the value of attribute time_ms.
29 30 31 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 29 def time_ms @time_ms end |
#total ⇒ Object
Returns the value of attribute total.
9 10 11 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 9 def total @total end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 53 def self.attribute_map { :'page_size' => :'pageSize', :'page_number' => :'pageNumber', :'total' => :'total', :'entities' => :'entities', :'has_more_prev' => :'hasMorePrev', :'has_more_next' => :'hasMoreNext', :'start_query_time' => :'startQueryTime', :'end_query_time' => :'endQueryTime', :'newest_result_time' => :'newestResultTime', :'oldest_result_time' => :'oldestResultTime', :'time_ms' => :'timeMs', :'iterations' => :'iterations', :'anchor' => :'anchor', :'sort' => :'sort', :'facets' => :'facets', :'self_uri' => :'selfUri', :'first_uri' => :'firstUri', :'previous_uri' => :'previousUri', :'next_uri' => :'nextUri', :'last_uri' => :'lastUri', :'page_count' => :'pageCount' } end |
.swagger_types ⇒ Object
Attribute type mapping.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 102 def self.swagger_types { :'page_size' => :'Integer', :'page_number' => :'Integer', :'total' => :'Integer', :'entities' => :'Array<Conversation>', :'has_more_prev' => :'BOOLEAN', :'has_more_next' => :'BOOLEAN', :'start_query_time' => :'DateTime', :'end_query_time' => :'DateTime', :'newest_result_time' => :'DateTime', :'oldest_result_time' => :'DateTime', :'time_ms' => :'Integer', :'iterations' => :'Integer', :'anchor' => :'DateTime', :'sort' => :'String', :'facets' => :'Facets', :'self_uri' => :'String', :'first_uri' => :'String', :'previous_uri' => :'String', :'next_uri' => :'String', :'last_uri' => :'String', :'page_count' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Check equality by comparing each attribute.
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 238 def ==(o) return true if self.equal?(o) self.class == o.class && page_size == o.page_size && page_number == o.page_number && total == o.total && entities == o.entities && has_more_prev == o.has_more_prev && has_more_next == o.has_more_next && start_query_time == o.start_query_time && end_query_time == o.end_query_time && newest_result_time == o.newest_result_time && oldest_result_time == o.oldest_result_time && time_ms == o.time_ms && iterations == o.iterations && anchor == o.anchor && sort == o.sort && facets == o.facets && self_uri == o.self_uri && first_uri == o.first_uri && previous_uri == o.previous_uri && next_uri == o.next_uri && last_uri == o.last_uri && page_count == o.page_count end |
#_deserialize(type, value) ⇒ Object
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 294 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value =~ /^(true|t|yes|y|1)$/i true else false end when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model _model = Object.const_get("PureCloud").const_get(type).new _model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Object
Method to output non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 351 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
build the object from hash
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 275 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) else #TODO show warning in debug mode end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) else # data not found in attributes(hash), not an issue as the data can be optional end end self end |
#eql?(o) ⇒ Boolean
265 266 267 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 265 def eql?(o) self == o end |
#hash ⇒ Object
Calculate hash code according to all attributes.
270 271 272 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 270 def hash [page_size, page_number, total, entities, has_more_prev, has_more_next, start_query_time, end_query_time, newest_result_time, oldest_result_time, time_ms, iterations, anchor, sort, facets, self_uri, first_uri, previous_uri, next_uri, last_uri, page_count].hash end |
#to_body ⇒ Object
to_body is an alias to to_body (backward compatibility))
334 335 336 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 334 def to_body to_hash end |
#to_hash ⇒ Object
return the object in the form of hash
339 340 341 342 343 344 345 346 347 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 339 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ Object
329 330 331 |
# File 'lib/purecloud/models/conversation_query_response.rb', line 329 def to_s to_hash.to_s end |