purecloud 0.40.1 → 0.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/config-ruby.json +1 -1
  4. data/doc_out/AdditionalInfo.html.md +12 -0
  5. data/doc_out/{Entity.html.md → AuthzPerm.html.md} +3 -5
  6. data/doc_out/AuthzPermissionContext.html.md +1 -1
  7. data/doc_out/CallableTimeSet.html.md +1 -1
  8. data/doc_out/Callback.html.md +1 -0
  9. data/doc_out/CallbackIdentifier.html.md +14 -0
  10. data/doc_out/CallbackMediaParticipant.html.md +1 -0
  11. data/doc_out/ContentManagementApi.html.md +51 -0
  12. data/doc_out/ConversationsApi.html.md +120 -0
  13. data/doc_out/CreateCallbackCommand.html.md +2 -0
  14. data/doc_out/CreateCallbackResponse.html.md +14 -0
  15. data/doc_out/Dependency.html.md +1 -0
  16. data/doc_out/DependencyObject.html.md +1 -0
  17. data/doc_out/DomainEdgeSoftwareVersionDto.html.md +1 -1
  18. data/doc_out/GroupSearchCriteria.html.md +20 -0
  19. data/doc_out/GroupSearchRequest.html.md +19 -0
  20. data/doc_out/GroupsApi.html.md +2 -2
  21. data/doc_out/GroupsSearchResponse.html.md +1 -0
  22. data/doc_out/Integration.html.md +20 -0
  23. data/doc_out/IntegrationConfiguration.html.md +20 -0
  24. data/doc_out/{DeletedResourceConsumerEntityListing.html.md → IntegrationEntityListing.html.md} +3 -3
  25. data/doc_out/IntegrationStatusInfo.html.md +16 -0
  26. data/doc_out/IntegrationType.html.md +5 -3
  27. data/doc_out/JsonNode.html.md +1 -1
  28. data/doc_out/JsonNodeSearchResponse.html.md +1 -0
  29. data/doc_out/LocationSearchCriteria.html.md +20 -0
  30. data/doc_out/LocationSearchRequest.html.md +19 -0
  31. data/doc_out/LocationsApi.html.md +6 -6
  32. data/doc_out/LocationsSearchResponse.html.md +22 -0
  33. data/doc_out/NumberOrder.html.md +27 -0
  34. data/doc_out/PortBillingAddress.html.md +17 -0
  35. data/doc_out/PortContact.html.md +14 -0
  36. data/doc_out/PresenceApi.html.md +1 -1
  37. data/doc_out/QualityAudit.html.md +1 -1
  38. data/doc_out/RecordingApi.html.md +4 -2
  39. data/doc_out/ResponseSet.html.md +1 -1
  40. data/doc_out/RoutingData.html.md +17 -0
  41. data/doc_out/RuleSet.html.md +1 -1
  42. data/doc_out/SearchAggregation.html.md +3 -0
  43. data/doc_out/SearchApi.html.md +12 -12
  44. data/doc_out/SearchCriteria.html.md +1 -1
  45. data/doc_out/SearchRequest.html.md +3 -3
  46. data/doc_out/SuggestApi.html.md +2 -2
  47. data/doc_out/SuggestSearchCriteria.html.md +19 -0
  48. data/doc_out/SuggestSearchRequest.html.md +14 -0
  49. data/doc_out/Usage.html.md +13 -0
  50. data/doc_out/UsageItem.html.md +15 -0
  51. data/doc_out/UserSearchCriteria.html.md +20 -0
  52. data/doc_out/UserSearchRequest.html.md +19 -0
  53. data/doc_out/UsersApi.html.md +2 -120
  54. data/doc_out/UsersSearchResponse.html.md +1 -0
  55. data/doc_out/VoicemailMessageEntityListing.html.md +0 -7
  56. data/doc_out/Workspace.html.md +1 -0
  57. data/doc_out/WorkspaceCreate.html.md +1 -0
  58. data/doc_out/WorkspaceSummary.html.md +1 -0
  59. data/doc_out/index.html.md +3 -3
  60. data/lib/purecloud/api/content_management_api.rb +55 -0
  61. data/lib/purecloud/api/conversations_api.rb +121 -0
  62. data/lib/purecloud/api/groups_api.rb +6 -6
  63. data/lib/purecloud/api/languages_api.rb +2 -2
  64. data/lib/purecloud/api/locations_api.rb +8 -8
  65. data/lib/purecloud/api/presence_api.rb +2 -2
  66. data/lib/purecloud/api/recording_api.rb +5 -2
  67. data/lib/purecloud/api/routing_api.rb +2 -2
  68. data/lib/purecloud/api/search_api.rb +14 -14
  69. data/lib/purecloud/api/suggest_api.rb +2 -2
  70. data/lib/purecloud/api/users_api.rb +6 -128
  71. data/lib/purecloud/api_client.rb +1 -1
  72. data/lib/purecloud/models/additional_info.rb +155 -0
  73. data/lib/purecloud/models/authz_perm.rb +177 -0
  74. data/lib/purecloud/models/authz_permission_context.rb +7 -7
  75. data/lib/purecloud/models/callback.rb +15 -4
  76. data/lib/purecloud/models/{entity.rb → callback_identifier.rb} +15 -24
  77. data/lib/purecloud/models/callback_media_participant.rb +15 -4
  78. data/lib/purecloud/models/contact.rb +1 -1
  79. data/lib/purecloud/models/create_callback_command.rb +24 -4
  80. data/lib/purecloud/models/create_callback_response.rb +179 -0
  81. data/lib/purecloud/models/dependency.rb +13 -1
  82. data/lib/purecloud/models/dependency_object.rb +13 -1
  83. data/lib/purecloud/models/domain_edge_software_version_dto.rb +13 -13
  84. data/lib/purecloud/models/group_search_criteria.rb +260 -0
  85. data/lib/purecloud/models/group_search_request.rb +240 -0
  86. data/lib/purecloud/models/groups_search_response.rb +16 -4
  87. data/lib/purecloud/models/integration.rb +252 -0
  88. data/lib/purecloud/models/integration_configuration.rb +243 -0
  89. data/lib/purecloud/models/{deleted_resource_consumer_entity_listing.rb → integration_entity_listing.rb} +2 -2
  90. data/lib/purecloud/models/integration_status_info.rb +209 -0
  91. data/lib/purecloud/models/integration_type.rb +27 -1
  92. data/lib/purecloud/models/json_node.rb +13 -13
  93. data/lib/purecloud/models/json_node_search_response.rb +14 -4
  94. data/lib/purecloud/models/location_search_criteria.rb +260 -0
  95. data/lib/purecloud/models/location_search_request.rb +240 -0
  96. data/lib/purecloud/models/locations_search_response.rb +261 -0
  97. data/lib/purecloud/models/number_order.rb +339 -0
  98. data/lib/purecloud/models/number_order_request.rb +1 -1
  99. data/lib/purecloud/models/port_billing_address.rb +205 -0
  100. data/lib/purecloud/models/port_contact.rb +175 -0
  101. data/lib/purecloud/models/quality_audit.rb +1 -1
  102. data/lib/purecloud/models/reservation.rb +1 -1
  103. data/lib/purecloud/models/routing_data.rb +209 -0
  104. data/lib/purecloud/models/search_aggregation.rb +37 -5
  105. data/lib/purecloud/models/search_criteria.rb +22 -22
  106. data/lib/purecloud/models/search_request.rb +40 -39
  107. data/lib/purecloud/models/suggest_search_criteria.rb +240 -0
  108. data/lib/purecloud/models/suggest_search_request.rb +180 -0
  109. data/lib/purecloud/models/usage.rb +167 -0
  110. data/lib/purecloud/models/usage_item.rb +194 -0
  111. data/lib/purecloud/models/user_search_criteria.rb +260 -0
  112. data/lib/purecloud/models/user_search_request.rb +240 -0
  113. data/lib/purecloud/models/users_search_response.rb +16 -4
  114. data/lib/purecloud/models/voicemail_message_entity_listing.rb +4 -74
  115. data/lib/purecloud/models/workspace.rb +11 -1
  116. data/lib/purecloud/models/workspace_create.rb +14 -4
  117. data/lib/purecloud/models/workspace_summary.rb +14 -4
  118. data/lib/purecloud/version.rb +1 -1
  119. data/lib/purecloud.rb +23 -2
  120. data/newVersion.md +1 -1
  121. data/swagger.json +1 -1
  122. data/version.json +1 -1
  123. metadata +48 -6
