pingram 1.0.36 → 1.0.37

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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/pingram/api/account_api.rb +244 -2
  4. data/lib/pingram/api_client.rb +1 -1
  5. data/lib/pingram/models/account_get_response.rb +13 -4
  6. data/lib/pingram/models/account_get_response_billing_alerts.rb +224 -0
  7. data/lib/pingram/models/account_patch_request.rb +13 -4
  8. data/lib/pingram/models/billing_email.rb +177 -0
  9. data/lib/pingram/models/billing_post_response_body.rb +10 -1
  10. data/lib/pingram/models/cancel_subscription_request.rb +168 -0
  11. data/lib/pingram/models/phone_verify_start_response.rb +14 -4
  12. data/lib/pingram/models/sender_post_body_sms.rb +1 -1
  13. data/lib/pingram/models/sender_post_body_sms_auto_reply.rb +2 -1
  14. data/lib/pingram/models/slack_connect_invite_response.rb +190 -0
  15. data/lib/pingram/models/update_billing_email_request.rb +184 -0
  16. data/lib/pingram/models/webhook_event.rb +88 -6
  17. data/lib/pingram/models/webhook_event_usage_value.rb +193 -0
  18. data/lib/pingram/version.rb +1 -1
  19. data/lib/pingram.rb +6 -0
  20. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  21. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  22. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/gem_make.out +5 -5
  23. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/mkmf.log +3 -3
  24. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  25. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  26. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  27. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  28. metadata +8 -2
@@ -0,0 +1,177 @@
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
+ # GET/PATCH /account/billing-email response.
18
+ class BillingEmail < 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::BillingEmail` 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::BillingEmail`. 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
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if !@email.nil? && @email.to_s.length > 320
79
+ invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 320.')
80
+ end
81
+
82
+ if !@email.nil? && @email.to_s.length < 3
83
+ invalid_properties.push('invalid value for "email", the character length must be greater than or equal to 3.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if !@email.nil? && @email.to_s.length > 320
94
+ return false if !@email.nil? && @email.to_s.length < 3
95
+ true
96
+ end
97
+
98
+ # Custom attribute writer method with validation
99
+ # @param [Object] email Value to be assigned
100
+ def email=(email)
101
+ if email.nil?
102
+ fail ArgumentError, 'email cannot be nil'
103
+ end
104
+
105
+ if email.to_s.length > 320
106
+ fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 320.'
107
+ end
108
+
109
+ if email.to_s.length < 3
110
+ fail ArgumentError, 'invalid value for "email", the character length must be greater than or equal to 3.'
111
+ end
112
+
113
+ @email = email
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ email == o.email
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [email].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ if value.nil?
166
+ is_nullable = self.class.openapi_nullable.include?(attr)
167
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
168
+ end
169
+
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ end
176
+
177
+ end
@@ -55,6 +55,8 @@ module Pingram
55
55
  # When true, paid accounts move up one budget tier at 90% of the monthly budget.
56
56
  attr_accessor :auto_upgrade
57
57
 
58
+ attr_accessor :billing_alerts
59
+
58
60
  attr_accessor :session_id
59
61
 
60
62
  attr_accessor :url
@@ -102,6 +104,7 @@ module Pingram
102
104
  :'pending_downgrade_cost_cap' => :'pendingDowngradeCostCap',
103
105
  :'pending_downgrade_account_type' => :'pendingDowngradeAccountType',
104
106
  :'auto_upgrade' => :'autoUpgrade',
107
+ :'billing_alerts' => :'billingAlerts',
105
108
  :'session_id' => :'sessionId',
106
109
  :'url' => :'url'
107
110
  }
@@ -138,6 +141,7 @@ module Pingram
138
141
  :'pending_downgrade_cost_cap' => :'Float',
139
142
  :'pending_downgrade_account_type' => :'String',
140
143
  :'auto_upgrade' => :'Boolean',
144
+ :'billing_alerts' => :'AccountGetResponseBillingAlerts',
141
145
  :'session_id' => :'String',
142
146
  :'url' => :'String'
143
147
  }
@@ -252,6 +256,10 @@ module Pingram
252
256
  self.auto_upgrade = attributes[:'auto_upgrade']
253
257
  end
254
258
 
259
+ if attributes.key?(:'billing_alerts')
260
+ self.billing_alerts = attributes[:'billing_alerts']
261
+ end
262
+
255
263
  if attributes.key?(:'session_id')
256
264
  self.session_id = attributes[:'session_id']
257
265
  end
@@ -454,6 +462,7 @@ module Pingram
454
462
  pending_downgrade_cost_cap == o.pending_downgrade_cost_cap &&
455
463
  pending_downgrade_account_type == o.pending_downgrade_account_type &&
456
464
  auto_upgrade == o.auto_upgrade &&
465
+ billing_alerts == o.billing_alerts &&
457
466
  session_id == o.session_id &&
458
467
  url == o.url
459
468
  end
@@ -467,7 +476,7 @@ module Pingram
467
476
  # Calculates hash code according to all attributes.
468
477
  # @return [Integer] Hash code
469
478
  def hash
470
- [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type, auto_upgrade, session_id, url].hash
479
+ [account_id, account_type, creator, name, messages_cap, cost_cap, sms_cap, call_cap, billing_version, anniversary_date, created_at, updated_at, status, subscription_status, pending_downgrade_effective_date, pending_downgrade_cost_cap, pending_downgrade_account_type, auto_upgrade, billing_alerts, session_id, url].hash
471
480
  end
