purecloud 0.61.1 → 0.62.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,281 @@
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 CampaignRule
21
+ # The globally unique identifier for the object.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :name
25
+
26
+ # Creation time of the entity. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
27
+ attr_accessor :date_created
28
+
29
+ # Last modified time of the entity. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
30
+ attr_accessor :date_modified
31
+
32
+ # Required for updates, must match the version number of the most recent update
33
+ attr_accessor :version
34
+
35
+ # the list of entities the rule monitors
36
+ attr_accessor :campaign_rule_entities
37
+
38
+ # the list of conditions the are evaluated
39
+ attr_accessor :campaign_rule_conditions
40
+
41
+ # the list of actions that are executed if the conditions are satisfied
42
+ attr_accessor :campaign_rule_actions
43
+
44
+ attr_accessor :match_any_conditions
45
+
46
+ attr_accessor :enabled
47
+
48
+ # The URI for this object
49
+ attr_accessor :self_uri
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+
55
+ :'id' => :'id',
56
+
57
+ :'name' => :'name',
58
+
59
+ :'date_created' => :'dateCreated',
60
+
61
+ :'date_modified' => :'dateModified',
62
+
63
+ :'version' => :'version',
64
+
65
+ :'campaign_rule_entities' => :'campaignRuleEntities',
66
+
67
+ :'campaign_rule_conditions' => :'campaignRuleConditions',
68
+
69
+ :'campaign_rule_actions' => :'campaignRuleActions',
70
+
71
+ :'match_any_conditions' => :'matchAnyConditions',
72
+
73
+ :'enabled' => :'enabled',
74
+
75
+ :'self_uri' => :'selfUri'
76
+
77
+ }
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.swagger_types
82
+ {
83
+ :'id' => :'String',
84
+ :'name' => :'String',
85
+ :'date_created' => :'DateTime',
86
+ :'date_modified' => :'DateTime',
87
+ :'version' => :'Integer',
88
+ :'campaign_rule_entities' => :'CampaignRuleEntities',
89
+ :'campaign_rule_conditions' => :'Array<CampaignRuleCondition>',
90
+ :'campaign_rule_actions' => :'Array<CampaignRuleAction>',
91
+ :'match_any_conditions' => :'BOOLEAN',
92
+ :'enabled' => :'BOOLEAN',
93
+ :'self_uri' => :'String'
94
+
95
+ }
96
+ end
97
+
98
+ def initialize(attributes = {})
99
+ return unless attributes.is_a?(Hash)
100
+
101
+ # convert string to symbol for hash key
102
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
103
+
104
+
105
+ if attributes[:'id']
106
+ self.id = attributes[:'id']
107
+ end
108
+
109
+ if attributes[:'name']
110
+ self.name = attributes[:'name']
111
+ end
112
+
113
+ if attributes[:'dateCreated']
114
+ self.date_created = attributes[:'dateCreated']
115
+ end
116
+
117
+ if attributes[:'dateModified']
118
+ self.date_modified = attributes[:'dateModified']
119
+ end
120
+
121
+ if attributes[:'version']
122
+ self.version = attributes[:'version']
123
+ end
124
+
125
+ if attributes[:'campaignRuleEntities']
126
+ self.campaign_rule_entities = attributes[:'campaignRuleEntities']
127
+ end
128
+
129
+ if attributes[:'campaignRuleConditions']
130
+ if (value = attributes[:'campaignRuleConditions']).is_a?(Array)
131
+ self.campaign_rule_conditions = value
132
+ end
133
+ end
134
+
135
+ if attributes[:'campaignRuleActions']
136
+ if (value = attributes[:'campaignRuleActions']).is_a?(Array)
137
+ self.campaign_rule_actions = value
138
+ end
139
+ end
140
+
141
+ if attributes[:'matchAnyConditions']
142
+ self.match_any_conditions = attributes[:'matchAnyConditions']
143
+ else
144
+ self.match_any_conditions = false
145
+ end
146
+
147
+ if attributes[:'enabled']
148
+ self.enabled = attributes[:'enabled']
149
+ else
150
+ self.enabled = false
151
+ end
152
+
153
+ if attributes[:'selfUri']
154
+ self.self_uri = attributes[:'selfUri']
155
+ end
156
+
157
+ end
158
+
159
+ # Check equality by comparing each attribute.
160
+ def ==(o)
161
+ return true if self.equal?(o)
162
+ self.class == o.class &&
163
+ id == o.id &&
164
+ name == o.name &&
165
+ date_created == o.date_created &&
166
+ date_modified == o.date_modified &&
167
+ version == o.version &&
168
+ campaign_rule_entities == o.campaign_rule_entities &&
169
+ campaign_rule_conditions == o.campaign_rule_conditions &&
170
+ campaign_rule_actions == o.campaign_rule_actions &&
171
+ match_any_conditions == o.match_any_conditions &&
172
+ enabled == o.enabled &&
173
+ self_uri == o.self_uri
174
+ end
175
+
176
+ # @see the `==` method
177
+ def eql?(o)
178
+ self == o
179
+ end
180
+
181
+ # Calculate hash code according to all attributes.
182
+ def hash
183
+ [id, name, date_created, date_modified, version, campaign_rule_entities, campaign_rule_conditions, campaign_rule_actions, match_any_conditions, enabled, self_uri].hash
184
+ end
185
+
186
+ # build the object from hash
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.swagger_types.each_pair do |key, type|
190
+ if type =~ /^Array<(.*)>/i
191
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
192
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
193
+ else
194
+ #TODO show warning in debug mode
195
+ end
196
+ elsif !attributes[self.class.attribute_map[key]].nil?
197
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
198
+ else
199
+ # data not found in attributes(hash), not an issue as the data can be optional
200
+ end
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ def _deserialize(type, value)
207
+ case type.to_sym
208
+ when :DateTime
209
+ DateTime.parse(value)
210
+ when :Date
211
+ Date.parse(value)
212
+ when :String
213
+ value.to_s
214
+ when :Integer
215
+ value.to_i
216
+ when :Float
217
+ value.to_f
218
+ when :BOOLEAN
219
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
220
+ true
221
+ else
222
+ false
223
+ end
224
+ when :Object
225
+ # generic object (usually a Hash), return directly
226
+ value
227
+ when /\AArray<(?<inner_type>.+)>\z/
228
+ inner_type = Regexp.last_match[:inner_type]
229
+ value.map { |v| _deserialize(inner_type, v) }
230
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
231
+ k_type = Regexp.last_match[:k_type]
232
+ v_type = Regexp.last_match[:v_type]
233
+ {}.tap do |hash|
234
+ value.each do |k, v|
235
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
+ end
237
+ end
238
+ else # model
239
+ _model = Object.const_get("PureCloud").const_get(type).new
240
+ _model.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ def to_s
245
+ to_hash.to_s
246
+ end
247
+
248
+ # to_body is an alias to to_body (backward compatibility))
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # return the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Method to output non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map{ |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+ end
@@ -0,0 +1,206 @@
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 CampaignRuleAction
21
+ attr_accessor :id
22
+
23
+ attr_accessor :parameters
24
+
25
+ attr_accessor :action_type
26
+
27
+ attr_accessor :campaign_rule_action_entities
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+
33
+ :'id' => :'id',
34
+
35
+ :'parameters' => :'parameters',
36
+
37
+ :'action_type' => :'actionType',
38
+
39
+ :'campaign_rule_action_entities' => :'campaignRuleActionEntities'
40
+
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'id' => :'String',
48
+ :'parameters' => :'Hash<String, String>',
49
+ :'action_type' => :'String',
50
+ :'campaign_rule_action_entities' => :'CampaignRuleActionEntities'
51
+
52
+ }
53
+ end
54
+
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
60
+
61
+
62
+ if attributes[:'id']
63
+ self.id = attributes[:'id']
64
+ end
65
+
66
+ if attributes[:'parameters']
67
+ if (value = attributes[:'parameters']).is_a?(Array)
68
+ self.parameters = value
69
+ end
70
+ end
71
+
72
+ if attributes[:'actionType']
73
+ self.action_type = attributes[:'actionType']
74
+ end
75
+
76
+ if attributes[:'campaignRuleActionEntities']
77
+ self.campaign_rule_action_entities = attributes[:'campaignRuleActionEntities']
78
+ end
79
+
80
+ end
81
+
82
+ # Custom attribute writer method checking allowed values (enum).
83
+ def action_type=(action_type)
84
+ allowed_values = ["turnOnCampaign", "turnOffCampaign", "turnOnSequence", "turnOffSequence", "setCampaignPriority", "recycleCampaign"]
85
+ if action_type && !allowed_values.include?(action_type)
86
+ fail "invalid value for 'action_type', must be one of #{allowed_values}"
87
+ end
88
+ @action_type = action_type
89
+ end
90
+
91
+ # Check equality by comparing each attribute.
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ id == o.id &&
96
+ parameters == o.parameters &&
97
+ action_type == o.action_type &&
98
+ campaign_rule_action_entities == o.campaign_rule_action_entities
99
+ end
100
+
101
+ # @see the `==` method
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculate hash code according to all attributes.
107
+ def hash
108
+ [id, parameters, action_type, campaign_rule_action_entities].hash
109
+ end
110
+
111
+ # build the object from hash
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /^Array<(.*)>/i
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
118
+ else
119
+ #TODO show warning in debug mode
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ else
124
+ # data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :DateTime
134
+ DateTime.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :BOOLEAN
144
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ _model = Object.const_get("PureCloud").const_get(type).new
165
+ _model.build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_body (backward compatibility))
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # return the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Method to output non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map{ |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end