@@ -0,0 +1,175 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@inin.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class PortContact
21
+ attr_accessor :email
22
+
23
+ attr_accessor :phone_number
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'email' => :'email',
30
+
31
+ :'phone_number' => :'phoneNumber'
32
+
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'email' => :'String',
40
+ :'phone_number' => :'String'
41
+
42
+ }
43
+ end
44
+
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
50
+
51
+
52
+ if attributes[:'email']
53
+ self.email = attributes[:'email']
54
+ end
55
+
56
+ if attributes[:'phoneNumber']
57
+ self.phone_number = attributes[:'phoneNumber']
58
+ end
59
+
60
+ end
61
+
62
+ # Check equality by comparing each attribute.
63
+ def ==(o)
64
+ return true if self.equal?(o)
65
+ self.class == o.class &&
66
+ email == o.email &&
67
+ phone_number == o.phone_number
68
+ end
69
+
70
+ # @see the `==` method
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculate hash code according to all attributes.
76
+ def hash
77
+ [email, phone_number].hash
78
+ end
79
+
80
+ # build the object from hash
81
+ def build_from_hash(attributes)
82
+ return nil unless attributes.is_a?(Hash)
83
+ self.class.swagger_types.each_pair do |key, type|
84
+ if type =~ /^Array<(.*)>/i
85
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
86
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
87
+ else
88
+ #TODO show warning in debug mode
89
+ end
90
+ elsif !attributes[self.class.attribute_map[key]].nil?
91
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
92
+ else
93
+ # data not found in attributes(hash), not an issue as the data can be optional
94
+ end
95
+ end
96
+
97
+ self
98
+ end
99
+
100
+ def _deserialize(type, value)
101
+ case type.to_sym
102
+ when :DateTime
103
+ DateTime.parse(value)
104
+ when :Date
105
+ Date.parse(value)
106
+ when :String
107
+ value.to_s
108
+ when :Integer
109
+ value.to_i
110
+ when :Float
111
+ value.to_f
112
+ when :BOOLEAN
113
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
114
+ true
115
+ else
116
+ false
117
+ end
118
+ when :Object
119
+ # generic object (usually a Hash), return directly
120
+ value
121
+ when /\AArray<(?<inner_type>.+)>\z/
122
+ inner_type = Regexp.last_match[:inner_type]
123
+ value.map { |v| _deserialize(inner_type, v) }
124
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
125
+ k_type = Regexp.last_match[:k_type]
126
+ v_type = Regexp.last_match[:v_type]
127
+ {}.tap do |hash|
128
+ value.each do |k, v|
129
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
130
+ end
131
+ end
132
+ else # model
133
+ _model = Object.const_get("PureCloud").const_get(type).new
134
+ _model.build_from_hash(value)
135
+ end
136
+ end
137
+
138
+ def to_s
139
+ to_hash.to_s
140
+ end
141
+
142
+ # to_body is an alias to to_body (backward compatibility))
143
+ def to_body
144
+ to_hash
145
+ end
146
+
147
+ # return the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ next if value.nil?
153
+ hash[param] = _to_hash(value)
154
+ end
155
+ hash
156
+ end
157
+
158
+ # Method to output non-array value in the form of hash
159
+ # For object, use to_hash. Otherwise, just return the value
160
+ def _to_hash(value)
161
+ if value.is_a?(Array)
162
+ value.compact.map{ |v| _to_hash(v) }
163
+ elsif value.is_a?(Hash)
164
+ {}.tap do |hash|
165
+ value.each { |k, v| hash[k] = _to_hash(v) }
166
+ end
167
+ elsif value.respond_to? :to_hash
168
+ value.to_hash
169
+ else
170
+ value
171
+ end
172
+ end
173
+
174
+ end
175
+ end
@@ -78,7 +78,7 @@ module PureCloud
78
78
  :'name' => :'String',
