notifo-io 1.0.1.1 → 1.0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +205 -4
  3. data/docs/AppDetailsDto.md +0 -8
  4. data/docs/AppIdMediaBody.md +7 -0
  5. data/docs/AppsApi.md +188 -2
  6. data/docs/AuthorizationApi.md +121 -0
  7. data/docs/ConfigsApi.md +1 -1
  8. data/docs/ConfiguredIntegrationDto.md +12 -0
  9. data/docs/ConfiguredIntegrationsDto.md +8 -0
  10. data/docs/CreateIntegrationDto.md +11 -0
  11. data/docs/EventDto.md +1 -0
  12. data/docs/EventsApi.md +45 -1
  13. data/docs/IntegrationCreatedDto.md +8 -0
  14. data/docs/IntegrationDefinitionDto.md +11 -0
  15. data/docs/IntegrationProperties.md +6 -0
  16. data/docs/IntegrationPropertyDto.md +17 -0
  17. data/docs/IntegrationPropertyType.md +6 -0
  18. data/docs/IntegrationStatus.md +6 -0
  19. data/docs/ListResponseDtoOfMobilePushTokenDto.md +8 -0
  20. data/docs/ListResponseDtoOfNotificationDto.md +8 -0
  21. data/docs/LogsApi.md +1 -1
  22. data/docs/MediaApi.md +1 -1
  23. data/docs/MobileDeviceType.md +6 -0
  24. data/docs/MobilePushApi.md +135 -0
  25. data/docs/MobilePushTokenDto.md +8 -0
  26. data/docs/NotificationDto.md +21 -0
  27. data/docs/NotificationsApi.md +141 -0
  28. data/docs/PublishDto.md +2 -0
  29. data/docs/RegisterMobileTokenDto.md +8 -0
  30. data/docs/TemplatesApi.md +1 -1
  31. data/docs/TopicsApi.md +1 -1
  32. data/docs/TrackNotificationDto.md +10 -0
  33. data/docs/UpdateIntegrationDto.md +10 -0
  34. data/docs/UpsertUserDto.md +1 -0
  35. data/docs/UserApi.md +1 -1
  36. data/docs/UserDto.md +3 -0
  37. data/docs/UserInfoApi.md +83 -0
  38. data/docs/UsersApi.md +1 -1
  39. data/lib/notifo.rb +23 -3
  40. data/lib/notifo/api/apps_api.rb +246 -2
  41. data/lib/notifo/api/authorization_api.rb +158 -0
  42. data/lib/notifo/api/configs_api.rb +1 -1
  43. data/lib/notifo/api/events_api.rb +57 -1
  44. data/lib/notifo/api/logs_api.rb +1 -1
  45. data/lib/notifo/api/media_api.rb +1 -1
  46. data/lib/notifo/api/mobile_push_api.rb +178 -0
  47. data/lib/notifo/api/notifications_api.rb +181 -0
  48. data/lib/notifo/api/templates_api.rb +1 -1
  49. data/lib/notifo/api/topics_api.rb +1 -1
  50. data/lib/notifo/api/user_api.rb +1 -1
  51. data/lib/notifo/api/user_info_api.rb +112 -0
  52. data/lib/notifo/api/users_api.rb +1 -1
  53. data/lib/notifo/api_client.rb +1 -1
  54. data/lib/notifo/api_error.rb +1 -1
  55. data/lib/notifo/configuration.rb +3 -3
  56. data/lib/notifo/models/add_allowed_topic_dto.rb +1 -1
  57. data/lib/notifo/models/add_contributor_dto.rb +1 -1
  58. data/lib/notifo/models/app_contributor_dto.rb +1 -1
  59. data/lib/notifo/models/app_details_dto.rb +3 -96
  60. data/lib/notifo/models/app_dto.rb +1 -1
  61. data/lib/notifo/models/app_id_media_body.rb +207 -0
  62. data/lib/notifo/models/configured_integration_dto.rb +271 -0
  63. data/lib/notifo/models/configured_integrations_dto.rb +231 -0
  64. data/lib/notifo/models/confirm_mode.rb +1 -1
  65. data/lib/notifo/models/create_email_template_dto.rb +1 -1
  66. data/lib/notifo/models/create_integration_dto.rb +257 -0
  67. data/lib/notifo/models/email_template_dto.rb +2 -1
  68. data/lib/notifo/models/email_templates_dto.rb +1 -1
  69. data/lib/notifo/models/error_dto.rb +5 -1
  70. data/lib/notifo/models/event_dto.rb +18 -5
  71. data/lib/notifo/models/event_properties.rb +1 -1
  72. data/lib/notifo/models/integration_created_dto.rb +226 -0
  73. data/lib/notifo/models/integration_definition_dto.rb +272 -0
  74. data/lib/notifo/models/integration_properties.rb +201 -0
  75. data/lib/notifo/models/integration_property_dto.rb +319 -0
  76. data/lib/notifo/models/integration_property_type.rb +31 -0
  77. data/lib/notifo/models/integration_status.rb +29 -0
  78. data/lib/notifo/models/iso_day_of_week.rb +1 -1
  79. data/lib/notifo/models/list_response_dto_of_event_dto.rb +1 -1
  80. data/lib/notifo/models/list_response_dto_of_log_entry_dto.rb +1 -1
  81. data/lib/notifo/models/list_response_dto_of_media_dto.rb +1 -1
  82. data/lib/notifo/models/list_response_dto_of_mobile_push_token_dto.rb +229 -0
  83. data/lib/notifo/models/list_response_dto_of_notification_dto.rb +229 -0
  84. data/lib/notifo/models/list_response_dto_of_subscription_dto.rb +1 -1
  85. data/lib/notifo/models/list_response_dto_of_template_dto.rb +1 -1
  86. data/lib/notifo/models/list_response_dto_of_topic_dto.rb +1 -1
  87. data/lib/notifo/models/list_response_dto_of_user_dto.rb +1 -1
  88. data/lib/notifo/models/localized_text.rb +1 -1
  89. data/lib/notifo/models/log_entry_dto.rb +1 -1
  90. data/lib/notifo/models/media_dto.rb +1 -1
  91. data/lib/notifo/models/media_metadata.rb +1 -1
  92. data/lib/notifo/models/media_type.rb +1 -1
  93. data/lib/notifo/models/mobile_device_type.rb +29 -0
  94. data/lib/notifo/models/mobile_push_token_dto.rb +221 -0
  95. data/lib/notifo/models/notification_dto.rb +386 -0
  96. data/lib/notifo/models/notification_formatting_dto.rb +1 -1
  97. data/lib/notifo/models/notification_send.rb +1 -1
  98. data/lib/notifo/models/notification_setting_dto.rb +2 -1
  99. data/lib/notifo/models/profile_dto.rb +4 -1
  100. data/lib/notifo/models/publish_dto.rb +30 -5
  101. data/lib/notifo/models/publish_many_dto.rb +1 -1
  102. data/lib/notifo/models/register_mobile_token_dto.rb +221 -0
  103. data/lib/notifo/models/resize_mode.rb +1 -1
  104. data/lib/notifo/models/scheduling_dto.rb +2 -1
  105. data/lib/notifo/models/scheduling_type.rb +1 -1
  106. data/lib/notifo/models/subscription_dto.rb +2 -1
  107. data/lib/notifo/models/template_dto.rb +1 -1
  108. data/lib/notifo/models/topic_dto.rb +1 -1
  109. data/lib/notifo/models/track_notification_dto.rb +243 -0
  110. data/lib/notifo/models/update_integration_dto.rb +242 -0
  111. data/lib/notifo/models/update_profile_dto.rb +7 -1
  112. data/lib/notifo/models/upsert_app_dto.rb +11 -1
  113. data/lib/notifo/models/upsert_template_dto.rb +2 -1
  114. data/lib/notifo/models/upsert_templates_dto.rb +1 -1
  115. data/lib/notifo/models/upsert_user_dto.rb +21 -2
  116. data/lib/notifo/models/upsert_users_dto.rb +1 -1
  117. data/lib/notifo/models/user_dto.rb +48 -2
  118. data/lib/notifo/version.rb +1 -1
  119. data/notifo-io-1.0.1.1.gem +0 -0
  120. data/notifo.gemspec +2 -2
  121. data/spec/api/authorization_api_spec.rb +61 -0
  122. data/spec/api/mobile_push_api_spec.rb +66 -0
  123. data/spec/api/notifications_api_spec.rb +68 -0
  124. data/spec/api/user_info_api_spec.rb +52 -0
  125. data/spec/models/app_id_media_body_spec.rb +40 -0
  126. data/spec/models/configured_integration_dto_spec.rb +70 -0
  127. data/spec/models/configured_integrations_dto_spec.rb +46 -0
  128. data/spec/models/create_integration_dto_spec.rb +64 -0
  129. data/spec/models/integration_created_dto_spec.rb +46 -0
  130. data/spec/models/integration_definition_dto_spec.rb +64 -0
  131. data/spec/models/integration_properties_spec.rb +34 -0
  132. data/spec/models/integration_property_dto_spec.rb +100 -0
  133. data/spec/models/integration_property_type_spec.rb +34 -0
  134. data/spec/models/integration_status_spec.rb +34 -0
  135. data/spec/models/list_response_dto_of_mobile_push_token_dto_spec.rb +46 -0
  136. data/spec/models/list_response_dto_of_notification_dto_spec.rb +46 -0
  137. data/spec/models/mobile_device_type_spec.rb +34 -0
  138. data/spec/models/mobile_push_token_dto_spec.rb +46 -0
  139. data/spec/models/notification_dto_spec.rb +124 -0
  140. data/spec/models/register_mobile_token_dto_spec.rb +46 -0
  141. data/spec/models/track_notification_dto_spec.rb +58 -0
  142. data/spec/models/update_integration_dto_spec.rb +58 -0
  143. metadata +91 -2
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.24
9
+ Swagger Codegen version: 3.0.26
10
10
  =end
