purecloud 0.41.1 → 0.42.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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/config-ruby.json +1 -1
  4. data/doc_out/ADFS.html.md +20 -0
  5. data/doc_out/CodesRequest.html.md +14 -0
  6. data/doc_out/ContactSort.html.md +1 -0
  7. data/doc_out/ContentQueryRequest.html.md +1 -0
  8. data/doc_out/ConversationAssociation.html.md +15 -0
  9. data/doc_out/CreateCallbackCommand.html.md +9 -9
  10. data/doc_out/CreateIntegrationRequest.html.md +16 -0
  11. data/doc_out/CustomerInteractionCenter.html.md +1 -0
  12. data/doc_out/DocusignTemplateMapping.html.md +16 -0
  13. data/doc_out/DomainEdgeSoftwareVersionDto.html.md +1 -1
  14. data/doc_out/EmbeddedSignatureView.html.md +1 -0
  15. data/doc_out/IdentityProviderApi.html.md +158 -0
  16. data/doc_out/Integration.html.md +4 -4
  17. data/doc_out/IntegrationConfiguration.html.md +3 -3
  18. data/doc_out/IntegrationStatusInfo.html.md +3 -3
  19. data/doc_out/IntegrationType.html.md +4 -4
  20. data/doc_out/JsonNode.html.md +4 -4
  21. data/doc_out/NumberOrder.html.md +2 -0
  22. data/doc_out/OAuthProvider.html.md +1 -0
  23. data/doc_out/Okta.html.md +1 -0
  24. data/doc_out/OneLogin.html.md +1 -0
  25. data/doc_out/PolicyActions.html.md +3 -2
  26. data/doc_out/PureCloud.html.md +1 -0
  27. data/doc_out/QueryRequest.html.md +1 -0
  28. data/doc_out/Response.html.md +1 -0
  29. data/doc_out/RoutingData.html.md +5 -5
  30. data/doc_out/Salesforce.html.md +1 -0
  31. data/doc_out/Script.html.md +1 -0
  32. data/doc_out/SignatureDocumentInfo.html.md +1 -0
  33. data/doc_out/TelephonyProvidersEdgeApi.html.md +15 -15
  34. data/doc_out/index.html.md +3 -3
  35. data/lib/purecloud.rb +5 -0
  36. data/lib/purecloud/api/identity_provider_api.rb +165 -0
  37. data/lib/purecloud/api/telephony_providers_edge_api.rb +10 -10
  38. data/lib/purecloud/api_client.rb +1 -1
  39. data/lib/purecloud/models/adfs.rb +239 -0
  40. data/lib/purecloud/models/codes_request.rb +175 -0
  41. data/lib/purecloud/models/contact_sort.rb +16 -4
  42. data/lib/purecloud/models/content_query_request.rb +16 -4
  43. data/lib/purecloud/models/conversation_association.rb +197 -0
  44. data/lib/purecloud/models/create_callback_command.rb +18 -8
  45. data/lib/purecloud/models/create_integration_request.rb +200 -0
  46. data/lib/purecloud/models/customer_interaction_center.rb +13 -1
  47. data/lib/purecloud/models/dependency.rb +1 -1
  48. data/lib/purecloud/models/dependency_object.rb +1 -1
  49. data/lib/purecloud/models/docusign_template_mapping.rb +197 -0
  50. data/lib/purecloud/models/domain_edge_software_version_dto.rb +13 -13
  51. data/lib/purecloud/models/embedded_signature_view.rb +15 -4
  52. data/lib/purecloud/models/flow.rb +1 -1
  53. data/lib/purecloud/models/integration.rb +2 -1
  54. data/lib/purecloud/models/integration_type.rb +1 -10
  55. data/lib/purecloud/models/json_node.rb +49 -49
  56. data/lib/purecloud/models/number_order.rb +23 -1
  57. data/lib/purecloud/models/o_auth_provider.rb +13 -1
  58. data/lib/purecloud/models/okta.rb +13 -1
  59. data/lib/purecloud/models/one_login.rb +13 -1
  60. data/lib/purecloud/models/policy_actions.rb +16 -1
  61. data/lib/purecloud/models/pure_cloud.rb +13 -1
  62. data/lib/purecloud/models/query_request.rb +16 -4
  63. data/lib/purecloud/models/response.rb +21 -1
  64. data/lib/purecloud/models/response_text.rb +9 -0
  65. data/lib/purecloud/models/routing_data.rb +5 -0
  66. data/lib/purecloud/models/salesforce.rb +13 -1
  67. data/lib/purecloud/models/script.rb +13 -1
  68. data/lib/purecloud/models/signature_document_info.rb +15 -4
  69. data/lib/purecloud/version.rb +1 -1
  70. data/newVersion.md +1 -1
  71. data/swagger.json +1 -1
  72. data/version.json +1 -1
  73. metadata +12 -2