79
79
  :'user' => :'User',
80
80
  :'timestamp' => :'String',
81
- :'entity' => :'Entity',
81
+ :'entity' => :'AuditEntity',
82
82
  :'level' => :'String',
83
83
  :'action' => :'String',
84
84
  :'status' => :'String',
@@ -81,7 +81,7 @@ module PureCloud
81
81
 
82
82
  # Custom attribute writer method checking allowed values (enum).
83
83
  def phone_number_type=(phone_number_type)
84
- allowed_values = ["TOLL_FREE", "CN_DOMESTIC", "US_DOMESTIC"]
84
+ allowed_values = ["TOLL_FREE", "CN_DOMESTIC", "US_DOMESTIC", "US_TOLLFREE", "XA_TOLLFREE", "XB_TOLLFREE", "XC_TOLLFREE", "AG_DID", "AI_DID", "BB_DID", "BM_DID", "BS_DID", "CA_DID", "DM_DID", "DO_DID", "GD_DID", "JM_DID", "KN_DID", "KY_DID", "KZ_DID", "LC_DID", "MP_DID", "MS_DID", "RU_DID", "TC_DID", "TT_DID", "US_DID", "VC_DID", "VG_DID", "AF_DID", "AR_DID", "AT_DID", "AU_DID", "BE_DID", "BR_DID", "CH_DID", "CL_DID", "CN_DID", "CO_DID", "CU_DID", "DE_DID", "DK_DID", "EG_DID", "ES_DID", "FR_DID", "GB_DID", "GR_DID", "HU_DID", "ID_DID", "IN_DID", "IR_DID", "IT_DID", "JP_DID", "KR_DID", "LK_DID", "MM_DID", "MX_DID", "MY_DID", "NL_DID", "NO_DID", "NZ_DID", "PE_DID", "PH_DID", "PK_DID", "PL_DID", "RO_DID", "SE_DID", "SG_DID", "TH_DID", "TR_DID", "VE_DID", "VN_DID", "ZA_DID", "AD_DID", "AE_DID", "AL_DID", "AM_DID", "AO_DID", "AQ_DID", "AW_DID", "AZ_DID", "BA_DID", "BD_DID", "BF_DID", "BG_DID", "BH_DID", "BI_DID", "BJ_DID", "BL_DID", "BN_DID", "BO_DID", "BQ_DID", "BT_DID", "BW_DID", "BY_DID", "BZ_DID", "CD_DID", "CF_DID", "CG_DID", "CI_DID", "CK_DID", "CM_DID", "CR_DID", "CV_DID", "CY_DID", "CZ_DID", "DJ_DID", "DZ_DID", "EC_DID", "EE_DID", "EH_DID", "ER_DID", "ET_DID", "FI_DID", "FJ_DID", "FK_DID", "FM_DID", "FO_DID", "GA_DID", "GE_DID", "GF_DID", "GH_DID", "GI_DID", "GL_DID", "GM_DID", "GN_DID", "GP_DID", "GQ_DID", "GT_DID", "GW_DID", "GY_DID", "HK_DID", "HN_DID", "HR_DID", "HT_DID", "IE_DID", "IL_DID", "IO_DID", "IQ_DID", "IS_DID", "JO_DID", "KE_DID", "KG_DID", "KH_DID", "KI_DID", "KM_DID", "KP_DID", "KW_DID", "LA_DID", "LB_DID", "LI_DID", "LR_DID", "LS_DID", "LT_DID", "LU_DID", "LV_DID", "LY_DID", "MA_DID", "MC_DID", "MD_DID", "ME_DID", "MF_DID", "MG_DID", "MH_DID", "MK_DID", "ML_DID", "MN_DID", "MO_DID", "MQ_DID", "MR_DID", "MT_DID", "MU_DID", "MV_DID", "MW_DID", "MZ_DID", "NA_DID", "NC_DID", "NE_DID", "NF_DID", "NG_DID", "NI_DID", "NP_DID", "NR_DID", "NU_DID", "OM_DID", "PA_DID", "PF_DID", "PG_DID", "PM_DID", "PS_DID", "PT_DID", "PW_DID", "PY_DID", "QA_DID", "RE_DID", "RS_DID", "RW_DID", "SA_DID", "SB_DID", "SC_DID", "SD_DID", "SH_247_DID", "SH_290_DID", "SI_DID", "SK_DID", "SL_DID", "SM_DID", "SN_DID", "SO_DID", "SR_DID", "SS_DID", "ST_DID", "SV_DID", "SY_DID", "SZ_DID", "TD_DID", "TG_DID", "TJ_DID", "TK_DID", "TL_DID", "TM_DID", "TN_DID", "TO_DID", "TV_DID", "TW_DID", "TZ_DID", "UA_DID", "UG_DID", "UY_DID", "UZ_DID", "VU_DID", "WF_DID", "WS_DID", "XG_DID", "XN_DID", "XV_882_DID", "XV_883_DID", "YE_DID", "YT_DID", "ZM_DID", "ZW_DID", "SX_DID"]
85
85
  if phone_number_type && !allowed_values.include?(phone_number_type)
