braze_api_client 0.1.0
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE.md +9 -0
- data/README.md +191 -0
- data/Rakefile +10 -0
- data/braze_api_client.gemspec +38 -0
- data/docs/Attributes.md +58 -0
- data/docs/AttributesArray.md +18 -0
- data/docs/AttributesCurrentLocation.md +20 -0
- data/docs/AttributesFacebook.md +22 -0
- data/docs/AttributesPushTokens.md +22 -0
- data/docs/AttributesTwitter.md +26 -0
- data/docs/Event.md +26 -0
- data/docs/EventsArray.md +18 -0
- data/docs/GeneralError.md +20 -0
- data/docs/Identifier.md +51 -0
- data/docs/IdentifierOneOf.md +18 -0
- data/docs/IdentifierOneOf1.md +18 -0
- data/docs/IdentifierOneOf2.md +18 -0
- data/docs/RestApi.md +427 -0
- data/docs/UsersTrackRequest.md +18 -0
- data/docs/UsersTrackResponse.md +24 -0
- data/git_push.sh +16 -0
- data/lib/braze_api_client/api/rest_api.rb +400 -0
- data/lib/braze_api_client/api_client.rb +390 -0
- data/lib/braze_api_client/api_error.rb +57 -0
- data/lib/braze_api_client/configuration.rb +294 -0
- data/lib/braze_api_client/models/attributes.rb +458 -0
- data/lib/braze_api_client/models/attributes_array.rb +225 -0
- data/lib/braze_api_client/models/attributes_current_location.rb +227 -0
- data/lib/braze_api_client/models/attributes_facebook.rb +238 -0
- data/lib/braze_api_client/models/attributes_push_tokens.rb +246 -0
- data/lib/braze_api_client/models/attributes_twitter.rb +254 -0
- data/lib/braze_api_client/models/event.rb +264 -0
- data/lib/braze_api_client/models/events_array.rb +220 -0
- data/lib/braze_api_client/models/general_error.rb +227 -0
- data/lib/braze_api_client/models/identifier.rb +106 -0
- data/lib/braze_api_client/models/identifier_one_of.rb +223 -0
- data/lib/braze_api_client/models/identifier_one_of1.rb +223 -0
- data/lib/braze_api_client/models/identifier_one_of2.rb +223 -0
- data/lib/braze_api_client/models/users_track_request.rb +245 -0
- data/lib/braze_api_client/models/users_track_response.rb +245 -0
- data/lib/braze_api_client/version.rb +15 -0
- data/lib/braze_api_client.rb +55 -0
- data/spec/api/rest_api_spec.rb +101 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/attributes_array_spec.rb +34 -0
- data/spec/models/attributes_current_location_spec.rb +40 -0
- data/spec/models/attributes_facebook_spec.rb +46 -0
- data/spec/models/attributes_push_tokens_spec.rb +46 -0
- data/spec/models/attributes_spec.rb +166 -0
- data/spec/models/attributes_twitter_spec.rb +58 -0
- data/spec/models/event_spec.rb +58 -0
- data/spec/models/events_array_spec.rb +34 -0
- data/spec/models/general_error_spec.rb +40 -0
- data/spec/models/identifier_one_of1_spec.rb +34 -0
- data/spec/models/identifier_one_of2_spec.rb +34 -0
- data/spec/models/identifier_one_of_spec.rb +34 -0
- data/spec/models/identifier_spec.rb +31 -0
- data/spec/models/users_track_request_spec.rb +34 -0
- data/spec/models/users_track_response_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +164 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
=begin
|
2
|
+
#Braze
|
3
|
+
|
4
|
+
#Track users, send messages, export data, and more
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module BrazeClient
|
17
|
+
class UsersTrackRequest
|
18
|
+
attr_accessor :attributes
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'attributes' => :'attributes'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'attributes' => :'Array<Event>'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of class defined in anyOf (OpenAPI v3)
|
46
|
+
def self.openapi_any_of
|
47
|
+
[
|
48
|
+
:'AttributesArray',
|
49
|
+
:'EventsArray'
|
50
|
+
]
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BrazeClient::UsersTrackRequest` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BrazeClient::UsersTrackRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'attributes')
|
69
|
+
if (value = attributes[:'attributes']).is_a?(Array)
|
70
|
+
self.attributes = value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if @attributes.nil?
|
80
|
+
invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
|
81
|
+
end
|
82
|
+
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
return false if @attributes.nil?
|
90
|
+
_any_of_found = false
|
91
|
+
self.class.openapi_any_of.each do |_class|
|
92
|
+
_any_of = BrazeClient.const_get(_class).build_from_hash(self.to_hash)
|
93
|
+
if _any_of.valid?
|
94
|
+
_any_of_found = true
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
if !_any_of_found
|
99
|
+
return false
|
100
|
+
end
|
101
|
+
|
102
|
+
true
|
103
|
+
end
|
104
|
+
|
105
|
+
# Checks equality by comparing each attribute.
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def ==(o)
|
108
|
+
return true if self.equal?(o)
|
109
|
+
self.class == o.class &&
|
110
|
+
attributes == o.attributes
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(o)
|
116
|
+
self == o
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Integer] Hash code
|
121
|
+
def hash
|
122
|
+
[attributes].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def self.build_from_hash(attributes)
|
129
|
+
new.build_from_hash(attributes)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.openapi_types.each_pair do |key, type|
|
138
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
139
|
+
self.send("#{key}=", nil)
|
140
|
+
elsif type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def _deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :Time
|
161
|
+
Time.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :Boolean
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
# models (e.g. Pet) or oneOf
|
192
|
+
klass = BrazeClient.const_get(type)
|
193
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
@@ -0,0 +1,245 @@
|
|
1
|
+
=begin
|
2
|
+
#Braze
|
3
|
+
|
4
|
+
#Track users, send messages, export data, and more
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module BrazeClient
|
17
|
+
class UsersTrackResponse
|
18
|
+
attr_accessor :message
|
19
|
+
|
20
|
+
attr_accessor :attributes_processed
|
21
|
+
|
22
|
+
attr_accessor :events_processed
|
23
|
+
|
24
|
+
attr_accessor :purchases_processed
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'message' => :'message',
|
30
|
+
:'attributes_processed' => :'attributes_processed',
|
31
|
+
:'events_processed' => :'events_processed',
|
32
|
+
:'purchases_processed' => :'purchases_processed'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
41
|
+
# Attribute type mapping.
|
42
|
+
def self.openapi_types
|
43
|
+
{
|
44
|
+
:'message' => :'String',
|
45
|
+
:'attributes_processed' => :'Integer',
|
46
|
+
:'events_processed' => :'Integer',
|
47
|
+
:'purchases_processed' => :'Integer'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BrazeClient::UsersTrackResponse` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BrazeClient::UsersTrackResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'message')
|
73
|
+
self.message = attributes[:'message']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'attributes_processed')
|
77
|
+
self.attributes_processed = attributes[:'attributes_processed']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'events_processed')
|
81
|
+
self.events_processed = attributes[:'events_processed']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'purchases_processed')
|
85
|
+
self.purchases_processed = attributes[:'purchases_processed']
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
90
|
+
# @return Array for valid properties with the reasons
|
91
|
+
def list_invalid_properties
|
92
|
+
invalid_properties = Array.new
|
93
|
+
invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
true
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks equality by comparing each attribute.
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def ==(o)
|
105
|
+
return true if self.equal?(o)
|
106
|
+
self.class == o.class &&
|
107
|
+
message == o.message &&
|
108
|
+
attributes_processed == o.attributes_processed &&
|
109
|
+
events_processed == o.events_processed &&
|
110
|
+
purchases_processed == o.purchases_processed
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(o)
|
116
|
+
self == o
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Integer] Hash code
|
121
|
+
def hash
|
122
|
+
[message, attributes_processed, events_processed, purchases_processed].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def self.build_from_hash(attributes)
|
129
|
+
new.build_from_hash(attributes)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.openapi_types.each_pair do |key, type|
|
138
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
139
|
+
self.send("#{key}=", nil)
|
140
|
+
elsif type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def _deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :Time
|
161
|
+
Time.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :Boolean
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
# models (e.g. Pet) or oneOf
|
192
|
+
klass = BrazeClient.const_get(type)
|
193
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
=begin
|
2
|
+
#Braze
|
3
|
+
|
4
|
+
#Track users, send messages, export data, and more
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module BrazeClient
|
14
|
+
VERSION = '0.1.0'
|
15
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
=begin
|
2
|
+
#Braze
|
3
|
+
|
4
|
+
#Track users, send messages, export data, and more
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'braze_api_client/api_client'
|
15
|
+
require 'braze_api_client/api_error'
|
16
|
+
require 'braze_api_client/version'
|
17
|
+
require 'braze_api_client/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'braze_api_client/models/attributes'
|
21
|
+
require 'braze_api_client/models/attributes_array'
|
22
|
+
require 'braze_api_client/models/attributes_current_location'
|
23
|
+
require 'braze_api_client/models/attributes_facebook'
|
24
|
+
require 'braze_api_client/models/attributes_push_tokens'
|
25
|
+
require 'braze_api_client/models/attributes_twitter'
|
26
|
+
require 'braze_api_client/models/event'
|
27
|
+
require 'braze_api_client/models/events_array'
|
28
|
+
require 'braze_api_client/models/general_error'
|
29
|
+
require 'braze_api_client/models/identifier'
|
30
|
+
require 'braze_api_client/models/identifier_one_of'
|
31
|
+
require 'braze_api_client/models/identifier_one_of1'
|
32
|
+
require 'braze_api_client/models/identifier_one_of2'
|
33
|
+
require 'braze_api_client/models/users_track_request'
|
34
|
+
require 'braze_api_client/models/users_track_response'
|
35
|
+
|
36
|
+
# APIs
|
37
|
+
require 'braze_api_client/api/rest_api'
|
38
|
+
|
39
|
+
module BrazeClient
|
40
|
+
class << self
|
41
|
+
# Customize default settings for the SDK using block.
|
42
|
+
# BrazeClient.configure do |config|
|
43
|
+
# config.username = "xxx"
|
44
|
+
# config.password = "xxx"
|
45
|
+
# end
|
46
|
+
# If no block given, return the default Configuration object.
|
47
|
+
def configure
|
48
|
+
if block_given?
|
49
|
+
yield(Configuration.default)
|
50
|
+
else
|
51
|
+
Configuration.default
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
=begin
|
2
|
+
#Braze
|
3
|
+
|
4
|
+
#Track users, send messages, export data, and more
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for BrazeClient::RestApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'RestApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = BrazeClient::RestApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of RestApi' do
|
30
|
+
it 'should create an instance of RestApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(BrazeClient::RestApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for delete_users
|
36
|
+
# Delete any user profile by specifying a known user identifier
|
37
|
+
# @param body
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @return [Object]
|
40
|
+
describe 'delete_users test' do
|
41
|
+
it 'should work' do
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# unit tests for identify_users
|
47
|
+
# Identify an unidentified (alias-only) user
|
48
|
+
# @param body
|
49
|
+
# @param [Hash] opts the optional parameters
|
50
|
+
# @return [Object]
|
51
|
+
describe 'identify_users test' do
|
52
|
+
it 'should work' do
|
53
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# unit tests for new_user_aliases
|
58
|
+
# Add new user aliases for existing identified users or create new unidentified users
|
59
|
+
# @param body
|
60
|
+
# @param [Hash] opts the optional parameters
|
61
|
+
# @return [Object]
|
62
|
+
describe 'new_user_aliases test' do
|
63
|
+
it 'should work' do
|
64
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# unit tests for remove_external_ids
|
69
|
+
# Remove your users' old deprecated external IDs. This endpoint completely removes the deprecated ID and cannot be undone.
|
70
|
+
# @param body
|
71
|
+
# @param [Hash] opts the optional parameters
|
72
|
+
# @return [Object]
|
73
|
+
describe 'remove_external_ids test' do
|
74
|
+
it 'should work' do
|
75
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# unit tests for rename_external_ids
|
80
|
+
# Set a new (primary) external_id for the user and deprecate their existing external_id
|
81
|
+
# @param body
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [Object]
|
84
|
+
describe 'rename_external_ids test' do
|
85
|
+
it 'should work' do
|
86
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# unit tests for track_users
|
91
|
+
# Record custom events, purchases, and update user profile attributes
|
92
|
+
# @param users_track_request
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [UsersTrackResponse]
|
95
|
+
describe 'track_users test' do
|
96
|
+
it 'should work' do
|
97
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|