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
  module Notifo
@@ -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
  module Notifo
@@ -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
  module Notifo
@@ -0,0 +1,112 @@
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
+ module Notifo
13
+ class UserInfoApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # @param [Hash] opts the optional parameters
20
+ # @return [nil]
21
+ def user_info_userinfo(opts = {})
22
+ user_info_userinfo_with_http_info(opts)
23
+ nil
24
+ end
25
+
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
28
+ def user_info_userinfo_with_http_info(opts = {})
29
+ if @api_client.config.debugging
30
+ @api_client.config.logger.debug 'Calling API: UserInfoApi.user_info_userinfo ...'
31
+ end
32
+ # resource path
33
+ local_var_path = '/connect/userinfo'
34
+
35
+ # query parameters
36
+ query_params = opts[:query_params] || {}
37
+
38
+ # header parameters
39
+ header_params = opts[:header_params] || {}
40
+ # HTTP header 'Accept' (if needed)
41
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
42
+
43
+ # form parameters
44
+ form_params = opts[:form_params] || {}
45
+
46
+ # http body (model)
47
+ post_body = opts[:body]
48
+
49
+ return_type = opts[:return_type]
50
+
51
+ auth_names = opts[:auth_names] || []
52
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
53
+ :header_params => header_params,
54
+ :query_params => query_params,
55
+ :form_params => form_params,
56
+ :body => post_body,
57
+ :auth_names => auth_names,
58
+ :return_type => return_type)
59
+
60
+ if @api_client.config.debugging
61
+ @api_client.config.logger.debug "API called: UserInfoApi#user_info_userinfo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
62
+ end
63
+ return data, status_code, headers
64
+ end
65
+ # @param [Hash] opts the optional parameters
66
+ # @return [nil]
67
+ def user_info_userinfo2(opts = {})
68
+ user_info_userinfo2_with_http_info(opts)
69
+ nil
70
+ end
71
+
72
+ # @param [Hash] opts the optional parameters
73
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
74
+ def user_info_userinfo2_with_http_info(opts = {})
75
+ if @api_client.config.debugging
76
+ @api_client.config.logger.debug 'Calling API: UserInfoApi.user_info_userinfo2 ...'
77
+ end
78
+ # resource path
79
+ local_var_path = '/connect/userinfo'
80
+
81
+ # query parameters
82
+ query_params = opts[:query_params] || {}
83
+
84
+ # header parameters
85
+ header_params = opts[:header_params] || {}
86
+ # HTTP header 'Accept' (if needed)
87
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
88
+
89
+ # form parameters
90
+ form_params = opts[:form_params] || {}
91
+
92
+ # http body (model)
93
+ post_body = opts[:body]
94
+
95
+ return_type = opts[:return_type]
96
+
97
+ auth_names = opts[:auth_names] || []
98
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
99
+ :header_params => header_params,
100
+ :query_params => query_params,
101
+ :form_params => form_params,
102
+ :body => post_body,
103
+ :auth_names => auth_names,
104
+ :return_type => return_type)
105
+
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug "API called: UserInfoApi#user_info_userinfo2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
108
+ end
109
+ return data, status_code, headers
110
+ end
111
+ end
112
+ 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
  module Notifo
@@ -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
  module Notifo
@@ -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
  module Notifo
@@ -126,8 +126,8 @@ module Notifo
126
126
 
127
127
  def initialize
128
128
  @scheme = 'https'
129
- @host = 'app.notifo.io'
130
- @base_path = 'https://app.notifo.io'
129
+ @host = 'notifo.easierlife.com'
130
+ @base_path = 'https://notifo.easierlife.com'
131
131
  @api_key = {}
132
132
  @api_key_prefix = {}
133
133
  @timeout = 0
@@ -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'
@@ -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'
@@ -25,32 +25,9 @@ module Notifo
25
25
  # The supported languages.
26
26
  attr_accessor :languages
27
27
 
28
- # The sender email address.
29
- attr_accessor :email_address
30
-
31
- # The sender email name.
32
- attr_accessor :email_name
33
-
34
- # The firebase project ID.
35
- attr_accessor :firebase_project
36
-
37
- # The firebase credentials.
38
- attr_accessor :firebase_credential
39
-
40
- # The webhook URL.
41
- attr_accessor :webhook_url
42
-
43
28
  # The confirm URL.
44
29
  attr_accessor :confirm_url
45
30
 
46
- # True, when emails are allowed.
47
- attr_accessor :allow_email
48
-
49
- # True, when SMS are allowed.
50
- attr_accessor :allow_sms
51
-
52
- attr_accessor :email_verification_status
53
-
54
31
  # The api keys.
55
32
  attr_accessor :api_keys
56
33
 
@@ -67,15 +44,7 @@ module Notifo
67
44
  :'name' => :'name',
68
45
  :'role' => :'role',
69
46
  :'languages' => :'languages',
70
- :'email_address' => :'emailAddress',
71
- :'email_name' => :'emailName',
72
- :'firebase_project' => :'firebaseProject',
73
- :'firebase_credential' => :'firebaseCredential',
74
- :'webhook_url' => :'webhookUrl',
75
47
  :'confirm_url' => :'confirmUrl',
76
- :'allow_email' => :'allowEmail',
77
- :'allow_sms' => :'allowSms',
78
- :'email_verification_status' => :'emailVerificationStatus',
79
48
  :'api_keys' => :'apiKeys',
80
49
  :'contributors' => :'contributors',
81
50
  :'counters' => :'counters'
