mparticle 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7a6e50f3de49a07b31edbb8e64d0100d172f07e557c53ce2afa1e64a7afcc77
4
- data.tar.gz: e005d8bda1918bba72c7b47fe59761dfaa7b3931de76206e3324ef8d1275a1fb
3
+ metadata.gz: 8308b885dc052724e0e33e9c81c48b66962eaba058d4dbee48b23aa910c59409
4
+ data.tar.gz: 4ec2ce62682cc068114983cc33841cb589cc67d9c272c99ec41757c3d6397f7a
5
5
  SHA512:
6
- metadata.gz: 3360ce980762c548ac98bf1d921bacb263fe688149ef98a1c29e9e9803f3e2fa4b840c9d048b94951ebb0ae14515cbab30cfb0d4cc3b19a8bf237e989da6c97d
7
- data.tar.gz: dbbd4d8b4cc050d54d9f6b3b453cc777f5a746a742bebe0715704e1467667057dde256921a750b692f6977c048ba433a7e7bc0e0c3baac30f0a98d6c20533f8a
6
+ metadata.gz: aef4d8bfb6b787652096f7648d8e9d1e34f496143fc9ebda570dfb3980d2decec02b69b3ff883d187078e98904ecaeddb373bba2e5c1139097736297de8d1756
7
+ data.tar.gz: d59b4c4c687d46fa906629e7bca7bc420278356dec3f6bab162d480207bb9b8d073b82e068b3993bbea0317db581bf23de53eae2617c68e235d8bd1a069674d2
data/README.md CHANGED
@@ -41,6 +41,11 @@ api_instance = MParticle::EventsApi.new(config)
41
41
 
42
42
  batch = MParticle::Batch.new
43
43
  batch.environment = 'development'
44
+ batch.context = MParticle::BatchContext.new
45
+
46
+ batch.context.data_plan = MParticle::DataPlanContext.new
47
+ batch.context.data_plan.plan_id = 'my_plan_id'
48
+ batch.context.data_plan.plan_version = 1
44
49
 
45
50
  user_identities = MParticle::UserIdentities.new
46
51
  user_identities.customerid = '12345'
@@ -13,5 +13,17 @@ Name | Type | Description | Notes
13
13
  **email** | **String** | | [optional]
14
14
  **_alias** | **String** | | [optional]
15
15
  **facebook_custom_audience_id** | **String** | | [optional]
16
+ **other_id_2** | **String** | | [optional]
17
+ **other_id_3** | **String** | | [optional]
18
+ **other_id_4** | **String** | | [optional]
19
+ **other_id_5** | **String** | | [optional]
20
+ **other_id_6** | **String** | | [optional]
21
+ **other_id_7** | **String** | | [optional]
22
+ **other_id_8** | **String** | | [optional]
23
+ **other_id_9** | **String** | | [optional]
24
+ **other_id_10** | **String** | | [optional]
25
+ **mobile_number** | **String** | | [optional]
26
+ **phone_number_2** | **String** | | [optional]
27
+ **phone_number_3** | **String** | | [optional]
16
28
 
17
29
 
@@ -41,6 +41,8 @@ require 'mparticle/models/session_start_event'
41
41
  require 'mparticle/models/shopping_cart'
42
42
  require 'mparticle/models/source_information'
43
43
  require 'mparticle/models/user_identities'
44
+ require 'mparticle/models/batch_context'
45
+ require 'mparticle/models/data_plan_context'
44
46
 
45
47
  # APIs
46
48
  require 'mparticle/api/events_api'
@@ -19,7 +19,7 @@ module MParticle
19
19
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
20
20
  def initialize(config)
21
21
  @config = config