@@ -22,13 +22,17 @@ module PureCloud
22
22
 
23
23
  attr_accessor :direction
24
24
 
25
+ attr_accessor :numeric
26
+
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
26
28
  def self.attribute_map
27
29
  {
28
30
 
29
31
  :'field_name' => :'fieldName',
30
32
 
31
- :'direction' => :'direction'
33
+ :'direction' => :'direction',
34
+
35
+ :'numeric' => :'numeric'
32
36
 
33
37
  }
34
38
  end
@@ -37,7 +41,8 @@ module PureCloud
37
41
  def self.swagger_types
38
42
  {
39
43
  :'field_name' => :'String',
40
- :'direction' => :'String'
44
+ :'direction' => :'String',
45
+ :'numeric' => :'BOOLEAN'
41
46
 
42
47
  }
43
48
  end
@@ -57,6 +62,12 @@ module PureCloud
57
62
  self.direction = attributes[:'direction']
58
63
  end
59
64
 
65
+ if attributes[:'numeric']
66
+ self.numeric = attributes[:'numeric']
67
+ else
68
+ self.numeric = false
69
+ end
70
+
60
71
  end
61
72
 
62
73
  # Custom attribute writer method checking allowed values (enum).
@@ -73,7 +84,8 @@ module PureCloud
73
84
  return true if self.equal?(o)
74
85
  self.class == o.class &&
75
86
  field_name == o.field_name &&
76
- direction == o.direction
87
+ direction == o.direction &&
88
+ numeric == o.numeric
77
89
  end
78
90
 
79
91
  # @see the `==` method
@@ -83,7 +95,7 @@ module PureCloud
83
95
 
84
96
  # Calculate hash code according to all attributes.
85
97
  def hash
86
- [field_name, direction].hash
98
+ [field_name, direction, numeric].hash
87
99
  end
88
100
 
89
101
  # build the object from hash
@@ -32,6 +32,8 @@ module PureCloud
32
32
 
33
33
  attr_accessor :attribute_filters
34
34
 
35
+ attr_accessor :include_shares
36
+
35
37
  # Attribute mapping from ruby-style variable name to JSON key.
36
38
  def self.attribute_map
37
39
  {
@@ -48,7 +50,9 @@ module PureCloud
48
50
 
49
51
  :'filters' => :'filters',
50
52
 
51
- :'attribute_filters' => :'attributeFilters'
53
+ :'attribute_filters' => :'attributeFilters',
54
+
55
+ :'include_shares' => :'includeShares'
52
56
 
53
57
  }
54
58
  end
@@ -62,7 +66,8 @@ module PureCloud
62
66
  :'facet_name_requests' => :'Array<String>',
63
67
  :'sort' => :'Array<ContentSortItem>',
64
68
  :'filters' => :'Array<ContentFacetFilterItem>',
65
- :'attribute_filters' => :'Array<ContentAttributeFilterItem>'
69
+ :'attribute_filters' => :'Array<ContentAttributeFilterItem>',
70
+ :'include_shares' => :'BOOLEAN'
66
71
 
67
72
  }
68
73
  end
@@ -110,6 +115,12 @@ module PureCloud
110
115
  end
111
116
  end
112
117
 
118
+ if attributes[:'includeShares']
119
+ self.include_shares = attributes[:'includeShares']
120
+ else
121
+ self.include_shares = false
122
+ end
123
+
113
124
  end
114
125
 
115
126
  # Check equality by comparing each attribute.
@@ -122,7 +133,8 @@ module PureCloud
122
133
  facet_name_requests == o.facet_name_requests &&
123
134
  sort == o.sort &&
124
135
  filters == o.filters &&
125
- attribute_filters == o.attribute_filters
136
+ attribute_filters == o.attribute_filters &&
137
+ include_shares == o.include_shares
126
138
  end
127
139
 
128
140
  # @see the `==` method
@@ -132,7 +144,7 @@ module PureCloud
132
144
 
133
145
  # Calculate hash code according to all attributes.
134
146
  def hash
135
- [query_phrase, page_number, page_size, facet_name_requests, sort, filters, attribute_filters].hash
147
+ [query_phrase, page_number, page_size, facet_name_requests, sort, filters, attribute_filters, include_shares].hash
136
148
  end
137
149
 
138
150
  # build the object from hash
