pingram 1.0.19 → 1.0.22

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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/lib/pingram/api/account_api.rb +70 -66
  4. data/lib/pingram/api/email_api.rb +61 -0
  5. data/lib/pingram/api/members_api.rb +2 -2
  6. data/lib/pingram/api_client.rb +1 -1
  7. data/lib/pingram/client_wrapper.rb +0 -10
  8. data/lib/pingram/models/{push_settings_fcm_response.rb → campaign_webhook_response.rb} +20 -19
  9. data/lib/pingram/models/create_account_request.rb +150 -0
  10. data/lib/pingram/models/create_account_response.rb +30 -30
  11. data/lib/pingram/models/{create_account_request_body.rb → create_personal_access_token_request.rb} +18 -7
  12. data/lib/pingram/models/create_personal_access_token_response.rb +313 -0
  13. data/lib/pingram/models/{apn_config.rb → delete_email_suppressions_response.rb} +36 -86
  14. data/lib/pingram/models/get_members_response_inner.rb +29 -1
  15. data/lib/pingram/models/intercom_webhook_data_item_any_of.rb +1 -0
  16. data/lib/pingram/models/list_invoices_response.rb +194 -0
  17. data/lib/pingram/models/list_invoices_response_invoices_inner.rb +389 -0
  18. data/lib/pingram/models/{push_settings_fcm_put_request.rb → list_personal_access_tokens_response.rb} +21 -19
  19. data/lib/pingram/models/list_personal_access_tokens_response_tokens_inner.rb +287 -0
  20. data/lib/pingram/models/member_update_request.rb +1 -0
  21. data/lib/pingram/models/sender_post_body.rb +1 -11
  22. data/lib/pingram/models/ten_dlc_brand_registration_details.rb +14 -14
  23. data/lib/pingram/models/ten_dlc_campaign_registration_details.rb +457 -0
  24. data/lib/pingram/models/ten_dlc_campaign_update_request.rb +363 -0
  25. data/lib/pingram/version.rb +1 -1
  26. data/lib/pingram.rb +11 -5
  27. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.2.gem +0 -0
  28. data/vendor/bundle/ruby/3.2.0/cache/reline-0.7.0.gem +0 -0
  29. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  30. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  31. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.8.2 → io-console-0.9.2}/gem_make.out +15 -14
  32. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/io/console.so +0 -0
  33. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.8.2 → io-console-0.9.2}/mkmf.log +112 -109
  34. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  35. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.4.0/gem_make.out +5 -5
  36. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  38. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/ext/io/console/Makefile +1 -1
  39. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/ext/io/console/console.c +521 -28
  40. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/ext/io/console/extconf.rb +13 -14
  41. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/ext/io/console/win32_vk.inc +313 -165
  42. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.2/lib/io/console.so +0 -0
  43. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/ansi.rb +6 -4
  44. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/windows.rb +49 -23
  45. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io.rb +8 -2
  46. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/line_editor.rb +49 -21
  47. data/vendor/bundle/ruby/3.2.0/gems/reline-0.7.0/lib/reline/version.rb +3 -0
  48. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline.rb +10 -9
  49. data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.8.2.gemspec → io-console-0.9.2.gemspec} +3 -3
  50. data/vendor/bundle/ruby/3.2.0/specifications/{reline-0.6.3.gemspec → reline-0.7.0.gemspec} +2 -2
  51. metadata +55 -49
  52. data/lib/pingram/api/push_settings_api.rb +0 -374
  53. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.8.2.gem +0 -0
  54. data/vendor/bundle/ruby/3.2.0/cache/reline-0.6.3.gem +0 -0
  55. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/io/console.so +0 -0
  56. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/lib/io/console.so +0 -0
  57. data/vendor/bundle/ruby/3.2.0/gems/reline-0.6.3/lib/reline/version.rb +0 -3
  58. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.8.2 → io-console-0.9.2}/gem.build_complete +0 -0
  59. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/.document +0 -0
  60. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/BSDL +0 -0
  61. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/COPYING +0 -0
  62. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/README.md +0 -0
  63. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.8.2 → io-console-0.9.2}/lib/io/console/size.rb +0 -0
  64. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/BSDL +0 -0
  65. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/COPYING +0 -0
  66. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/README.md +0 -0
  67. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/config.rb +0 -0
  68. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/face.rb +0 -0
  69. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/history.rb +0 -0
  70. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/io/dumb.rb +0 -0
  71. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/base.rb +0 -0
  72. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/composite.rb +0 -0
  73. data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/emacs.rb +2 -2
  74. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/vi_command.rb +0 -0
  75. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor/vi_insert.rb +0 -0
  76. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_actor.rb +0 -0
  77. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/key_stroke.rb +0 -0
  78. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/kill_ring.rb +0 -0
  79. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/unicode/east_asian_width.rb +0 -0
  80. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/lib/reline/unicode.rb +0 -0
  81. /data/vendor/bundle/ruby/3.2.0/gems/{reline-0.6.3 → reline-0.7.0}/license_of_rb-readline +0 -0