@@ -89,15 +58,7 @@ module Notifo
89
58
  :'name' => :'Object',
90
59
  :'role' => :'Object',
91
60
  :'languages' => :'Object',
92
- :'email_address' => :'Object',
93
- :'email_name' => :'Object',
94
- :'firebase_project' => :'Object',
95
- :'firebase_credential' => :'Object',
96
- :'webhook_url' => :'Object',
97
61
  :'confirm_url' => :'Object',
98
- :'allow_email' => :'Object',
99
- :'allow_sms' => :'Object',
100
- :'email_verification_status' => :'Object',
101
62
  :'api_keys' => :'Object',
102
63
  :'contributors' => :'Object',
103
64
  :'counters' => :'Object'
@@ -107,6 +68,7 @@ module Notifo
107
68
  # List of attributes with nullable: true
108
69
  def self.openapi_nullable
109
70
  Set.new([
71
+ :'confirm_url',
110
72
  ])
111
73
  end
112
74
 
@@ -143,42 +105,10 @@ module Notifo
143
105
  end
144
106
  end
145
107
 
146
- if attributes.key?(:'email_address')
147
- self.email_address = attributes[:'email_address']
148
- end
149
-
150
- if attributes.key?(:'email_name')
151
- self.email_name = attributes[:'email_name']
152
- end
153
-
154
- if attributes.key?(:'firebase_project')
155
- self.firebase_project = attributes[:'firebase_project']
156
- end
157
-
158
- if attributes.key?(:'firebase_credential')
159
- self.firebase_credential = attributes[:'firebase_credential']
160
- end
161
-
162
- if attributes.key?(:'webhook_url')
163
- self.webhook_url = attributes[:'webhook_url']
164
- end
165
-
166
108
  if attributes.key?(:'confirm_url')
167
109
  self.confirm_url = attributes[:'confirm_url']
168
110
  end
169
111
 
170
- if attributes.key?(:'allow_email')
171
- self.allow_email = attributes[:'allow_email']
172
- end
173
-
174
- if attributes.key?(:'allow_sms')
175
- self.allow_sms = attributes[:'allow_sms']
176
- end
177
-
178
- if attributes.key?(:'email_verification_status')
179
- self.email_verification_status = attributes[:'email_verification_status']
180
- end
181
-
182
112
  if attributes.key?(:'api_keys')
183
113
  if (value = attributes[:'api_keys']).is_a?(Hash)
184
114
  self.api_keys = value
@@ -218,18 +148,6 @@ module Notifo
218
148
  invalid_properties.push('invalid value for "languages", languages cannot be nil.')
219
149
  end
220
150
 
221
- if @allow_email.nil?
222
- invalid_properties.push('invalid value for "allow_email", allow_email cannot be nil.')
223
- end
224
-
225
- if @allow_sms.nil?
226
- invalid_properties.push('invalid value for "allow_sms", allow_sms cannot be nil.')
227
- end
228
-
229
- if @email_verification_status.nil?
230
- invalid_properties.push('invalid value for "email_verification_status", email_verification_status cannot be nil.')
231
- end
232
-
233
151
  if @api_keys.nil?
234
152
  invalid_properties.push('invalid value for "api_keys", api_keys cannot be nil.')
235
153
  end
@@ -252,9 +170,6 @@ module Notifo
252
170
  return false if @name.nil?
253
171
  return false if @role.nil?
254
172
  return false if @languages.nil?
255
- return false if @allow_email.nil?
256
- return false if @allow_sms.nil?
257
- return false if @email_verification_status.nil?
258
173
  return false if @api_keys.nil?
259
174
  return false if @contributors.nil?
260
175
  return false if @counters.nil?
@@ -270,15 +185,7 @@ module Notifo
270
185
  name == o.name &&
271
186
  role == o.role &&
272
187
  languages == o.languages &&
273
- email_address == o.email_address &&
274
- email_name == o.email_name &&
275
- firebase_project == o.firebase_project &&
276
- firebase_credential == o.firebase_credential &&
277
- webhook_url == o.webhook_url &&
278
188
  confirm_url == o.confirm_url &&
279
- allow_email == o.allow_email &&
280
- allow_sms == o.allow_sms &&
281
- email_verification_status == o.email_verification_status &&
282
189
  api_keys == o.api_keys &&
283
190
  contributors == o.contributors &&
284
191
  counters == o.counters
@@ -293,7 +200,7 @@ module Notifo
293
200
  # Calculates hash code according to all attributes.
294
201
  # @return [Integer] Hash code
295
202
  def hash
296
- [id, name, role, languages, email_address, email_name, firebase_project, firebase_credential, webhook_url, confirm_url, allow_email, allow_sms, email_verification_status, api_keys, contributors, counters].hash
203
+ [id, name, role, languages, confirm_url, api_keys, contributors, counters].hash
297
204
  end
298
205
 
299
206
  # 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,207 @@
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 AppIdMediaBody
16
+ attr_accessor :file
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'file' => :'file'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.openapi_types
27
+ {
28
+ :'file' => :'Object'
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new([
35
+ :'file'
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Notifo::AppIdMediaBody` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Notifo::AppIdMediaBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'file')
55
+ self.file = attributes[:'file']
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ file == o.file
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(o)
83
+ self == o
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Integer] Hash code
88
+ def hash
89
+ [file].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def self.build_from_hash(attributes)
96
+ new.build_from_hash(attributes)
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.openapi_types.each_pair do |key, type|
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[self.class.attribute_map[key]].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ end
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :Boolean
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ Notifo.const_get(type).build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end end
207
+ end