@@ -0,0 +1,197 @@
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 ConversationAssociation
21
+ # Conversation ID
22
+ attr_accessor :conversation_id
23
+
24
+ # Communication ID
25
+ attr_accessor :communication_id
26
+
27
+ # Media type
28
+ attr_accessor :media_type
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+
34
+ :'conversation_id' => :'conversationId',
35
+
36
+ :'communication_id' => :'communicationId',
37
+
38
+ :'media_type' => :'mediaType'
39
+
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'conversation_id' => :'String',
47
+ :'communication_id' => :'String',
48
+ :'media_type' => :'String'
49
+
50
+ }
51
+ end
52
+
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
58
+
59
+
60
+ if attributes[:'conversationId']
61
+ self.conversation_id = attributes[:'conversationId']
62
+ end
63
+
64
+ if attributes[:'communicationId']
65
+ self.communication_id = attributes[:'communicationId']
66
+ end
67
+
68
+ if attributes[:'mediaType']
69
+ self.media_type = attributes[:'mediaType']
70
+ end
71
+
72
+ end
73
+
74
+ # Custom attribute writer method checking allowed values (enum).
75
+ def media_type=(media_type)
76
+ allowed_values = ["CALL", "CALLBACK", "CHAT", "EMAIL", "SOCIAL_EXPRESSION", "VIDEO"]
77
+ if media_type && !allowed_values.include?(media_type)
78
+ fail "invalid value for 'media_type', must be one of #{allowed_values}"
79
+ end
80
+ @media_type = media_type
81
+ end
82
+
83
+ # Check equality by comparing each attribute.
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ conversation_id == o.conversation_id &&
88
+ communication_id == o.communication_id &&
89
+ media_type == o.media_type
90
+ end
91
+
92
+ # @see the `==` method
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculate hash code according to all attributes.
98
+ def hash
99
+ [conversation_id, communication_id, media_type].hash
100
+ end
101
+
102
+ # build the object from hash
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.swagger_types.each_pair do |key, type|
106
+ if type =~ /^Array<(.*)>/i
107
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
108
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
109
+ else
110
+ #TODO show warning in debug mode
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ else
115
+ # data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ def _deserialize(type, value)
123
+ case type.to_sym
124
+ when :DateTime
125
+ DateTime.parse(value)
126
+ when :Date
127
+ Date.parse(value)
128
+ when :String
129
+ value.to_s
130
+ when :Integer
131
+ value.to_i
132
+ when :Float
133
+ value.to_f
134
+ when :BOOLEAN
135
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
136
+ true
137
+ else
138
+ false
139
+ end
140
+ when :Object
141
+ # generic object (usually a Hash), return directly
142
+ value
143
+ when /\AArray<(?<inner_type>.+)>\z/
144
+ inner_type = Regexp.last_match[:inner_type]
145
+ value.map { |v| _deserialize(inner_type, v) }
146
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
147
+ k_type = Regexp.last_match[:k_type]
148
+ v_type = Regexp.last_match[:v_type]
149
+ {}.tap do |hash|
150
+ value.each do |k, v|
151
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
152
+ end
153
+ end
154
+ else # model
155
+ _model = Object.const_get("PureCloud").const_get(type).new
156
+ _model.build_from_hash(value)
157
+ end
158
+ end
159
+
160
+ def to_s
161
+ to_hash.to_s
162
+ end
163
+
164
+ # to_body is an alias to to_body (backward compatibility))
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ # return the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ next if value.nil?
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Method to output non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ def _to_hash(value)
183
+ if value.is_a?(Array)
184
+ value.compact.map{ |v| _to_hash(v) }
185
+ elsif value.is_a?(Hash)
186
+ {}.tap do |hash|
187
+ value.each { |k, v| hash[k] = _to_hash(v) }
188
+ end
189
+ elsif value.respond_to? :to_hash
190
+ value.to_hash
191
+ else
192
+ value
193
+ end
194
+ end
195
+
196
+ end
197
+ end
@@ -18,24 +18,32 @@ require 'date'
18
18
 
19
19
  module PureCloud
20
20
  class CreateCallbackCommand
21
+ # The identifier of the script to be used for the callback
21
22
  attr_accessor :script_id
22
23
 
24
+ # The identifier of the queue to be used for the callback. Either queueId or routingData is required.
23
25
  attr_accessor :queue_id
24
26
 
27
+ # The routing data to be used for the callback. Either queueId or routingData is required.
25
28
  attr_accessor :routing_data
26
29
 
30
+ # The name of the party to be called back.
27
31
  attr_accessor :callback_user_name
28
32
 
33
+ # A list of phone numbers for the callback.
29
34
  attr_accessor :callback_numbers
30
35
 
31
- # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
36
+ # The scheduled date-time for the callback as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
32
37
  attr_accessor :callback_scheduled_time
33
38
 
39
+ # The country code to be associated with the callback numbers.
34
40
  attr_accessor :country_code
35
41
 