86
86
  fail "invalid value for 'phone_number_type', must be one of #{allowed_values}"
87
87
  end
@@ -0,0 +1,209 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@inin.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class RoutingData
21
+ attr_accessor :queue_id
22
+
23
+ attr_accessor :language_id
24
+
25
+ attr_accessor :priority
26
+
27
+ attr_accessor :skill_ids
28
+
29
+ attr_accessor :preferred_agent_ids
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+
35
+ :'queue_id' => :'queueId',
36
+
37
+ :'language_id' => :'languageId',
38
+
39
+ :'priority' => :'priority',
40
+
41
+ :'skill_ids' => :'skillIds',
42
+
43
+ :'preferred_agent_ids' => :'preferredAgentIds'
44
+
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'queue_id' => :'String',
52
+ :'language_id' => :'String',
53
+ :'priority' => :'Integer',
54
+ :'skill_ids' => :'Array<String>',
55
+ :'preferred_agent_ids' => :'Array<String>'
56
+
57
+ }
58
+ end
59
+
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
65
+
66
+
67
+ if attributes[:'queueId']
68
+ self.queue_id = attributes[:'queueId']
69
+ end
70
+
71
+ if attributes[:'languageId']
72
+ self.language_id = attributes[:'languageId']
73
+ end
74
+
75
+ if attributes[:'priority']
76
+ self.priority = attributes[:'priority']
77
+ end
78
+
79
+ if attributes[:'skillIds']
80
+ if (value = attributes[:'skillIds']).is_a?(Array)
81
+ self.skill_ids = value
82
+ end
83
+ end
84
+
85
+ if attributes[:'preferredAgentIds']
86
+ if (value = attributes[:'preferredAgentIds']).is_a?(Array)
87
+ self.preferred_agent_ids = value
88
+ end
89
+ end
90
+
91
+ end
92
+
93
+ # Check equality by comparing each attribute.
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ queue_id == o.queue_id &&
98
+ language_id == o.language_id &&
99
+ priority == o.priority &&
100
+ skill_ids == o.skill_ids &&
101
+ preferred_agent_ids == o.preferred_agent_ids
102
+ end
103
+
104
+ # @see the `==` method
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculate hash code according to all attributes.
110
+ def hash
111
+ [queue_id, language_id, priority, skill_ids, preferred_agent_ids].hash
112
+ end
113
+
114
+ # build the object from hash
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /^Array<(.*)>/i
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
121
+ else
122
+ #TODO show warning in debug mode
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ else
127
+ # data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ _model = Object.const_get("PureCloud").const_get(type).new
168
+ _model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_body (backward compatibility))
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # return the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Method to output non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map{ |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+
208
+ end
209
+ end
@@ -24,6 +24,12 @@ module PureCloud
24
24
 
