pingram 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/pingram/api/accounts_api.rb +143 -0
  4. data/lib/pingram/api/user_api.rb +0 -133
  5. data/lib/pingram/api_client.rb +1 -1
  6. data/lib/pingram/client_wrapper.rb +10 -0
  7. data/lib/pingram/models/account_get_response.rb +25 -4
  8. data/lib/pingram/models/billing_post_response_body.rb +22 -1
  9. data/lib/pingram/models/create_account_request.rb +45 -9
  10. data/lib/pingram/models/create_account_request_plan.rb +216 -0
  11. data/lib/pingram/models/create_account_response.rb +103 -30
  12. data/lib/pingram/models/first_account_request.rb +150 -0
  13. data/lib/pingram/models/{slack_oauth_request.rb → first_account_response.rb} +34 -34
  14. data/lib/pingram/models/list_accounts_response.rb +167 -0
  15. data/lib/pingram/models/list_accounts_response_accounts_inner.rb +304 -0
  16. data/lib/pingram/models/phone_verify_confirm_response.rb +13 -4
  17. data/lib/pingram/version.rb +1 -1
  18. data/lib/pingram.rb +6 -1
  19. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  20. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  21. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/gem_make.out +5 -5
  22. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/mkmf.log +3 -3
  23. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  24. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.4.0/gem_make.out +5 -5
  25. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  26. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  27. metadata +8 -3
@@ -0,0 +1,216 @@
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
+ # Billing to copy onto a new additional account.
18
+ class CreateAccountRequestPlan < ApiModelBase
19
+ attr_accessor :tier
20
+
21
+ # Account whose saved payment method is copied onto the new account. The caller must be an owner of this account.
22
+ attr_accessor :source_billing_account_id
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'tier' => :'tier',
50
+ :'source_billing_account_id' => :'sourceBillingAccountId'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'tier' => :'String',
68
+ :'source_billing_account_id' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CreateAccountRequestPlan` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CreateAccountRequestPlan`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'tier')
95
+ self.tier = attributes[:'tier']
96
+ else
97
+ self.tier = nil
98
+ end
99
+
100
+ if attributes.key?(:'source_billing_account_id')
101
+ self.source_billing_account_id = attributes[:'source_billing_account_id']
102
+ else
103
+ self.source_billing_account_id = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @tier.nil?
113
+ invalid_properties.push('invalid value for "tier", tier cannot be nil.')
114
+ end
115
+
116
+ if @source_billing_account_id.nil?
117
+ invalid_properties.push('invalid value for "source_billing_account_id", source_billing_account_id cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @tier.nil?
128
+ tier_validator = EnumAttributeValidator.new('String', ["budget_20", "budget_50", "budget_100", "budget_250", "budget_500", "budget_1000", "budget_2000", "budget_5000"])
129
+ return false unless tier_validator.valid?(@tier)
130
+ return false if @source_billing_account_id.nil?
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] tier Object to be assigned
136
+ def tier=(tier)
137
+ validator = EnumAttributeValidator.new('String', ["budget_20", "budget_50", "budget_100", "budget_250", "budget_500", "budget_1000", "budget_2000", "budget_5000"])
138
+ unless validator.valid?(tier)
139
+ fail ArgumentError, "invalid value for \"tier\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @tier = tier
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] source_billing_account_id Value to be assigned
146
+ def source_billing_account_id=(source_billing_account_id)
147
+ if source_billing_account_id.nil?
148
+ fail ArgumentError, 'source_billing_account_id cannot be nil'
149
+ end
150
+
151
+ @source_billing_account_id = source_billing_account_id
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ tier == o.tier &&
160
+ source_billing_account_id == o.source_billing_account_id
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [tier, source_billing_account_id].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -14,16 +14,45 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
+ # Response for POST /accounts
17
18
  class CreateAccountResponse < ApiModelBase
18
- attr_accessor :success
19
-
20
19
  attr_accessor :account_id
21
20
 
21
+ attr_accessor :name
22
+
23
+ attr_accessor :status
24
+
25
+ attr_accessor :subscription_status
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
22
49
  # Attribute mapping from ruby-style variable name to JSON key.
23
50
  def self.attribute_map
24
51
  {
25
- :'success' => :'success',
26
- :'account_id' => :'accountId'
52
+ :'account_id' => :'accountId',
53
+ :'name' => :'name',
54
+ :'status' => :'status',
55
+ :'subscription_status' => :'subscriptionStatus'
27
56
  }
28
57
  end
29
58
 
@@ -40,14 +69,17 @@ module Pingram
40
69
  # Attribute type mapping.
41
70
  def self.openapi_types
42
71
  {
43
- :'success' => :'Boolean',
44
- :'account_id' => :'String'
72
+ :'account_id' => :'String',
73
+ :'name' => :'String',
74
+ :'status' => :'String',
75
+ :'subscription_status' => :'String'
45
76
  }
46
77
  end
47
78
 
48
79
  # List of attributes with nullable: true
49
80
  def self.openapi_nullable
50
81
  Set.new([
82
+ :'subscription_status'
51
83
  ])
52
84
  end
53
85
 
@@ -67,17 +99,27 @@ module Pingram
67
99
  h[k.to_sym] = v
68
100
  }
69
101
 
70
- if attributes.key?(:'success')
71
- self.success = attributes[:'success']
72
- else
73
- self.success = nil
74
- end
75
-
76
102
  if attributes.key?(:'account_id')