22
- @user_agent = "mParticle Ruby client/1.0.8"
22
+ @user_agent = "mParticle Ruby client/1.0.9"
23
23
  @default_headers = {
24
24
  'Content-Type' => "application/json",
25
25
  'User-Agent' => @user_agent
@@ -33,6 +33,8 @@ module MParticle
33
33
 
34
34
  attr_accessor :timestamp_unixtime_ms
35
35
 
36
+ attr_accessor :context
37
+
36
38
  class EnumAttributeValidator
37
39
  attr_reader :datatype
38
40
  attr_reader :allowable_values
@@ -112,7 +114,8 @@ module MParticle
112
114
  :'api_key' => :'api_key',
113
115
  :'mpid' => :'mpid',
114
116
  :'mp_deviceid' => :'mp_deviceid',
115
- :'timestamp_unixtime_ms' => :'timestamp_unixtime_ms'
117
+ :'timestamp_unixtime_ms' => :'timestamp_unixtime_ms',
118
+ :'context' => :'context'
116
119
  }
117
120
  end
118
121
 
@@ -132,7 +135,9 @@ module MParticle
132
135
  :'api_key' => :'String',
133
136
  :'mpid' => :'Integer',
134
137
  :'mp_deviceid' => :'String',
135
- :'timestamp_unixtime_ms' => :'Integer'
138
+ :'timestamp_unixtime_ms' => :'Integer',
139
+ :'consent_state' => :'ConsentState',
140
+ :'context' => :'BatchContext'
136
141
  }
137
142
  end
138
143
 
@@ -204,6 +209,14 @@ module MParticle
204
209
  self.timestamp_unixtime_ms = attributes[:'timestamp_unixtime_ms']
205
210
  end
206
211
 
212
+ if attributes.has_key?(:'consent_state')
213
+ self.consent_state = attributes[:'consent_state']
214
+ end
215
+
216
+ if attributes.has_key?(:'context')
217
+ self.context = attributes[:'context']
218
+ end
219
+
207
220
  end
208
221
 