25
25
  attr_accessor :type
26
26
 
27
+ attr_accessor :value
28
+
29
+ attr_accessor :size
30
+
31
+ attr_accessor :order
32
+
27
33
  # Attribute mapping from ruby-style variable name to JSON key.
28
34
  def self.attribute_map
29
35
  {
@@ -32,7 +38,13 @@ module PureCloud
32
38
 
33
39
  :'name' => :'name',
34
40
 
35
- :'type' => :'type'
41
+ :'type' => :'type',
42
+
43
+ :'value' => :'value',
44
+
45
+ :'size' => :'size',
46
+
47
+ :'order' => :'order'
36
48
 
37
49
  }
38
50
  end
@@ -42,7 +54,10 @@ module PureCloud
42
54
  {
43
55
  :'field' => :'String',
44
56
  :'name' => :'String',
45
- :'type' => :'String'
57
+ :'type' => :'String',
58
+ :'value' => :'String',
59
+ :'size' => :'Integer',
60
+ :'order' => :'Array<String>'
46
61
 
47
62
  }
48
63
  end
@@ -66,11 +81,25 @@ module PureCloud
66
81
  self.type = attributes[:'type']
67
82
  end
68
83
 
84
+ if attributes[:'value']
85
+ self.value = attributes[:'value']
86
+ end
87
+
88
+ if attributes[:'size']
89
+ self.size = attributes[:'size']
90
+ end
91
+
92
+ if attributes[:'order']
93
+ if (value = attributes[:'order']).is_a?(Array)
94
+ self.order = value
95
+ end
96
+ end
97
+
69
98
  end