@@ -15,15 +15,15 @@ require 'time'
15
15
 
16
16
  module Pingram
17
17
  class CreateAccountResponse < ApiModelBase
18
- attr_accessor :account_id
18
+ attr_accessor :success
19
19
 
20
- attr_accessor :name
20
+ attr_accessor :account_id
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
23
23
  def self.attribute_map
24
24
  {
25
- :'account_id' => :'accountId',
26
- :'name' => :'name'
25
+ :'success' => :'success',
26
+ :'account_id' => :'accountId'
27
27
  }
28
28
  end
29
29
 
@@ -40,8 +40,8 @@ module Pingram
40
40
  # Attribute type mapping.
41
41
  def self.openapi_types
42
42
  {
43
- :'account_id' => :'String',
44
- :'name' => :'String'
43
+ :'success' => :'Boolean',
44
+ :'account_id' => :'String'
45
45
  }
46
46
  end
47
47
 
@@ -67,16 +67,16 @@ module Pingram
67
67
  h[k.to_sym] = v
68
68
  }
69
69
 
70
- if attributes.key?(:'account_id')
71
- self.account_id = attributes[:'account_id']
70
+ if attributes.key?(:'success')
71
+ self.success = attributes[:'success']
72
72
  else
73
- self.account_id = nil
73
+ self.success = nil
74
74
  end
75
75
 
76
- if attributes.key?(:'name')
77
- self.name = attributes[:'name']
76
+ if attributes.key?(:'account_id')
77
+ self.account_id = attributes[:'account_id']
78
78
  else
79
- self.name = nil
79
+ self.account_id = nil
80
80
  end
81
81
  end
82
82
 
@@ -85,12 +85,12 @@ module Pingram
85
85
  def list_invalid_properties
86
86
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
87
  invalid_properties = Array.new
88
- if @account_id.nil?
89
- invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
88
+ if @success.nil?
89
+ invalid_properties.push('invalid value for "success", success cannot be nil.')
90
90
  end
91
91
 
92
- if @name.nil?
93
- invalid_properties.push('invalid value for "name", name cannot be nil.')
92
+ if @account_id.nil?
93
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
94
94
  end
95
95
 
96
96
  invalid_properties
@@ -100,29 +100,29 @@ module Pingram
100
100
  # @return true if the model is valid
101
101
  def valid?
102
102
  warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @success.nil?
103
104
  return false if @account_id.nil?
104
- return false if @name.nil?
105
105
  true
106
106
  end
107
107
 
108
108
  # Custom attribute writer method with validation
109
- # @param [Object] account_id Value to be assigned
110
- def account_id=(account_id)
111
- if account_id.nil?
112
- fail ArgumentError, 'account_id cannot be nil'
109
+ # @param [Object] success Value to be assigned
110
+ def success=(success)
111
+ if success.nil?
112
+ fail ArgumentError, 'success cannot be nil'
113
113
  end
114
114
 
115
- @account_id = account_id
115
+ @success = success
116
116
  end
117
117
 
118
118
  # Custom attribute writer method with validation
119
- # @param [Object] name Value to be assigned
120
- def name=(name)
121
- if name.nil?
122
- fail ArgumentError, 'name cannot be nil'
119
+ # @param [Object] account_id Value to be assigned
120
+ def account_id=(account_id)
121
+ if account_id.nil?
122
+ fail ArgumentError, 'account_id cannot be nil'
123
123
  end
124
124
 
125
- @name = name
125
+ @account_id = account_id
126
126
  end
127
127
 
128
128
  # Checks equality by comparing each attribute.
@@ -130,8 +130,8 @@ module Pingram
130
130
  def ==(o)
131
131
  return true if self.equal?(o)
132
132
  self.class == o.class &&
133
- account_id == o.account_id &&
134
- name == o.name
133
+ success == o.success &&
134
+ account_id == o.account_id
135
135
  end
136
136
 
137
137
  # @see the `==` method
@@ -143,7 +143,7 @@ module Pingram
143
143
  # Calculates hash code according to all attributes.
144
144
  # @return [Integer] Hash code
145
145
  def hash
146
- [account_id, name].hash
146
+ [success, account_id].hash
147
147
  end
148
148
 
149
149
  # Builds the object from hash
@@ -14,13 +14,18 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- class CreateAccountRequestBody < ApiModelBase
17
+ class CreatePersonalAccessTokenRequest < ApiModelBase
18
+ # Human-readable name for the token
18
19
  attr_accessor :name