209
222
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -0,0 +1,177 @@
1
+ require 'date'
2
+
3
+ module MParticle
4
+
5
+ class BatchContext
6
+ attr_accessor :data_plan
7
+
8
+
9
+ # Attribute mapping from ruby-style variable name to JSON key.
10
+ def self.attribute_map
11
+ {
12
+ :'data_plan' => :'data_plan'
13
+ }
14
+ end
15
+
16
+ # Attribute type mapping.
17
+ def self.swagger_types
18
+ {
19
+ :'data_plan' => :'DataPlanContext'
20
+ }
21
+ end
22
+
23
+ # Initializes the object
24
+ # @param [Hash] attributes Model attributes in the form of hash
25
+ def initialize(attributes = {})
26
+ return unless attributes.is_a?(Hash)
27
+
28
+ # convert string to symbol for hash key
29
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
30
+
31
+ if attributes.has_key?(:'data_plan')
32
+ self.data_plan = attributes[:'data_plan']
33
+ end
34
+
35
+ end
36
+
37
+ # Show invalid properties with the reasons. Usually used together with valid?
38
+ # @return Array for valid properies with the reasons
39
+ def list_invalid_properties
40
+ invalid_properties = Array.new
41
+ return invalid_properties
42
+ end
43
+
44
+ # Check to see if the all the properties in the model are valid
45
+ # @return true if the model is valid
46
+ def valid?
47
+ return true
48
+ end
49
+
50
+ # Checks equality by comparing each attribute.
51
+ # @param [Object] Object to be compared
52
+ def ==(o)
53
+ return true if self.equal?(o)
54
+ self.class == o.class &&
55
+ data_plan == o.data_plan
56
+
57
+ end
58
+
59
+ # @see the `==` method
60
+ # @param [Object] Object to be compared
61
+ def eql?(o)
62
+ self == o
63
+ end
64
+
65
+ # Calculates hash code according to all attributes.
66
+ # @return [Fixnum] Hash code
67
+ def hash
68
+ [data_plan].hash
69
+ end
70
+
71
+ # Builds the object from hash
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ # @return [Object] Returns the model itself
74
+ def build_from_hash(attributes)
75
+ return nil unless attributes.is_a?(Hash)
76
+ self.class.swagger_types.each_pair do |key, type|
77
+ if type =~ /\AArray<(.*)>/i
78
+ # check to ensure the input is an array given that the the attribute
79
+ # is documented as an array but the input is not
80
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
81
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
82
+ end
83
+ elsif !attributes[self.class.attribute_map[key]].nil?
84
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
85
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
86
+ end
87
+
88
+ self
89
+ end
90
+
91
+ # Deserializes the data based on type
92
+ # @param string type Data type
93
+ # @param string value Value to be deserialized
94
+ # @return [Object] Deserialized data
95
+ def _deserialize(type, value)
96
+ case type.to_sym
97
+ when :DateTime
98
+ DateTime.parse(value)
99
+ when :Date
100
+ Date.parse(value)
101
+ when :String
102
+ value.to_s
103
+ when :Integer
104
+ value.to_i
105
+ when :Float
106
+ value.to_f
107
+ when :BOOLEAN
108
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
109
+ true
110
+ else
111
+ false
112
+ end
113
+ when :Object
114
+ # generic object (usually a Hash), return directly
115
+ value
116
+ when /\AArray<(?<inner_type>.+)>\z/
117
+ inner_type = Regexp.last_match[:inner_type]
118
+ value.map { |v| _deserialize(inner_type, v) }
119
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
120
+ k_type = Regexp.last_match[:k_type]
121
+ v_type = Regexp.last_match[:v_type]
122
+ {}.tap do |hash|
123
+ value.each do |k, v|
124
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
125
+ end
126
+ end
127
+ else # model
128
+ temp_model = MParticle.const_get(type).new
129
+ temp_model.build_from_hash(value)
130
+ end
131
+ end
132
+
133
+ # Returns the string representation of the object
134
+ # @return [String] String presentation of the object
135
+ def to_s
136
+ to_hash.to_s
137
+ end
138
+
139
+ # to_body is an alias to to_hash (backward compatibility)
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_body
142
+ to_hash
143
+ end
144
+
145
+ # Returns the object in the form of hash
146
+ # @return [Hash] Returns the object in the form of hash
147
+ def to_hash
148
+ hash = {}
149
+ self.class.attribute_map.each_pair do |attr, param|
150
+ value = self.send(attr)
151
+ next if value.nil?
152
+ hash[param] = _to_hash(value)
153
+ end
154
+ hash
155
+ end
156
+
157
+ # Outputs non-array value in the form of hash
158
+ # For object, use to_hash. Otherwise, just return the value
159
+ # @param [Object] value Any valid value
160
+ # @return [Hash] Returns the value in the form of hash
161
+ def _to_hash(value)
162
+ if value.is_a?(Array)
163
+ value.compact.map{ |v| _to_hash(v) }
164
+ elsif value.is_a?(Hash)
165
+ {}.tap do |hash|
166
+ value.each { |k, v| hash[k] = _to_hash(v) }
167
+ end
168
+ elsif value.respond_to? :to_hash
169
+ value.to_hash
170
+ else
171
+ value
172
+ end
173
+ end
174
+
175
+ end
176
+
177
+ end
@@ -0,0 +1,186 @@
1
+ require 'date'
2
+
3
+ module MParticle
4
+
5
+ class DataPlanContext
6
+ attr_accessor :plan_id
7
+
8
+ attr_accessor :plan_version
9
+
10
+
11
+ # Attribute mapping from ruby-style variable name to JSON key.
12
+ def self.attribute_map
13
+ {
14
+ :'plan_id' => :'plan_id',
15
+ :'plan_version' => :'plan_version'
16
+ }
17
+ end
18
+
19
+ # Attribute type mapping.
20
+ def self.swagger_types
21
+ {
22
+ :'plan_id' => :'String',
23
+ :'plan_version' => :'Integer'
24
+ }
25
+ end
26
+
27
+ # Initializes the object
28
+ # @param [Hash] attributes Model attributes in the form of hash
29
+ def initialize(attributes = {})
30
+ return unless attributes.is_a?(Hash)
31
+
32
+ # convert string to symbol for hash key
33
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
34
+
35
+ if attributes.has_key?(:'plan_id')
36
+ self.plan_id = attributes[:'plan_id']
37
+ end
38
+
39
+ if attributes.has_key?(:'plan_version')
40
+ self.plan_version = attributes[:'plan_version']
41
+ end
42
+
43
+ end
44
+
45
+ # Show invalid properties with the reasons. Usually used together with valid?
46
+ # @return Array for valid properies with the reasons
47
+ def list_invalid_properties
48
+ invalid_properties = Array.new
49
+ return invalid_properties
50
+ end
51
+
52
+ # Check to see if the all the properties in the model are valid
53
+ # @return true if the model is valid
54
+ def valid?
55
+ return true
56
+ end
57
+
58
+ # Checks equality by comparing each attribute.
59
+ # @param [Object] Object to be compared
60
+ def ==(o)
61
+ return true if self.equal?(o)
62
+ self.class == o.class &&
63
+ plan_id == o.plan_id &&
64
+ plan_version == o.plan_version
65
+
66
+ end
67
+
68
+ # @see the `==` method
69
+ # @param [Object] Object to be compared
70
+ def eql?(o)
71
+ self == o
72
+ end
73
+
74
+ # Calculates hash code according to all attributes.
75
+ # @return [Fixnum] Hash code
76
+ def hash
77
+ [plan_id, plan_version].hash
78
+ end
79
+
80
+ # Builds the object from hash
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ # @return [Object] Returns the model itself
83
+ def build_from_hash(attributes)
84
+ return nil unless attributes.is_a?(Hash)
85
+ self.class.swagger_types.each_pair do |key, type|
86
+ if type =~ /\AArray<(.*)>/i
87
+ # check to ensure the input is an array given that the the attribute
88
+ # is documented as an array but the input is not
89
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
90
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
91
+ end
92
+ elsif !attributes[self.class.attribute_map[key]].nil?
93
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
94
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
95
+ end
96
+
97
+ self
98
+ end
99
+
100
+ # Deserializes the data based on type
101
+ # @param string type Data type
102
+ # @param string value Value to be deserialized
103
+ # @return [Object] Deserialized data
104
+ def _deserialize(type, value)
105
+ case type.to_sym
106
+ when :DateTime
107
+ DateTime.parse(value)
108
+ when :Date
109
+ Date.parse(value)
110
+ when :String
111
+ value.to_s
112
+ when :Integer
113
+ value.to_i
114
+ when :Float
115
+ value.to_f
116
+ when :BOOLEAN
117
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
118
+ true
119
+ else
120
+ false
121
+ end
122
+ when :Object
123
+ # generic object (usually a Hash), return directly
124
+ value
125
+ when /\AArray<(?<inner_type>.+)>\z/
126
+ inner_type = Regexp.last_match[:inner_type]
127
+ value.map { |v| _deserialize(inner_type, v) }
128
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
129
+ k_type = Regexp.last_match[:k_type]
130
+ v_type = Regexp.last_match[:v_type]
131
+ {}.tap do |hash|
132
+ value.each do |k, v|
133
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
134
+ end
135
+ end
136
+ else # model
137
+ temp_model = MParticle.const_get(type).new
138
+ temp_model.build_from_hash(value)
139
+ end
140
+ end
141
+
142
+ # Returns the string representation of the object
143
+ # @return [String] String presentation of the object
144
+ def to_s
145
+ to_hash.to_s
146
+ end
147
+
148
+ # to_body is an alias to to_hash (backward compatibility)
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_body
151
+ to_hash
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ next if value.nil?
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ # Outputs non-array value in the form of hash
167
+ # For object, use to_hash. Otherwise, just return the value
168
+ # @param [Object] value Any valid value
169
+ # @return [Hash] Returns the value in the form of hash
170
+ def _to_hash(value)
171
+ if value.is_a?(Array)
172
+ value.compact.map{ |v| _to_hash(v) }
173
+ elsif value.is_a?(Hash)
174
+ {}.tap do |hash|
175
+ value.each { |k, v| hash[k] = _to_hash(v) }
176
+ end
177
+ elsif value.respond_to? :to_hash
178
+ value.to_hash
179
+ else
180
+ value
181
+ end
182
+ end
183
+
184
+ end
185
+
186
+ end
@@ -23,6 +23,30 @@ module MParticle
23
23
 