70
99
 
71
100
  # Custom attribute writer method checking allowed values (enum).
72
101
  def type=(type)
73
- allowed_values = ["TERM", "COUNT", "SUM", "AVERAGE"]
102
+ allowed_values = ["COUNT", "SUM", "AVERAGE", "CONTAINS", "STARTS_WITH", "ENDS_WITH"]
74
103
  if type && !allowed_values.include?(type)
75
104
  fail "invalid value for 'type', must be one of #{allowed_values}"
76
105
  end
@@ -83,7 +112,10 @@ module PureCloud
83
112
  self.class == o.class &&
84
113
  field == o.field &&
85
114
  name == o.name &&
86
- type == o.type
115
+ type == o.type &&
116
+ value == o.value &&
117
+ size == o.size &&
118
+ order == o.order
87
119
  end
88
120
 
89
121
  # @see the `==` method
@@ -93,7 +125,7 @@ module PureCloud
93
125
 
94
126
  # Calculate hash code according to all attributes.
95
127
  def hash
96
- [field, name, type].hash
128
+ [field, name, type, value, size, order].hash
97
129
  end
98
130
 
99
131
  # build the object from hash
@@ -24,8 +24,6 @@ module PureCloud
24
24
 
25
25
  attr_accessor :start_value
26
26
 
27
- attr_accessor :type
28
-
29
27
  attr_accessor :fields
30
28
 
31
29
  attr_accessor :value
@@ -34,6 +32,8 @@ module PureCloud
34
32
 
35
33
  attr_accessor :group
36
34
 
35
+ attr_accessor :type
36
+
37
37
  # Attribute mapping from ruby-style variable name to JSON key.
38
38
  def self.attribute_map
