pingram 1.0.36 → 1.0.38
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/pingram/api/account_api.rb +244 -2
- data/lib/pingram/api/library_api.rb +2 -2
- data/lib/pingram/api/logs_api.rb +61 -0
- data/lib/pingram/api/profile_api.rb +0 -66
- data/lib/pingram/api/webhooks_api.rb +4 -4
- data/lib/pingram/api_client.rb +1 -1
- data/lib/pingram/models/account_get_response.rb +13 -4
- data/lib/pingram/models/account_get_response_billing_alerts.rb +224 -0
- data/lib/pingram/models/account_patch_request.rb +13 -4
- data/lib/pingram/models/billing_email.rb +177 -0
- data/lib/pingram/models/billing_post_response_body.rb +10 -1
- data/lib/pingram/models/cancel_subscription_request.rb +168 -0
- data/lib/pingram/models/{change_email_request.rb → confirm_change_email_request.rb} +19 -19
- data/lib/pingram/models/create_library_request.rb +1 -1
- data/lib/pingram/models/get_logs_response_messages_inner.rb +4 -0
- data/lib/pingram/models/get_logs_response_messages_inner_attachments_inner.rb +52 -4
- data/lib/pingram/models/logs_get_response_logs_inner.rb +60 -1
- data/lib/pingram/models/phone_verify_start_response.rb +14 -4
- data/lib/pingram/models/sender_post_body_sms.rb +1 -1
- data/lib/pingram/models/sender_post_body_sms_auto_reply.rb +2 -1
- data/lib/pingram/models/slack_connect_invite_response.rb +190 -0
- data/lib/pingram/models/start_change_email_request.rb +201 -0
- data/lib/pingram/models/update_billing_email_request.rb +184 -0
- data/lib/pingram/models/webhook_endpoint_upsert_request.rb +1 -1
- data/lib/pingram/models/webhook_event.rb +88 -6
- data/lib/pingram/models/webhook_event_usage_value.rb +193 -0
- data/lib/pingram/version.rb +1 -1
- data/lib/pingram.rb +8 -1
- data/vendor/bundle/ruby/3.2.0/cache/date-3.6.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.6.0/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.6.0/gem_make.out +26 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{date-3.5.1 → date-3.6.0}/mkmf.log +55 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/mkmf.log +3 -3
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/Makefile +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_core.c +293 -77
- data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_parse.c +14 -4
- data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strptime.c +13 -13
- data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/extconf.rb +6 -0
- data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/lib/date.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/date-3.6.0/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{date-3.5.1.gemspec → date-3.6.0.gemspec} +3 -3
- metadata +31 -24
- data/vendor/bundle/ruby/3.2.0/cache/date-3.5.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +0 -24
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/lib/date_core.so +0 -0
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{date-3.5.1 → date-3.6.0}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strftime.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_tmx.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/prereq.mk +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.list +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Pingram
|
|
17
|
+
class StartChangeEmailRequest < ApiModelBase
|
|
18
|
+
attr_accessor :new_email
|
|
19
|
+
|
|
20
|
+
# Current account password. Required before a login-email change starts.
|
|
21
|
+
attr_accessor :password
|
|
22
|
+
|
|
23
|
+
# TOTP code. Required when software-token MFA is enabled.
|
|
24
|
+
attr_accessor :mfa_code
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'new_email' => :'newEmail',
|
|
30
|
+
:'password' => :'password',
|
|
31
|
+
:'mfa_code' => :'mfaCode'
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns attribute mapping this model knows about
|
|
36
|
+
def self.acceptable_attribute_map
|
|
37
|
+
attribute_map
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
|
41
|
+
def self.acceptable_attributes
|
|
42
|
+
acceptable_attribute_map.values
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute type mapping.
|
|
46
|
+
def self.openapi_types
|
|
47
|
+
{
|
|
48
|
+
:'new_email' => :'String',
|
|
49
|
+
:'password' => :'String',
|
|
50
|
+
:'mfa_code' => :'String'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# List of attributes with nullable: true
|
|
55
|
+
def self.openapi_nullable
|
|
56
|
+
Set.new([
|
|
57
|
+
])
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Initializes the object
|
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
62
|
+
def initialize(attributes = {})
|
|
63
|
+
if (!attributes.is_a?(Hash))
|
|
64
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::StartChangeEmailRequest` initialize method"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
68
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::StartChangeEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
72
|
+
end
|
|
73
|
+
h[k.to_sym] = v
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'new_email')
|
|
77
|
+
self.new_email = attributes[:'new_email']
|
|
78
|
+
else
|
|
79
|
+
self.new_email = nil
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'password')
|
|
83
|
+
self.password = attributes[:'password']
|
|
84
|
+
else
|
|
85
|
+
self.password = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'mfa_code')
|
|
89
|
+
self.mfa_code = attributes[:'mfa_code']
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
97
|
+
invalid_properties = Array.new
|
|
98
|
+
if @new_email.nil?
|
|
99
|
+
invalid_properties.push('invalid value for "new_email", new_email cannot be nil.')
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if @password.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "password", password cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
return false if @new_email.nil?
|
|
114
|
+
return false if @password.nil?
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] new_email Value to be assigned
|
|
120
|
+
def new_email=(new_email)
|
|
121
|
+
if new_email.nil?
|
|
122
|
+
fail ArgumentError, 'new_email cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@new_email = new_email
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Custom attribute writer method with validation
|
|
129
|
+
# @param [Object] password Value to be assigned
|
|
130
|
+
def password=(password)
|
|
131
|
+
if password.nil?
|
|
132
|
+
fail ArgumentError, 'password cannot be nil'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
@password = password
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Checks equality by comparing each attribute.
|
|
139
|
+
# @param [Object] Object to be compared
|
|
140
|
+
def ==(o)
|
|
141
|
+
return true if self.equal?(o)
|
|
142
|
+
self.class == o.class &&
|
|
143
|
+
new_email == o.new_email &&
|
|
144
|
+
password == o.password &&
|
|
145
|
+
mfa_code == o.mfa_code
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# @see the `==` method
|
|
149
|
+
# @param [Object] Object to be compared
|
|
150
|
+
def eql?(o)
|
|
151
|
+
self == o
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Calculates hash code according to all attributes.
|
|
155
|
+
# @return [Integer] Hash code
|
|
156
|
+
def hash
|
|
157
|
+
[new_email, password, mfa_code].hash
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Builds the object from hash
|
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
162
|
+
# @return [Object] Returns the model itself
|
|
163
|
+
def self.build_from_hash(attributes)
|
|
164
|
+
return nil unless attributes.is_a?(Hash)
|
|
165
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
166
|
+
transformed_hash = {}
|
|
167
|
+
openapi_types.each_pair do |key, type|
|
|
168
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = nil
|
|
170
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
171
|
+
# check to ensure the input is an array given that the attribute
|
|
172
|
+
# is documented as an array but the input is not
|
|
173
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
174
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
175
|
+
end
|
|
176
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
177
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
new(transformed_hash)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Returns the object in the form of hash
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_hash
|
|
186
|
+
hash = {}
|
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
188
|
+
value = self.send(attr)
|
|
189
|
+
if value.nil?
|
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
hash[param] = _to_hash(value)
|
|
195
|
+
end
|
|
196
|
+
hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pingram
|
|
3
|
+
|
|
4
|
+
#Internal API for notification delivery and management
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Pingram
|
|
17
|
+
# PATCH /account/billing-email request.
|
|
18
|
+
class UpdateBillingEmailRequest < ApiModelBase
|
|
19
|
+
# Address that receives invoices and receipts.
|
|
20
|
+
attr_accessor :email
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'email' => :'email'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
|
35
|
+
def self.acceptable_attributes
|
|
36
|
+
acceptable_attribute_map.values
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.openapi_types
|
|
41
|
+
{
|
|
42
|
+
:'email' => :'String'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Initializes the object
|
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
|
+
def initialize(attributes = {})
|
|
55
|
+
if (!attributes.is_a?(Hash))
|
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::UpdateBillingEmailRequest` initialize method"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::UpdateBillingEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
|
+
end
|
|
65
|
+
h[k.to_sym] = v
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if attributes.key?(:'email')
|
|
69
|
+
self.email = attributes[:'email']
|
|
70
|
+
else
|
|
71
|
+
self.email = nil
|
|
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
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
79
|
+
invalid_properties = Array.new
|
|
80
|
+
if @email.nil?
|
|
81
|
+
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if @email.to_s.length > 320
|
|
85
|
+
invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 320.')
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if @email.to_s.length < 3
|
|
89
|
+
invalid_properties.push('invalid value for "email", the character length must be greater than or equal to 3.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
99
|
+
return false if @email.nil?
|
|
100
|
+
return false if @email.to_s.length > 320
|
|
101
|
+
return false if @email.to_s.length < 3
|
|
102
|
+
true
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Custom attribute writer method with validation
|
|
106
|
+
# @param [Object] email Value to be assigned
|
|
107
|
+
def email=(email)
|
|
108
|
+
if email.nil?
|
|
109
|
+
fail ArgumentError, 'email cannot be nil'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if email.to_s.length > 320
|
|
113
|
+
fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 320.'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if email.to_s.length < 3
|
|
117
|
+
fail ArgumentError, 'invalid value for "email", the character length must be greater than or equal to 3.'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
@email = email
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Checks equality by comparing each attribute.
|
|
124
|
+
# @param [Object] Object to be compared
|
|
125
|
+
def ==(o)
|
|
126
|
+
return true if self.equal?(o)
|
|
127
|
+
self.class == o.class &&
|
|
128
|
+
email == o.email
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# @see the `==` method
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def eql?(o)
|
|
134
|
+
self == o
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Calculates hash code according to all attributes.
|
|
138
|
+
# @return [Integer] Hash code
|
|
139
|
+
def hash
|
|
140
|
+
[email].hash
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Builds the object from hash
|
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
+
# @return [Object] Returns the model itself
|
|
146
|
+
def self.build_from_hash(attributes)
|
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
149
|
+
transformed_hash = {}
|
|
150
|
+
openapi_types.each_pair do |key, type|
|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
152
|
+
transformed_hash["#{key}"] = nil
|
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
154
|
+
# check to ensure the input is an array given that the attribute
|
|
155
|
+
# is documented as an array but the input is not
|
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
158
|
+
end
|
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
new(transformed_hash)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns the object in the form of hash
|
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
|
168
|
+
def to_hash
|
|
169
|
+
hash = {}
|
|
170
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
171
|
+
value = self.send(attr)
|
|
172
|
+
if value.nil?
|
|
173
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
174
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
hash[param] = _to_hash(value)
|
|
178
|
+
end
|
|
179
|
+
hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
end
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
|
16
16
|
module Pingram
|
|
17
17
|
# Request body for creating or updating an events webhook endpoint.
|
|
18
18
|
class WebhookEndpointUpsertRequest < ApiModelBase
|
|
19
|
-
# Public
|
|
19
|
+
# Public HTTPS URL that accepts POST with a JSON event body. Return 2xx to acknowledge. Private, loopback, and link-local addresses are rejected. Requests include X-Pingram-Id, X-Pingram-Signature (v1 HMAC-SHA256), and X-Pingram-Timestamp.
|
|
20
20
|
attr_accessor :webhook
|
|
21
21
|
|
|
22
22
|
# Full set of event types to deliver to this URL. Omitting an event on update unsubscribes it. Inbound SMS to the free shared number only works when that person has already received a text from this number. Inbound SMS to a dedicated number works normally.
|
|
@@ -38,6 +38,30 @@ module Pingram
|
|
|
38
38
|
# Link tags for EMAIL_CLICK events.
|
|
39
39
|
attr_accessor :clicked_link_tags
|
|
40
40
|
|
|
41
|
+
# Account id, for ACCOUNT_USAGE.
|
|
42
|
+
attr_accessor :account_id
|
|
43
|
+
|
|
44
|
+
# Billing period start (YYYY-MM-DD), for ACCOUNT_USAGE.
|
|
45
|
+
attr_accessor :year_month_day
|
|
46
|
+
|
|
47
|
+
# Date the monthly budget resets (YYYY-MM-DD), for ACCOUNT_USAGE.
|
|
48
|
+
attr_accessor :resets_on
|
|
49
|
+
|
|
50
|
+
# Whole percent of the monthly budget used, for ACCOUNT_USAGE.
|
|
51
|
+
attr_accessor :percent
|
|
52
|
+
|
|
53
|
+
# Amount spent against the monthly budget, for ACCOUNT_USAGE.
|
|
54
|
+
attr_accessor :spent
|
|
55
|
+
|
|
56
|
+
# Monthly budget the percent was measured against, for ACCOUNT_USAGE.
|
|
57
|
+
attr_accessor :cost_cap
|
|
58
|
+
|
|
59
|
+
# Whether the account raises its budget automatically, for ACCOUNT_USAGE.
|
|
60
|
+
attr_accessor :auto_upgrade
|
|
61
|
+
|
|
62
|
+
# Per-channel volume and cost for the current period, for ACCOUNT_USAGE.
|
|
63
|
+
attr_accessor :usage
|
|
64
|
+
|
|
41
65
|
class EnumAttributeValidator
|
|
42
66
|
attr_reader :datatype
|
|
43
67
|
attr_reader :allowable_values
|
|
@@ -70,7 +94,15 @@ module Pingram
|
|
|
70
94
|
:'tracking_id' => :'trackingId',
|
|
71
95
|
:'failure_code' => :'failureCode',
|
|
72
96
|
:'clicked_link' => :'clickedLink',
|
|
73
|
-
:'clicked_link_tags' => :'clickedLinkTags'
|
|
97
|
+
:'clicked_link_tags' => :'clickedLinkTags',
|
|
98
|
+
:'account_id' => :'accountId',
|
|
99
|
+
:'year_month_day' => :'yearMonthDay',
|
|
100
|
+
:'resets_on' => :'resetsOn',
|
|
101
|
+
:'percent' => :'percent',
|
|
102
|
+
:'spent' => :'spent',
|
|
103
|
+
:'cost_cap' => :'costCap',
|
|
104
|
+
:'auto_upgrade' => :'autoUpgrade',
|
|
105
|
+
:'usage' => :'usage'
|
|
74
106
|
}
|
|
75
107
|
end
|
|
76
108
|
|
|
@@ -94,7 +126,15 @@ module Pingram
|
|
|
94
126
|
:'tracking_id' => :'String',
|
|
95
127
|
:'failure_code' => :'String',
|
|
96
128
|
:'clicked_link' => :'String',
|
|
97
|
-
:'clicked_link_tags' => :'Hash<String, Array<String>>'
|
|
129
|
+
:'clicked_link_tags' => :'Hash<String, Array<String>>',
|
|
130
|
+
:'account_id' => :'String',
|
|
131
|
+
:'year_month_day' => :'String',
|
|
132
|
+
:'resets_on' => :'String',
|
|
133
|
+
:'percent' => :'Float',
|
|
134
|
+
:'spent' => :'Float',
|
|
135
|
+
:'cost_cap' => :'Float',
|
|
136
|
+
:'auto_upgrade' => :'Boolean',
|
|
137
|
+
:'usage' => :'Hash<String, WebhookEventUsageValue>'
|
|
98
138
|
}
|
|
99
139
|
end
|
|
100
140
|
|
|
@@ -163,6 +203,40 @@ module Pingram
|
|
|
163
203
|
self.clicked_link_tags = value
|
|
164
204
|
end
|
|
165
205
|
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'account_id')
|
|
208
|
+
self.account_id = attributes[:'account_id']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'year_month_day')
|
|
212
|
+
self.year_month_day = attributes[:'year_month_day']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'resets_on')
|
|
216
|
+
self.resets_on = attributes[:'resets_on']
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if attributes.key?(:'percent')
|
|
220
|
+
self.percent = attributes[:'percent']
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if attributes.key?(:'spent')
|
|
224
|
+
self.spent = attributes[:'spent']
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if attributes.key?(:'cost_cap')
|
|
228
|
+
self.cost_cap = attributes[:'cost_cap']
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if attributes.key?(:'auto_upgrade')
|
|
232
|
+
self.auto_upgrade = attributes[:'auto_upgrade']
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if attributes.key?(:'usage')
|
|
236
|
+
if (value = attributes[:'usage']).is_a?(Hash)
|
|
237
|
+
self.usage = value
|
|
238
|
+
end
|
|
239
|
+
end
|
|
166
240
|
end
|
|
167
241
|
|
|
168
242
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -198,7 +272,7 @@ module Pingram
|
|
|
198
272
|
def valid?
|
|
199
273
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
200
274
|
return false if @event_type.nil?
|
|
201
|
-
event_type_validator = EnumAttributeValidator.new('String', ["EMAIL_OPEN", "EMAIL_CLICK", "EMAIL_FAILED", "EMAIL_DELIVERED", "EMAIL_UNSUBSCRIBE", "EMAIL_INBOUND", "INAPP_WEB_FAILED", "INAPP_WEB_UNSUBSCRIBE", "SMS_DELIVERED", "SMS_FAILED", "SMS_UNSUBSCRIBE", "SMS_SUBSCRIBE", "SMS_INBOUND", "PUSH_FAILED", "PUSH_UNSUBSCRIBE", "CALL_FAILED", "CALL_UNSUBSCRIBE", "WEB_PUSH_FAILED", "WEB_PUSH_UNSUBSCRIBE", "SLACK_FAILED", "SLACK_UNSUBSCRIBE"])
|
|
275
|
+
event_type_validator = EnumAttributeValidator.new('String', ["EMAIL_OPEN", "EMAIL_CLICK", "EMAIL_FAILED", "EMAIL_DELIVERED", "EMAIL_UNSUBSCRIBE", "EMAIL_INBOUND", "INAPP_WEB_FAILED", "INAPP_WEB_UNSUBSCRIBE", "SMS_DELIVERED", "SMS_FAILED", "SMS_UNSUBSCRIBE", "SMS_SUBSCRIBE", "SMS_INBOUND", "PUSH_FAILED", "PUSH_UNSUBSCRIBE", "CALL_FAILED", "CALL_UNSUBSCRIBE", "WEB_PUSH_FAILED", "WEB_PUSH_UNSUBSCRIBE", "SLACK_FAILED", "SLACK_UNSUBSCRIBE", "ACCOUNT_USAGE"])
|
|
202
276
|
return false unless event_type_validator.valid?(@event_type)
|
|
203
277
|
return false if @channel.nil?
|
|
204
278
|
return false if @user_id.nil?
|
|
@@ -210,7 +284,7 @@ module Pingram
|
|
|
210
284
|
# Custom attribute writer method checking allowed values (enum).
|
|
211
285
|
# @param [Object] event_type Object to be assigned
|
|
212
286
|
def event_type=(event_type)
|
|
213
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_OPEN", "EMAIL_CLICK", "EMAIL_FAILED", "EMAIL_DELIVERED", "EMAIL_UNSUBSCRIBE", "EMAIL_INBOUND", "INAPP_WEB_FAILED", "INAPP_WEB_UNSUBSCRIBE", "SMS_DELIVERED", "SMS_FAILED", "SMS_UNSUBSCRIBE", "SMS_SUBSCRIBE", "SMS_INBOUND", "PUSH_FAILED", "PUSH_UNSUBSCRIBE", "CALL_FAILED", "CALL_UNSUBSCRIBE", "WEB_PUSH_FAILED", "WEB_PUSH_UNSUBSCRIBE", "SLACK_FAILED", "SLACK_UNSUBSCRIBE"])
|
|
287
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_OPEN", "EMAIL_CLICK", "EMAIL_FAILED", "EMAIL_DELIVERED", "EMAIL_UNSUBSCRIBE", "EMAIL_INBOUND", "INAPP_WEB_FAILED", "INAPP_WEB_UNSUBSCRIBE", "SMS_DELIVERED", "SMS_FAILED", "SMS_UNSUBSCRIBE", "SMS_SUBSCRIBE", "SMS_INBOUND", "PUSH_FAILED", "PUSH_UNSUBSCRIBE", "CALL_FAILED", "CALL_UNSUBSCRIBE", "WEB_PUSH_FAILED", "WEB_PUSH_UNSUBSCRIBE", "SLACK_FAILED", "SLACK_UNSUBSCRIBE", "ACCOUNT_USAGE"])
|
|
214
288
|
unless validator.valid?(event_type)
|
|
215
289
|
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
|
|
216
290
|
end
|
|
@@ -269,7 +343,15 @@ module Pingram
|
|
|
269
343
|
tracking_id == o.tracking_id &&
|
|
270
344
|
failure_code == o.failure_code &&
|
|
271
345
|
clicked_link == o.clicked_link &&
|
|
272
|
-
clicked_link_tags == o.clicked_link_tags
|
|
346
|
+
clicked_link_tags == o.clicked_link_tags &&
|
|
347
|
+
account_id == o.account_id &&
|
|
348
|
+
year_month_day == o.year_month_day &&
|
|
349
|
+
resets_on == o.resets_on &&
|
|
350
|
+
percent == o.percent &&
|
|
351
|
+
spent == o.spent &&
|
|
352
|
+
cost_cap == o.cost_cap &&
|
|
353
|
+
auto_upgrade == o.auto_upgrade &&
|
|
354
|
+
usage == o.usage
|
|
273
355
|
end
|
|
274
356
|
|
|
275
357
|
# @see the `==` method
|
|
@@ -281,7 +363,7 @@ module Pingram
|
|
|
281
363
|
# Calculates hash code according to all attributes.
|
|
282
364
|
# @return [Integer] Hash code
|
|
283
365
|
def hash
|
|
284
|
-
[event_type, channel, user_id, notification_id, tracking_id, failure_code, clicked_link, clicked_link_tags].hash
|
|
366
|
+
[event_type, channel, user_id, notification_id, tracking_id, failure_code, clicked_link, clicked_link_tags, account_id, year_month_day, resets_on, percent, spent, cost_cap, auto_upgrade, usage].hash
|
|
285
367
|
end
|
|
286
368
|
|
|
287
369
|
# Builds the object from hash
|