19
20
 
21
+ # Optional ISO-8601 expiry. Omit for a non-expiring token.
22
+ attr_accessor :expires_at
23
+
20
24
  # Attribute mapping from ruby-style variable name to JSON key.
21
25
  def self.attribute_map
22
26
  {
23
- :'name' => :'name'
27
+ :'name' => :'name',
28
+ :'expires_at' => :'expiresAt'
24
29
  }
25
30
  end
26
31
 
@@ -37,7 +42,8 @@ module Pingram
37
42
  # Attribute type mapping.
38
43
  def self.openapi_types
39
44
  {
40
- :'name' => :'String'
45
+ :'name' => :'String',
46
+ :'expires_at' => :'String'
41
47
  }
42
48
  end
43
49
 
@@ -51,14 +57,14 @@ module Pingram
51
57
  # @param [Hash] attributes Model attributes in the form of hash
52
58
  def initialize(attributes = {})
53
59
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CreateAccountRequestBody` initialize method"
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CreatePersonalAccessTokenRequest` initialize method"
55
61
  end
56
62
 
57
63
  # check to see if the attribute exists and convert string to symbol for hash key
58
64
  acceptable_attribute_map = self.class.acceptable_attribute_map
59
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
66
  if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CreateAccountRequestBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CreatePersonalAccessTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
68
  end
63
69
  h[k.to_sym] = v
64
70
  }
@@ -68,6 +74,10 @@ module Pingram
68
74
  else
69
75
  self.name = nil
70
76
  end
77
+
78
+ if attributes.key?(:'expires_at')
79
+ self.expires_at = attributes[:'expires_at']
80
+ end
71
81
  end
72
82
 
73
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,7 +115,8 @@ module Pingram
105
115
  def ==(o)
106
116
  return true if self.equal?(o)
107
117
  self.class == o.class &&
108
- name == o.name
118
+ name == o.name &&
119
+ expires_at == o.expires_at
109
120
  end
110
121
 
111
122
  # @see the `==` method
@@ -117,7 +128,7 @@ module Pingram
117
128
  # Calculates hash code according to all attributes.
118
129
  # @return [Integer] Hash code
119
130
  def hash
120
- [name].hash
131
+ [name, expires_at].hash
121
132
  end
122
133
 
123
134
  # Builds the object from hash