39
39
  {
@@ -44,15 +44,15 @@ module PureCloud
44
44
 
45
45
  :'start_value' => :'startValue',
46
46
 
47
- :'type' => :'type',
48
-
49
47
  :'fields' => :'fields',
50
48
 
51
49
  :'value' => :'value',
52
50
 
53
51
  :'operator' => :'operator',
54
52
 
55
- :'group' => :'group'
53
+ :'group' => :'group',
54
+
55
+ :'type' => :'type'
56
56
 
57
57
  }
58
58
  end
@@ -63,11 +63,11 @@ module PureCloud
63
63
  :'end_value' => :'String',
64
64
  :'values' => :'Array<String>',
65
65
  :'start_value' => :'String',
66
- :'type' => :'String',
67
66
  :'fields' => :'Array<String>',
68
67
  :'value' => :'String',
69
68
  :'operator' => :'String',
70
- :'group' => :'Array<SearchCriteria>'
69
+ :'group' => :'Array<SearchCriteria>',
70
+ :'type' => :'String'
71
71
 
72
72
  }
73
73
  end
@@ -93,10 +93,6 @@ module PureCloud
93
93
  self.start_value = attributes[:'startValue']
94
94
  end
95
95
 
96
- if attributes[:'type']
97
- self.type = attributes[:'type']
98
- end
99
-
100
96
  if attributes[:'fields']
101
97
  if (value = attributes[:'fields']).is_a?(Array)
102
98
  self.fields = value
@@ -117,15 +113,10 @@ module PureCloud
117
113
  end
118
114
  end
119
115
 
120
- end
121
-
122
- # Custom attribute writer method checking allowed values (enum).
123
- def type=(type)
124
- allowed_values = ["EXACT", "CONTAINS", "STARTS_WITH", "REQUIRED_FIELDS", "RANGE", "DATE_RANGE", "LESS_THAN", "LESS_THAN_EQUAL_TO", "GREATER_THAN", "GREATER_THAN_EQUAL_TO", "SIMPLE", "TERM", "TERMS", "QUERY_STRING"]
125
- if type && !allowed_values.include?(type)
126
- fail "invalid value for 'type', must be one of #{allowed_values}"
116
+ if attributes[:'type']
117
+ self.type = attributes[:'type']
127
118
  end
128
- @type = type
119
+
129
120
  end
130
121
 
131
122
  # Custom attribute writer method checking allowed values (enum).
@@ -137,6 +128,15 @@ module PureCloud
137
128
  @operator = operator
138
129
  end
139
130
 
131
+ # Custom attribute writer method checking allowed values (enum).
132
+ def type=(type)
133
+ allowed_values = ["EXACT", "CONTAINS", "STARTS_WITH", "REQUIRED_FIELDS", "RANGE", "DATE_RANGE", "LESS_THAN", "LESS_THAN_EQUAL_TO", "GREATER_THAN", "GREATER_THAN_EQUAL_TO", "SIMPLE", "TERM", "TERMS", "QUERY_STRING"]
134
+ if type && !allowed_values.include?(type)
135
+ fail "invalid value for 'type', must be one of #{allowed_values}"
136
+ end
137
+ @type = type
138
+ end
139
+
140
140
  # Check equality by comparing each attribute.
141
141
  def ==(o)
142
142
  return true if self.equal?(o)
@@ -144,11 +144,11 @@ module PureCloud
144
144
  end_value == o.end_value &&
145
145
  values == o.values &&
146
146
  start_value == o.start_value &&
147
- type == o.type &&
148
147
  fields == o.fields &&
149
148
  value == o.value &&
150
149
  operator == o.operator &&
151
- group == o.group
150
+ group == o.group &&
151
+ type == o.type
152
152
  end
153
153
 
154
154
  # @see the `==` method
@@ -158,7 +158,7 @@ module PureCloud
158
158
 
159
159
  # Calculate hash code according to all attributes.
160
160
  def hash
161
- [end_value, values, start_value, type, fields, value, operator, group].hash
161
+ [end_value, values, start_value, fields, value, operator, group, type].hash
162
162
  end
163
163
 
164
164
  # build the object from hash