472
481
 
473
482
  # Builds the object from hash
@@ -0,0 +1,168 @@
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
+ # POST /account/subscription/cancel request.
18
+ class CancelSubscriptionRequest < ApiModelBase
19
+ # Optional note about why you are canceling. Helps us improve the product.
20
+ attr_accessor :reason
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'reason' => :'reason'
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
+ :'reason' => :'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::CancelSubscriptionRequest` 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::CancelSubscriptionRequest`. 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?(:'reason')
69
+ self.reason = attributes[:'reason']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if !@reason.nil? && @reason.to_s.length > 5000
79
+ invalid_properties.push('invalid value for "reason", the character length must be smaller than or equal to 5000.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if !@reason.nil? && @reason.to_s.length > 5000
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] reason Value to be assigned
95
+ def reason=(reason)
96
+ if reason.nil?
97
+ fail ArgumentError, 'reason cannot be nil'
98
+ end
99
+
100
+ if reason.to_s.length > 5000
101
+ fail ArgumentError, 'invalid value for "reason", the character length must be smaller than or equal to 5000.'
102
+ end
103
+
104
+ @reason = reason
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ reason == o.reason
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [reason].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end
@@ -17,10 +17,14 @@ module Pingram
17
17
  class PhoneVerifyStartResponse < ApiModelBase
18
18
  attr_accessor :started
19
19
 
20
+ # Seconds until this signup can request another code for the same number.
21
+ attr_accessor :resend_after_seconds
22
+
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
23
- :'started' => :'started'
26
+ :'started' => :'started',
27
+ :'resend_after_seconds' => :'resendAfterSeconds'
24
28
  }
25
29
  end
26
30
 
@@ -37,7 +41,8 @@ module Pingram
37
41
  # Attribute type mapping.
38
42
  def self.openapi_types
39
43
  {
40
- :'started' => :'Boolean'
44
+ :'started' => :'Boolean',
45
+ :'resend_after_seconds' => :'Float'
41
46
  }
42
47
  end
43
48
 
@@ -68,6 +73,10 @@ module Pingram
68
73
  else
69
74
  self.started = nil
70
75
  end
76
+
77
+ if attributes.key?(:'resend_after_seconds')
78
+ self.resend_after_seconds = attributes[:'resend_after_seconds']
79
+ end
71
80
  end
72
81
 
73
82
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,7 +114,8 @@ module Pingram
105
114
  def ==(o)
106
115
  return true if self.equal?(o)
107
116
  self.class == o.class &&
108
- started == o.started
117
+ started == o.started &&
118
+ resend_after_seconds == o.resend_after_seconds
109
119
  end
110
120
 
111
121
  # @see the `==` method
@@ -117,7 +127,7 @@ module Pingram
117
127
  # Calculates hash code according to all attributes.
118
128
  # @return [Integer] Hash code
119
129
  def hash
120
- [started].hash
130
+ [started, resend_after_seconds].hash
121
131
  end
122
132
 
123
133
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- # Inline SMS content (message, autoReply, from, mediaUrls).
17
+ # Inline SMS content (message, from, mediaUrls).
18
18
  class SenderPostBodySms < ApiModelBase
19
19
  # SMS/MMS body text.
20
20
  attr_accessor :message
@@ -14,8 +14,9 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
+ # @deprecated Ignored. SMS auto-reply is no longer available. Replacing with SMS_INBOUND: handle that webhook and send your own reply.
17
18
  class SenderPostBodySmsAutoReply < ApiModelBase
18
- # Auto-reply message to send when user texts in.
19
+ # @deprecated Ignored. SMS auto-reply is no longer available. Replacing with SMS_INBOUND: handle that webhook and send your own reply.
19
20
  attr_accessor :message
20
21
 
21
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,190 @@
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 SlackConnectInviteResponse < ApiModelBase
18
+ attr_accessor :channel_id
19
+
20
+ attr_accessor :channel_name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'channel_id' => :'channelId',
26
+ :'channel_name' => :'channelName'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'channel_id' => :'String',
44
+ :'channel_name' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SlackConnectInviteResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SlackConnectInviteResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'channel_id')
71
+ self.channel_id = attributes[:'channel_id']
72
+ else
73
+ self.channel_id = nil
74
+ end
75
+
76
+ if attributes.key?(:'channel_name')
77
+ self.channel_name = attributes[:'channel_name']
78
+ else
79
+ self.channel_name = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @channel_id.nil?
89
+ invalid_properties.push('invalid value for "channel_id", channel_id cannot be nil.')
90
+ end
91
+
92
+ if @channel_name.nil?
93
+ invalid_properties.push('invalid value for "channel_name", channel_name cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @channel_id.nil?
104
+ return false if @channel_name.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] channel_id Value to be assigned
110
+ def channel_id=(channel_id)
111
+ if channel_id.nil?
112
+ fail ArgumentError, 'channel_id cannot be nil'
113
+ end
114
+
115
+ @channel_id = channel_id
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] channel_name Value to be assigned
120
+ def channel_name=(channel_name)
121
+ if channel_name.nil?
122
+ fail ArgumentError, 'channel_name cannot be nil'
123
+ end
124
+
125
+ @channel_name = channel_name
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ channel_id == o.channel_id &&
134
+ channel_name == o.channel_name
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [channel_id, channel_name].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end