24
24
  attr_accessor :facebook_custom_audience_id
25
25
 
26
+ attr_accessor :other_id_2
27
+
28
+ attr_accessor :other_id_3
29
+
30
+ attr_accessor :other_id_4
31
+
32
+ attr_accessor :other_id_5
33
+
34
+ attr_accessor :other_id_6
35
+
36
+ attr_accessor :other_id_7
37
+
38
+ attr_accessor :other_id_8
39
+
40
+ attr_accessor :other_id_9
41
+
42
+ attr_accessor :other_id_10
43
+
44
+ attr_accessor :mobile_number
45
+
46
+ attr_accessor :phone_number_2
47
+
48
+ attr_accessor :phone_number_3
49
+
26
50
 
27
51
  # Attribute mapping from ruby-style variable name to JSON key.
28
52
  def self.attribute_map
@@ -36,7 +60,19 @@ module MParticle
36
60
  :'yahoo' => :'yahoo',
37
61
  :'email' => :'email',
38
62
  :'_alias' => :'alias',
39
- :'facebook_custom_audience_id' => :'facebook_custom_audience_id'
63
+ :'facebook_custom_audience_id' => :'facebook_custom_audience_id',
64
+ :'other_id_2' => :'other_id_2',
65
+ :'other_id_3' => :'other_id_3',
66
+ :'other_id_4' => :'other_id_4',
67
+ :'other_id_5' => :'other_id_5',
68
+ :'other_id_6' => :'other_id_6',
69
+ :'other_id_7' => :'other_id_7',
70
+ :'other_id_8' => :'other_id_8',
71
+ :'other_id_9' => :'other_id_9',
72
+ :'other_id_10' => :'other_id_10',
73
+ :'mobile_number' => :'mobile_number',
74
+ :'phone_number_2' => :'phone_number_2',
75
+ :'phone_number_3' => :'phone_number_3'
40
76
  }