@@ -0,0 +1,313 @@
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 CreatePersonalAccessTokenResponse < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :token_prefix
23
+
24
+ attr_accessor :created_at
25
+
26
+ attr_accessor :expires_at
27
+
28
+ attr_accessor :last_used_at
29
+
30
+ attr_accessor :revoked
31
+
32
+ # Full token — returned only on create. Store it securely; it cannot be retrieved again.
33
+ attr_accessor :token
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'id' => :'id',
39
+ :'name' => :'name',
40
+ :'token_prefix' => :'tokenPrefix',
41
+ :'created_at' => :'createdAt',
42
+ :'expires_at' => :'expiresAt',
43
+ :'last_used_at' => :'lastUsedAt',
44
+ :'revoked' => :'revoked',
45
+ :'token' => :'token'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'id' => :'String',
63
+ :'name' => :'String',
64
+ :'token_prefix' => :'String',
65
+ :'created_at' => :'String',
66
+ :'expires_at' => :'String',
67
+ :'last_used_at' => :'String',
68
+ :'revoked' => :'Boolean',
69
+ :'token' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::CreatePersonalAccessTokenResponse` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::CreatePersonalAccessTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'id')
96
+ self.id = attributes[:'id']
97
+ else
98
+ self.id = nil
99
+ end
100
+
101
+ if attributes.key?(:'name')
102
+ self.name = attributes[:'name']
103
+ else
104
+ self.name = nil
105
+ end
106
+
107
+ if attributes.key?(:'token_prefix')
108
+ self.token_prefix = attributes[:'token_prefix']
109
+ else
110
+ self.token_prefix = nil
111
+ end
112
+
113
+ if attributes.key?(:'created_at')
114
+ self.created_at = attributes[:'created_at']
115
+ else
116
+ self.created_at = nil
117
+ end
118
+
119
+ if attributes.key?(:'expires_at')
120
+ self.expires_at = attributes[:'expires_at']
121
+ end
122
+
123
+ if attributes.key?(:'last_used_at')
124
+ self.last_used_at = attributes[:'last_used_at']
125
+ end
126
+
127
+ if attributes.key?(:'revoked')
128
+ self.revoked = attributes[:'revoked']
129
+ else
130
+ self.revoked = nil
131
+ end
132
+
133
+ if attributes.key?(:'token')
134
+ self.token = attributes[:'token']
135
+ else
136
+ self.token = nil
137
+ end
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
144
+ invalid_properties = Array.new
145
+ if @id.nil?
146
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
147
+ end
148
+
149
+ if @name.nil?
150
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
151
+ end
152
+
153
+ if @token_prefix.nil?
154
+ invalid_properties.push('invalid value for "token_prefix", token_prefix cannot be nil.')
155
+ end
156
+
157
+ if @created_at.nil?
158
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
159
+ end
160
+
161
+ if @revoked.nil?
162
+ invalid_properties.push('invalid value for "revoked", revoked cannot be nil.')
163
+ end
164
+
165
+ if @token.nil?
166
+ invalid_properties.push('invalid value for "token", token cannot be nil.')
167
+ end
168
+
169
+ invalid_properties
170
+ end
171
+
172
+ # Check to see if the all the properties in the model are valid
173
+ # @return true if the model is valid
174
+ def valid?
175
+ warn '[DEPRECATED] the `valid?` method is obsolete'
176
+ return false if @id.nil?
177
+ return false if @name.nil?
178
+ return false if @token_prefix.nil?
179
+ return false if @created_at.nil?
180
+ return false if @revoked.nil?
181
+ return false if @token.nil?
182
+ true
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] id Value to be assigned
187
+ def id=(id)
188
+ if id.nil?
189
+ fail ArgumentError, 'id cannot be nil'
190
+ end
191
+
192
+ @id = id
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] name Value to be assigned
197
+ def name=(name)
198
+ if name.nil?
199
+ fail ArgumentError, 'name cannot be nil'
200
+ end
201
+
202
+ @name = name
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] token_prefix Value to be assigned
207
+ def token_prefix=(token_prefix)
208
+ if token_prefix.nil?
209
+ fail ArgumentError, 'token_prefix cannot be nil'
210
+ end
211
+
212
+ @token_prefix = token_prefix
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] created_at Value to be assigned
217
+ def created_at=(created_at)
218
+ if created_at.nil?
219
+ fail ArgumentError, 'created_at cannot be nil'
220
+ end
221
+
222
+ @created_at = created_at
223
+ end
224
+
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] revoked Value to be assigned
227
+ def revoked=(revoked)
228
+ if revoked.nil?
229
+ fail ArgumentError, 'revoked cannot be nil'
230
+ end
231
+
232
+ @revoked = revoked
233
+ end
234
+
235
+ # Custom attribute writer method with validation
236
+ # @param [Object] token Value to be assigned
237
+ def token=(token)
238
+ if token.nil?
239
+ fail ArgumentError, 'token cannot be nil'
240
+ end
241
+
242
+ @token = token
243
+ end
244
+
245
+ # Checks equality by comparing each attribute.
246
+ # @param [Object] Object to be compared
247
+ def ==(o)
248
+ return true if self.equal?(o)
249
+ self.class == o.class &&
250
+ id == o.id &&
251
+ name == o.name &&
252
+ token_prefix == o.token_prefix &&
253
+ created_at == o.created_at &&
254
+ expires_at == o.expires_at &&
255
+ last_used_at == o.last_used_at &&
256
+ revoked == o.revoked &&
257
+ token == o.token
258
+ end
259
+
260
+ # @see the `==` method
261
+ # @param [Object] Object to be compared
262
+ def eql?(o)
263
+ self == o
264
+ end
265
+
266
+ # Calculates hash code according to all attributes.
267
+ # @return [Integer] Hash code
268
+ def hash
269
+ [id, name, token_prefix, created_at, expires_at, last_used_at, revoked, token].hash
270
+ end
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def self.build_from_hash(attributes)
276
+ return nil unless attributes.is_a?(Hash)
277
+ attributes = attributes.transform_keys(&:to_sym)
278
+ transformed_hash = {}
279
+ openapi_types.each_pair do |key, type|
280
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
281
+ transformed_hash["#{key}"] = nil
282
+ elsif type =~ /\AArray<(.*)>/i
283
+ # check to ensure the input is an array given that the attribute
284
+ # is documented as an array but the input is not
285
+ if attributes[attribute_map[key]].is_a?(Array)
286
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
287
+ end
288
+ elsif !attributes[attribute_map[key]].nil?
289
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
290
+ end
291
+ end
292
+ new(transformed_hash)
293
+ end
294
+
295
+ # Returns the object in the form of hash
296
+ # @return [Hash] Returns the object in the form of hash
297
+ def to_hash
298
+ hash = {}
299
+ self.class.attribute_map.each_pair do |attr, param|
300
+ value = self.send(attr)
301
+ if value.nil?
302
+ is_nullable = self.class.openapi_nullable.include?(attr)
303
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
304
+ end
305
+
306
+ hash[param] = _to_hash(value)
307
+ end
308
+ hash
309
+ end
310
+
311
+ end
312
+
313
+ end