11
11
 
12
12
  require 'date'
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.24
9
+ Swagger Codegen version: 3.0.26
10
10
  =end
11
11
 
12
12
  require 'date'
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #Notifo API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.26
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module Notifo
15
+ class CreateIntegrationDto
16
+ # The integration type.
17
+ attr_accessor :type
18
+
19
+ attr_accessor :properties
20
+
21
+ # True when enabled.
22
+ attr_accessor :enabled
23
+
24
+ # True when used for test events.
25
+ attr_accessor :test
26
+
27
+ # The priority in which order the integrations must run.
28
+ attr_accessor :priority
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'type' => :'type',
34
+ :'properties' => :'properties',
35
+ :'enabled' => :'enabled',
36
+ :'test' => :'test',
37
+ :'priority' => :'priority'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'type' => :'Object',
45
+ :'properties' => :'Object',
46
+ :'enabled' => :'Object',
47
+ :'test' => :'Object',
48
+ :'priority' => :'Object'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'test',
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::CreateIntegrationDto` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::CreateIntegrationDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'type')
75
+ self.type = attributes[:'type']
76
+ end
77
+
78
+ if attributes.key?(:'properties')
79
+ self.properties = attributes[:'properties']
80
+ end
81
+
82
+ if attributes.key?(:'enabled')
83
+ self.enabled = attributes[:'enabled']
84
+ end
85
+
86
+ if attributes.key?(:'test')
87
+ self.test = attributes[:'test']
88
+ end
89
+
90
+ if attributes.key?(:'priority')
91
+ self.priority = attributes[:'priority']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @type.nil?
100
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
101
+ end
102
+
103
+ if @properties.nil?
104
+ invalid_properties.push('invalid value for "properties", properties cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @type.nil?
114
+ return false if @properties.nil?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ type == o.type &&
124
+ properties == o.properties &&
125
+ enabled == o.enabled &&
126
+ test == o.test &&
127
+ priority == o.priority
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [type, properties, enabled, test, priority].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
164
+ self.send("#{key}=", nil)
165
+ end
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ DateTime.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ Notifo.const_get(type).build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end end
257
+ end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.24
9
+ Swagger Codegen version: 3.0.26
10
10
  =end
11
11
 
12
12
  require 'date'
@@ -43,6 +43,7 @@ module Notifo
43
43
  # List of attributes with nullable: true
44
44
  def self.openapi_nullable
45
45
  Set.new([
46
+ :'body_text'
46
47
  ])
47
48
  end
48
49
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.24
9
+ Swagger Codegen version: 3.0.26
10
10
  =end
11
11
 
12
12
  require 'date'
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.24
9
+ Swagger Codegen version: 3.0.26
10
10
  =end
11
11
 
12
12
  require 'date'
@@ -53,6 +53,10 @@ module Notifo
53
53
  # List of attributes with nullable: true
54
54
  def self.openapi_nullable
55
55
  Set.new([
56
+ :'message',
57
+ :'trace_id',
58
+ :'type',
59
+ :'details',
56
60
  ])
57
61
  end
58
62
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.24
9
+ Swagger Codegen version: 3.0.26
10
10
  =end
11
11
 
12
12
  require 'date'
@@ -47,6 +47,9 @@ module Notifo
47
47
  # True when silent.
48
48
  attr_accessor :silent
49
49
 
50
+ # The time to live in seconds.
51
+ attr_accessor :time_to_live_in_seconds
52
+
50
53
  # Attribute mapping from ruby-style variable name to JSON key.
51
54
  def self.attribute_map
52
55
  {
@@ -61,7 +64,8 @@ module Notifo
61
64
  :'properties' => :'properties',
62
65
  :'scheduling' => :'scheduling',
63
66
  :'counters' => :'counters',
64
- :'silent' => :'silent'
67
+ :'silent' => :'silent',
68
+ :'time_to_live_in_seconds' => :'timeToLiveInSeconds'
65
69
  }
66
70
  end
67
71
 
@@ -79,13 +83,17 @@ module Notifo
79
83
  :'properties' => :'Object',
80
84
  :'scheduling' => :'Object',
81
85
  :'counters' => :'Object',
82
- :'silent' => :'Object'
86
+ :'silent' => :'Object',
87
+ :'time_to_live_in_seconds' => :'Object'
83
88
  }
84
89
  end
85
90
 
86
91
  # List of attributes with nullable: true
87
92
  def self.openapi_nullable
88
93
  Set.new([
94
+ :'creator_id',
95
+ :'data',
96
+ :'time_to_live_in_seconds'
89
97
  ])
90
98
  end
91
99
 
@@ -157,6 +165,10 @@ module Notifo
157
165
  if attributes.key?(:'silent')
158
166
  self.silent = attributes[:'silent']
159
167
  end
168
+
169
+ if attributes.key?(:'time_to_live_in_seconds')
170
+ self.time_to_live_in_seconds = attributes[:'time_to_live_in_seconds']
171
+ end
160
172
  end
161
173
 
162
174
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -233,7 +245,8 @@ module Notifo
233
245
  properties == o.properties &&
234
246
  scheduling == o.scheduling &&
235
247
  counters == o.counters &&
236
- silent == o.silent
248
+ silent == o.silent &&
249
+ time_to_live_in_seconds == o.time_to_live_in_seconds
237
250
  end
238
251
 
239
252
  # @see the `==` method
@@ -245,7 +258,7 @@ module Notifo
245
258
  # Calculates hash code according to all attributes.
246
259
  # @return [Integer] Hash code
247
260
  def hash
248
- [id, topic, creator_id, display_name, data, created, formatting, settings, properties, scheduling, counters, silent].hash
261
+ [id, topic, creator_id, display_name, data, created, formatting, settings, properties, scheduling, counters, silent, time_to_live_in_seconds].hash
249
262
  end
250
263
 
251
264
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 1.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.24
9
+ Swagger Codegen version: 3.0.26
10
10
  =end
11
11
 
12
12
  require 'date'
@@ -0,0 +1,226 @@
1
+ =begin
2
+ #Notifo API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.26
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module Notifo
15
+ class IntegrationCreatedDto
16
+ # The id of the integration.
17
+ attr_accessor :id
18
+
19
+ attr_accessor :integration
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id' => :'id',
25
+ :'integration' => :'integration'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'id' => :'Object',
33
+ :'integration' => :'Object'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::IntegrationCreatedDto` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::IntegrationCreatedDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'id')
59
+ self.id = attributes[:'id']
60
+ end
61
+
62
+ if attributes.key?(:'integration')
63
+ self.integration = attributes[:'integration']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if @id.nil?
72
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
73
+ end
74
+
75
+ if @integration.nil?
76
+ invalid_properties.push('invalid value for "integration", integration cannot be nil.')
77
+ end
78
+
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
+ return false if @id.nil?
86
+ return false if @integration.nil?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ id == o.id &&
96
+ integration == o.integration
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [id, integration].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ end
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :DateTime
147
+ DateTime.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ Notifo.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end end
226
+ end