42
+ # Indicates if the agent is allowed to skip the callback.
36
43
  attr_accessor :skip_enabled
37
44
 
38
- attr_accessor :additional_info
45
+ # A map of key-value pairs containing additional data that can be associated to the callback. These could be set up for instance to be used in a customized script shown during the call. Example: { \"notes\": \"ready to close the deal!\", \"customerPreferredName\": \"Doc\" }
46
+ attr_accessor :data
39
47
 
40
48
  # Attribute mapping from ruby-style variable name to JSON key.
41
49
  def self.attribute_map
@@ -57,7 +65,7 @@ module PureCloud
57
65
 
58
66
  :'skip_enabled' => :'skipEnabled',
59
67
 
60
- :'additional_info' => :'additionalInfo'
68
+ :'data' => :'data'
61
69
 
62
70
  }
63
71
  end
@@ -73,7 +81,7 @@ module PureCloud
73
81
  :'callback_scheduled_time' => :'DateTime',
74
82
  :'country_code' => :'String',
75
83
  :'skip_enabled' => :'BOOLEAN',
76
- :'additional_info' => :'AdditionalInfo'
84
+ :'data' => :'Hash<String, String>'
77
85
 
78
86
  }
79
87
  end
@@ -121,8 +129,10 @@ module PureCloud
121
129
  self.skip_enabled = false
122
130
  end
123
131
 
124
- if attributes[:'additionalInfo']
125
- self.additional_info = attributes[:'additionalInfo']
132
+ if attributes[:'data']
133
+ if (value = attributes[:'data']).is_a?(Array)
134
+ self.data = value
135
+ end
126
136
  end
127
137
 
128
138
  end
@@ -139,7 +149,7 @@ module PureCloud
139
149
  callback_scheduled_time == o.callback_scheduled_time &&
140
150
  country_code == o.country_code &&
141
151
  skip_enabled == o.skip_enabled &&
142
- additional_info == o.additional_info
152
+ data == o.data
143
153
  end
144
154
 
145
155
  # @see the `==` method
@@ -149,7 +159,7 @@ module PureCloud
149
159
 
150
160
  # Calculate hash code according to all attributes.
151
161
  def hash
152
- [script_id, queue_id, routing_data, callback_user_name, callback_numbers, callback_scheduled_time, country_code, skip_enabled, additional_info].hash
162
+ [script_id, queue_id, routing_data, callback_user_name, callback_numbers, callback_scheduled_time, country_code, skip_enabled, data].hash
153
163
  end
154
164
 
155
165
  # build the object from hash
@@ -0,0 +1,200 @@
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
+ # Details for an Integration
21
+ class CreateIntegrationRequest
22
+ # The globally unique identifier for the object.
23
+ attr_accessor :id
24
+
25
+ # The name of the integration, used to distinguish this integration from others of the same type.
26
+ attr_accessor :name
27
+
28
+ # Type of the integration to create.
29
+ attr_accessor :integration_type
30
+
31
+ # The URI for this object
32
+ attr_accessor :self_uri
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+
38
+ :'id' => :'id',
39
+
40
+ :'name' => :'name',
41
+
42
+ :'integration_type' => :'integrationType',
43
+
44
+ :'self_uri' => :'selfUri'
45
+
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+ :'id' => :'String',
53
+ :'name' => :'String',
54
+ :'integration_type' => :'IntegrationType',
55
+ :'self_uri' => :'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[:'id']
68
+ self.id = attributes[:'id']
69
+ end
70
+
71
+ if attributes[:'name']
72
+ self.name = attributes[:'name']
73
+ end
74
+
75
+ if attributes[:'integrationType']
76
+ self.integration_type = attributes[:'integrationType']
77
+ end
78
+
79
+ if attributes[:'selfUri']
80
+ self.self_uri = attributes[:'selfUri']
81
+ end
82
+
83
+ end
84
+
85
+ # Check equality by comparing each attribute.
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ id == o.id &&
90
+ name == o.name &&
91
+ integration_type == o.integration_type &&
92
+ self_uri == o.self_uri
93
+ end
94
+
95
+ # @see the `==` method
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculate hash code according to all attributes.
101
+ def hash
102
+ [id, name, integration_type, self_uri].hash
103
+ end
104
+
105
+ # build the object from hash
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /^Array<(.*)>/i
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
112
+ else
113
+ #TODO show warning in debug mode
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ else
118
+ # data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ _model = Object.const_get("PureCloud").const_get(type).new
159
+ _model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_body (backward compatibility))
168
+ def to_body
169
+ to_hash
170
+ end
171
+
172
+ # return the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ next if value.nil?
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ # Method to output non-array value in the form of hash
184
+ # For object, use to_hash. Otherwise, just return the value
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
+ end