41
77
  end
42
78
 
@@ -52,7 +88,19 @@ module MParticle
52
88
  :'yahoo' => :'String',
53
89
  :'email' => :'String',
54
90
  :'_alias' => :'String',
55
- :'facebook_custom_audience_id' => :'String'
91
+ :'facebook_custom_audience_id' => :'String',
92
+ :'other_id_2' => :'String',
93
+ :'other_id_3' => :'String',
94
+ :'other_id_4' => :'String',
95
+ :'other_id_5' => :'String',
96
+ :'other_id_6' => :'String',
97
+ :'other_id_7' => :'String',
98
+ :'other_id_8' => :'String',
99
+ :'other_id_9' => :'String',
100
+ :'other_id_10' => :'String',
101
+ :'mobile_number' => :'String',
102
+ :'phone_number_2' => :'String',
103
+ :'phone_number_3' => :'String'
56
104
  }
57
105
  end
58
106
 
@@ -104,6 +152,54 @@ module MParticle
104
152
  self.facebook_custom_audience_id = attributes[:'facebook_custom_audience_id']
105
153
  end
106
154
 
155
+ if attributes.has_key?(:'other_id_2')
156
+ self.other_id_2 = attributes[:'other_id_2']
157
+ end
158
+
159
+ if attributes.has_key?(:'other_id_3')
160
+ self.other_id_3 = attributes[:'other_id_3']
161
+ end
162
+
163
+ if attributes.has_key?(:'other_id_4')
164
+ self.other_id_4 = attributes[:'other_id_4']
165
+ end
166
+
167
+ if attributes.has_key?(:'other_id_5')
168
+ self.other_id_5 = attributes[:'other_id_5']
169
+ end
170
+
171
+ if attributes.has_key?(:'other_id_6')
172
+ self.other_id_6 = attributes[:'other_id_6']
173
+ end
174
+
175
+ if attributes.has_key?(:'other_id_7')
176
+ self.other_id_7 = attributes[:'other_id_7']
177
+ end
178
+
179
+ if attributes.has_key?(:'other_id_8')
180
+ self.other_id_8 = attributes[:'other_id_8']
181
+ end
182
+
183
+ if attributes.has_key?(:'other_id_9')
184
+ self.other_id_9 = attributes[:'other_id_9']
185
+ end
186
+
187
+ if attributes.has_key?(:'other_id_10')
188
+ self.other_id_10 = attributes[:'other_id_10']
189
+ end
190
+
191
+ if attributes.has_key?(:'mobile_number')
192
+ self.mobile_number = attributes[:'mobile_number']
193
+ end
194
+
195
+ if attributes.has_key?(:'phone_number_2')
196
+ self.phone_number_2 = attributes[:'phone_number_2']
197
+ end
198
+
199
+ if attributes.has_key?(:'phone_number_3')
200
+ self.phone_number_3 = attributes[:'phone_number_3']
201
+ end
202
+
107
203
  end