77
103
  self.account_id = attributes[:'account_id']
78
104
  else
79
105
  self.account_id = nil
80
106
  end
107
+
108
+ if attributes.key?(:'name')
109
+ self.name = attributes[:'name']
110
+ else
111
+ self.name = nil
112
+ end
113
+
114
+ if attributes.key?(:'status')
115
+ self.status = attributes[:'status']
116
+ else
117
+ self.status = nil
118
+ end
119
+
120
+ if attributes.key?(:'subscription_status')
121
+ self.subscription_status = attributes[:'subscription_status']
122
+ end
81
123
  end
82
124
 
83
125
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -85,14 +127,18 @@ module Pingram
85
127
  def list_invalid_properties
86
128
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
129
  invalid_properties = Array.new
88
- if @success.nil?
89
- invalid_properties.push('invalid value for "success", success cannot be nil.')
90
- end
91
-
92
130
  if @account_id.nil?
93
131
  invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
94
132
  end
95
133
 
134
+ if @name.nil?
135
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
136
+ end
137
+
138
+ if @status.nil?
139
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
140
+ end
141
+
96
142
  invalid_properties
97
143
  end
98
144
 
@@ -100,21 +146,16 @@ module Pingram
100
146
  # @return true if the model is valid
101
147
  def valid?
102
148
  warn '[DEPRECATED] the `valid?` method is obsolete'
103
- return false if @success.nil?
104
149
  return false if @account_id.nil?
150
+ return false if @name.nil?
151
+ return false if @status.nil?
152
+ status_validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
153
+ return false unless status_validator.valid?(@status)
154
+ subscription_status_validator = EnumAttributeValidator.new('String', ["active", "canceled", "past_due", "paused"])
155
+ return false unless subscription_status_validator.valid?(@subscription_status)
105
156
  true
106
157
  end
107
158
 
108
- # Custom attribute writer method with validation
109
- # @param [Object] success Value to be assigned
110
- def success=(success)
111
- if success.nil?
112
- fail ArgumentError, 'success cannot be nil'
113
- end
114
-
115
- @success = success
116
- end
117
-
118
159
  # Custom attribute writer method with validation
119
160
  # @param [Object] account_id Value to be assigned
120
161
  def account_id=(account_id)
@@ -125,13 +166,45 @@ module Pingram
125
166
  @account_id = account_id
126
167
  end
127
168
 
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] name Value to be assigned
171
+ def name=(name)
172
+ if name.nil?
173
+ fail ArgumentError, 'name cannot be nil'
174
+ end
175
+
176
+ @name = name
177
+ end
178
+
179
+ # Custom attribute writer method checking allowed values (enum).
180
+ # @param [Object] status Object to be assigned
181
+ def status=(status)
182
+ validator = EnumAttributeValidator.new('String', ["verified", "unverified", "blocked"])
183
+ unless validator.valid?(status)
184
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
185
+ end
186
+ @status = status
187
+ end
188
+
189
+ # Custom attribute writer method checking allowed values (enum).
190
+ # @param [Object] subscription_status Object to be assigned
191
+ def subscription_status=(subscription_status)
192
+ validator = EnumAttributeValidator.new('String', ["active", "canceled", "past_due", "paused"])
193
+ unless validator.valid?(subscription_status)
194
+ fail ArgumentError, "invalid value for \"subscription_status\", must be one of #{validator.allowable_values}."
195
+ end
196
+ @subscription_status = subscription_status
197
+ end
198
+
128
199
  # Checks equality by comparing each attribute.
129
200
  # @param [Object] Object to be compared
130
201
  def ==(o)
131
202
  return true if self.equal?(o)
132
203
  self.class == o.class &&
133
- success == o.success &&
134
- account_id == o.account_id
204
+ account_id == o.account_id &&
205
+ name == o.name &&
206
+ status == o.status &&
207
+ subscription_status == o.subscription_status
135
208
  end
136
209
 
137
210
  # @see the `==` method
@@ -143,7 +216,7 @@ module Pingram
143
216
  # Calculates hash code according to all attributes.
144
217
  # @return [Integer] Hash code
145
218
  def hash
146
- [success, account_id].hash
219
+ [account_id, name, status, subscription_status].hash
147
220
  end
148
221
 
149
222
  # Builds the object from hash
@@ -0,0 +1,150 @@
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 FirstAccountRequest < ApiModelBase
18
+ # First-touch PostHog props from the client; attached to signup events.
19
+ attr_accessor :attribution
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'attribution' => :'attribution'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'attribution' => :'Hash<String, String>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::FirstAccountRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::FirstAccountRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'attribution')
68
+ if (value = attributes[:'attribution']).is_a?(Hash)
69
+ self.attribution = value
70
+ end
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ warn '[DEPRECATED] the `valid?` method is obsolete'
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ attribution == o.attribution
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [attribution].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Returns the object in the form of hash
133
+ # @return [Hash] Returns the object in the form of hash
134
+ def to_hash
135
+ hash = {}
136
+ self.class.attribute_map.each_pair do |attr, param|
137
+ value = self.send(attr)
138
+ if value.nil?
139
+ is_nullable = self.class.openapi_nullable.include?(attr)
140
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
141
+ end
142
+
143
+ hash[param] = _to_hash(value)
144
+ end
145
+ hash
146
+ end
147
+
148
+ end
149
+
150
+ end