108
204
 
109
205
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -133,7 +229,19 @@ module MParticle
133
229
  yahoo == o.yahoo &&
134
230
  email == o.email &&
135
231
  _alias == o._alias &&
136
- facebook_custom_audience_id == o.facebook_custom_audience_id
232
+ facebook_custom_audience_id == o.facebook_custom_audience_id &&
233
+ other_id_2 == o.other_id_2 &&
234
+ other_id_3 == o.other_id_3 &&
235
+ other_id_4 == o.other_id_4 &&
236
+ other_id_5 == o.other_id_5 &&
237
+ other_id_6 == o.other_id_6 &&
238
+ other_id_7 == o.other_id_7 &&
239
+ other_id_8 == o.other_id_8 &&
240
+ other_id_9 == o.other_id_9 &&
241
+ other_id_10 == o.other_id_10 &&
242
+ mobile_number == o.mobile_number &&
243
+ phone_number_2 == o.phone_number_2 &&
244
+ phone_number_3 == o.phone_number_3
137
245
  end
138
246
 
139
247
  # @see the `==` method
@@ -145,7 +253,7 @@ module MParticle
145
253
  # Calculates hash code according to all attributes.
146
254
  # @return [Fixnum] Hash code
147
255
  def hash
148
- [other, customerid, facebook, twitter, google, microsoft, yahoo, email, _alias, facebook_custom_audience_id].hash
256
+ [other, customerid, facebook, twitter, google, microsoft, yahoo, email, _alias, facebook_custom_audience_id, other_id_2, other_id_3, other_id_4, other_id_5, other_id_6, other_id_7, other_id_8, other_id_9, other_id_10, mobile_number, phone_number_2, phone_number_3].hash
149
257
  end
150
258
 
151
259
  # Builds the object from hash
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "mparticle"
3
- s.version = "1.0.8"
3
+ s.version = "1.0.9"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["mParticle Inc."]
6
6
  s.email = ["support@mparticle.com"]
@@ -0,0 +1,19 @@
1
+ require 'mparticle'
2
+
3
+ describe 'DataPlanContext' do
4
+ it 'should create an instance of DataPlanContext' do
5
+ model = MParticle::DataPlanContext.new
6
+ expect(model).to be_an_instance_of MParticle::DataPlanContext
7
+ end
8
+
9
+ it 'should set context on batch' do
10
+ batch_model = MParticle::Batch.new
11
+ batch_model.context = MParticle::BatchContext.new
12
+ batch_model.context.data_plan = MParticle::DataPlanContext.new
13
+ batch_model.context.data_plan.plan_id = 'foo_dp_id'
14
+ batch_model.context.data_plan.plan_version = 5
15
+ expect(batch_model.context.data_plan.plan_id).to eq('foo_dp_id')
16
+ expect(batch_model.context.data_plan.plan_version).to eq(5)
17
+ end
18
+
19
+ end
@@ -0,0 +1,59 @@
1
+ require 'mparticle'
2
+
3
+ describe 'UserIdentities' do
4
+ it 'should create an instance of UserIdentities' do
5
+ model = MParticle::UserIdentities.new
6
+ expect(model).to be_an_instance_of MParticle::UserIdentities
7
+ end
8
+
9
+ it 'should set all identities' do
10
+ model = MParticle::UserIdentities.new
11
+ model.other = 'foo_other'
12
+ expect(model.other).to eq('foo_other')
13
+ model.customerid = 'foo_customerid'
14
+ expect(model.customerid).to eq('foo_customerid')
15
+ model.facebook = 'foo_facebook'
16
+ expect(model.facebook).to eq('foo_facebook')
17
+ model.twitter = 'foo_twitter'
18
+ expect(model.twitter).to eq('foo_twitter')
19
+ model.google = 'foo_google'
20
+ expect(model.google).to eq('foo_google')
21
+ model.microsoft = 'foo_microsoft'
22
+ expect(model.microsoft).to eq('foo_microsoft')
23
+ model.yahoo = 'foo_yahoo'
24
+ expect(model.yahoo).to eq('foo_yahoo')
25
+ model.email = 'foo_email'
26
+ expect(model.email).to eq('foo_email')
27
+ model._alias = 'foo_alias'
28
+ expect(model._alias).to eq('foo_alias')
29
+ model.facebook_custom_audience_id = 'foo_fbid'
30
+ expect(model.facebook_custom_audience_id).to eq('foo_fbid')
31
+ model.other_id_2 = 'foo_other_id_2'
32
+ expect(model.other_id_2).to eq('foo_other_id_2')
33
+ model.other_id_3 = 'foo_other_id_3'
34
+ expect(model.other_id_3).to eq('foo_other_id_3')
35
+ model.other_id_4 = 'foo_other_id_4'
36
+ expect(model.other_id_4).to eq('foo_other_id_4')
37
+ model.other_id_5 = 'foo_other_id_5'
38
+ expect(model.other_id_5).to eq('foo_other_id_5')
39
+ model.other_id_6 = 'foo_other_id_6'
40
+ expect(model.other_id_6).to eq('foo_other_id_6')
41
+ model.other_id_7 = 'foo_other_id_7'
42
+ expect(model.other_id_7).to eq('foo_other_id_7')
43
+ model.other_id_8 = 'foo_other_id_8'
44
+ expect(model.other_id_8).to eq('foo_other_id_8')
45
+ model.other_id_9 = 'foo_other_id_9'
46
+ expect(model.other_id_9).to eq('foo_other_id_9')
47
+ model.other_id_10 = 'foo_other_id_10'
48
+ expect(model.other_id_10).to eq('foo_other_id_10')
49
+ model.mobile_number = 'foo_mobile_number'
50
+ expect(model.mobile_number).to eq('foo_mobile_number')
51
+ model.phone_number_2 = 'foo_phone_number_2'
52
+ expect(model.phone_number_2).to eq('foo_phone_number_2')
53
+ model.phone_number_3 = 'foo_phone_number_3'
54
+ expect(model.phone_number_3).to eq('foo_phone_number_3')
55
+
56
+
57
+ end
58
+
59
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mparticle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - mParticle Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2020-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -108,11 +108,13 @@ files:
108
108
  - lib/mparticle/models/application_state_transition_event.rb
109
109
  - lib/mparticle/models/attribution_info.rb
110
110
  - lib/mparticle/models/batch.rb
111
+ - lib/mparticle/models/batch_context.rb
111
112
  - lib/mparticle/models/breadcrumb_event.rb
112
113
  - lib/mparticle/models/ccpa_consent_state.rb
113
114
  - lib/mparticle/models/commerce_event.rb
114
115
  - lib/mparticle/models/consent_state.rb
115
116
  - lib/mparticle/models/crash_report_event.rb
117
+ - lib/mparticle/models/data_plan_context.rb
116
118
  - lib/mparticle/models/device_current_state.rb
117
119
  - lib/mparticle/models/device_information.rb
118
120
  - lib/mparticle/models/event_base.rb
@@ -143,9 +145,11 @@ files:
143
145
  - spec/models/ccpa_consent_state_spec.rb
144
146
  - spec/models/commerce_event_spec.rb
145
147
  - spec/models/consent_state_spec.rb
148
+ - spec/models/data_plan_context_spec.rb
146
149
  - spec/models/gdpr_consent_state_spec.rb
147
150
  - spec/models/product_spec.rb
148
151
  - spec/models/screen_view_event_spec.rb
152
+ - spec/models/user_identities_spec.rb
149
153
  homepage: https://www.mparticle.com
150
154
  licenses:
151
155
  - Apache-2.0