doorflow 1.0.0 → 1.1.0

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 (197) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +222 -316
  4. data/bin/post-generate +3 -1
  5. data/doorflow.gemspec +1 -1
  6. data/lib/doorflow/client/credentials_proxy.rb +6 -9
  7. data/lib/doorflow/client/element_sessions_proxy.rb +91 -0
  8. data/lib/doorflow/client.rb +13 -0
  9. data/lib/doorflow/errors/doorflow_error.rb +1 -1
  10. data/lib/doorflow/resources/credential.rb +4 -3
  11. data/lib/doorflow/resources/element_session.rb +28 -0
  12. data/lib/doorflow/webhooks/handler.rb +6 -6
  13. data/lib/doorflow/webhooks/signature_verifier.rb +8 -5
  14. data/lib/doorflow-api/api/accounts_api.rb +1 -1
  15. data/lib/doorflow-api/api/admission_requests_api.rb +2 -2
  16. data/lib/doorflow-api/api/card_designs_api.rb +347 -0
  17. data/lib/doorflow-api/api/card_template_types_api.rb +350 -0
  18. data/lib/doorflow-api/api/card_templates_api.rb +811 -0
  19. data/lib/doorflow-api/api/channels_api.rb +11 -11
  20. data/lib/doorflow-api/api/credential_types_api.rb +1 -1
  21. data/lib/doorflow-api/api/credentials_api.rb +6 -6
  22. data/lib/doorflow-api/api/element_sessions_api.rb +90 -0
  23. data/lib/doorflow-api/api/events_api.rb +2 -2
  24. data/lib/doorflow-api/api/group_reservations_api.rb +68 -5
  25. data/lib/doorflow-api/api/groups_api.rb +1 -1
  26. data/lib/doorflow-api/api/notification_rules_api.rb +7 -7
  27. data/lib/doorflow-api/api/oauth_api.rb +1 -1
  28. data/lib/doorflow-api/api/people_api.rb +7 -7
  29. data/lib/doorflow-api/api/reservations_api.rb +5 -5
  30. data/lib/doorflow-api/api/roles_api.rb +1 -1
  31. data/lib/doorflow-api/api/sites_api.rb +1 -1
  32. data/lib/doorflow-api/api/sync_api.rb +4 -4
  33. data/lib/doorflow-api/api_client.rb +8 -4
  34. data/lib/doorflow-api/api_error.rb +9 -14
  35. data/lib/doorflow-api/api_model_base.rb +1 -1
  36. data/lib/doorflow-api/configuration.rb +1 -1
  37. data/lib/doorflow-api/models/account.rb +1 -1
  38. data/lib/doorflow-api/models/account_passport.rb +1 -1
  39. data/lib/doorflow-api/models/account_reseller.rb +1 -1
  40. data/lib/doorflow-api/models/account_sync.rb +1 -1
  41. data/lib/doorflow-api/models/account_user.rb +1 -1
  42. data/lib/doorflow-api/models/admission_request.rb +1 -1
  43. data/lib/doorflow-api/models/admission_request_door_controller.rb +1 -1
  44. data/lib/doorflow-api/models/admission_request_person.rb +1 -1
  45. data/lib/doorflow-api/models/admit_channel202_response.rb +1 -1
  46. data/lib/doorflow-api/models/admit_person202_response.rb +1 -1
  47. data/lib/doorflow-api/models/admit_person403_response.rb +1 -1
  48. data/lib/doorflow-api/models/admit_person_request.rb +1 -1
  49. data/lib/doorflow-api/models/auto_unlock_channel400_response.rb +1 -1
  50. data/lib/doorflow-api/models/auto_unlock_channel_request.rb +1 -1
  51. data/lib/doorflow-api/models/card_design.rb +243 -0
  52. data/lib/doorflow-api/models/card_design_image_back.rb +179 -0
  53. data/lib/doorflow-api/models/card_design_image_front.rb +179 -0
  54. data/lib/doorflow-api/models/card_design_input.rb +181 -0
  55. data/lib/doorflow-api/models/card_template.rb +475 -0
  56. data/lib/doorflow-api/models/card_template_input.rb +147 -0
  57. data/lib/doorflow-api/models/card_template_input_card_template.rb +347 -0
  58. data/lib/doorflow-api/models/card_template_type.rb +321 -0
  59. data/lib/doorflow-api/models/card_template_type_input.rb +147 -0
  60. data/lib/doorflow-api/models/card_template_type_input_card_template_type.rb +251 -0
  61. data/lib/doorflow-api/models/card_template_type_input_card_template_type_non_printable_zones_inner.rb +183 -0
  62. data/lib/doorflow-api/models/card_template_type_non_printable_zones_inner.rb +188 -0
  63. data/lib/doorflow-api/models/channel.rb +1 -1
  64. data/lib/doorflow-api/models/channel_auto_unlock.rb +1 -1
  65. data/lib/doorflow-api/models/channel_lockdown.rb +1 -1
  66. data/lib/doorflow-api/models/channel_lockdown_aux_lockdown.rb +1 -1
  67. data/lib/doorflow-api/models/channel_lockdown_card_lockdown.rb +1 -1
  68. data/lib/doorflow-api/models/channel_lockdown_rex_lockdown.rb +1 -1
  69. data/lib/doorflow-api/models/channel_mode.rb +1 -1
  70. data/lib/doorflow-api/models/channel_sync.rb +5 -2
  71. data/lib/doorflow-api/models/{create_credential422_response.rb → create_card_design422_response.rb} +5 -5
  72. data/lib/doorflow-api/models/{create_credential422_response_errors.rb → create_card_design422_response_errors.rb} +4 -4
  73. data/lib/doorflow-api/models/credential.rb +4 -4
  74. data/lib/doorflow-api/models/credential_input.rb +1 -1
  75. data/lib/doorflow-api/models/credential_input_person_credential.rb +1 -1
  76. data/lib/doorflow-api/models/credential_type.rb +1 -1
  77. data/lib/doorflow-api/models/credential_update_input.rb +1 -1
  78. data/lib/doorflow-api/models/credential_update_input_person_credential.rb +1 -1
  79. data/lib/doorflow-api/models/{delete_group_reservation200_response.rb → delete_card_design200_response.rb} +4 -4
  80. data/lib/doorflow-api/models/delete_card_template_type409_response.rb +147 -0
  81. data/lib/doorflow-api/models/element_session.rb +192 -0
  82. data/lib/doorflow-api/models/element_session_config.rb +265 -0
  83. data/lib/doorflow-api/models/element_session_error.rb +199 -0
  84. data/lib/doorflow-api/models/element_session_input.rb +271 -0
  85. data/lib/doorflow-api/models/element_session_member.rb +186 -0
  86. data/lib/doorflow-api/models/error.rb +1 -1
  87. data/lib/doorflow-api/models/event.rb +1 -1
  88. data/lib/doorflow-api/models/get_access_token200_response.rb +1 -1
  89. data/lib/doorflow-api/models/get_access_token400_response.rb +1 -1
  90. data/lib/doorflow-api/models/get_access_token401_response.rb +1 -1
  91. data/lib/doorflow-api/models/get_admission_request401_response.rb +1 -1
  92. data/lib/doorflow-api/models/get_admission_request403_response.rb +1 -1
  93. data/lib/doorflow-api/models/get_admission_request404_response.rb +1 -1
  94. data/lib/doorflow-api/models/get_admission_request500_response.rb +1 -1
  95. data/lib/doorflow-api/models/get_token_info200_response.rb +1 -1
  96. data/lib/doorflow-api/models/get_token_info200_response_application.rb +1 -1
  97. data/lib/doorflow-api/models/get_token_info401_response.rb +1 -1
  98. data/lib/doorflow-api/models/group.rb +1 -1
  99. data/lib/doorflow-api/models/group_reservation.rb +1 -1
  100. data/lib/doorflow-api/models/group_reservation_input.rb +1 -1
  101. data/lib/doorflow-api/models/group_reservation_input_group_reservation.rb +1 -1
  102. data/lib/doorflow-api/models/initiate_sync429_response.rb +1 -1
  103. data/lib/doorflow-api/models/linked_file.rb +217 -0
  104. data/lib/doorflow-api/models/list_events400_response.rb +1 -1
  105. data/lib/doorflow-api/models/lockdown_channel_request.rb +1 -1
  106. data/lib/doorflow-api/models/notification_rule.rb +1 -1
  107. data/lib/doorflow-api/models/notification_rule_actions_inner.rb +1 -1
  108. data/lib/doorflow-api/models/notification_rule_conditions_inner.rb +1 -1
  109. data/lib/doorflow-api/models/notification_rule_events_inner.rb +1 -1
  110. data/lib/doorflow-api/models/notification_rule_input.rb +1 -1
  111. data/lib/doorflow-api/models/person.rb +30 -8
  112. data/lib/doorflow-api/models/person_input.rb +1 -1
  113. data/lib/doorflow-api/models/reservation.rb +1 -1
  114. data/lib/doorflow-api/models/reservation_input.rb +1 -1
  115. data/lib/doorflow-api/models/revoke_token403_response.rb +1 -1
  116. data/lib/doorflow-api/models/role.rb +1 -1
  117. data/lib/doorflow-api/models/site.rb +1 -1
  118. data/lib/doorflow-api/models/site_site_ips_inner.rb +1 -1
  119. data/lib/doorflow-api/models/unlock_channel_request.rb +1 -1
  120. data/lib/doorflow-api/version.rb +2 -2
  121. data/lib/doorflow-api.rb +28 -9
  122. data/lib/doorflow.rb +8 -2
  123. metadata +45 -154
  124. data/spec/api/admission_requests_api_spec.rb +0 -47
  125. data/spec/api/channels_api_spec.rb +0 -174
  126. data/spec/api/credential_types_api_spec.rb +0 -49
  127. data/spec/api/group_reservations_api_spec.rb +0 -75
  128. data/spec/api/oauth_api_spec.rb +0 -97
  129. data/spec/doorflow/client_spec.rb +0 -109
  130. data/spec/doorflow_spec.rb +0 -22
  131. data/spec/fixtures/vcr_cassettes/channel/list.yml +0 -70
  132. data/spec/fixtures/vcr_cassettes/channel/retrieve.yml +0 -131
  133. data/spec/fixtures/vcr_cassettes/person/auto_pagination.yml +0 -87
  134. data/spec/fixtures/vcr_cassettes/person/create.yml +0 -64
  135. data/spec/fixtures/vcr_cassettes/person/delete.yml +0 -125
  136. data/spec/fixtures/vcr_cassettes/person/list.yml +0 -90
  137. data/spec/fixtures/vcr_cassettes/person/not_found.yml +0 -62
  138. data/spec/fixtures/vcr_cassettes/person/retrieve.yml +0 -136
  139. data/spec/fixtures/vcr_cassettes/person/update.yml +0 -260
  140. data/spec/fixtures/vcr_cassettes/person/validation_error.yml +0 -62
  141. data/spec/integration/channel_spec.rb +0 -88
  142. data/spec/integration/person_spec.rb +0 -99
  143. data/spec/models/account_passport_spec.rb +0 -42
  144. data/spec/models/account_reseller_spec.rb +0 -60
  145. data/spec/models/account_sync_spec.rb +0 -52
  146. data/spec/models/account_user_spec.rb +0 -54
  147. data/spec/models/admission_request_door_controller_spec.rb +0 -42
  148. data/spec/models/admission_request_person_spec.rb +0 -42
  149. data/spec/models/admission_request_spec.rb +0 -82
  150. data/spec/models/admit_channel202_response_spec.rb +0 -46
  151. data/spec/models/admit_person202_response_spec.rb +0 -46
  152. data/spec/models/admit_person403_response_spec.rb +0 -42
  153. data/spec/models/admit_person_request_spec.rb +0 -36
  154. data/spec/models/auto_unlock_channel400_response_spec.rb +0 -42
  155. data/spec/models/auto_unlock_channel_request_spec.rb +0 -36
  156. data/spec/models/channel_auto_unlock_spec.rb +0 -42
  157. data/spec/models/channel_lockdown_aux_lockdown_spec.rb +0 -36
  158. data/spec/models/channel_lockdown_card_lockdown_spec.rb +0 -36
  159. data/spec/models/channel_lockdown_rex_lockdown_spec.rb +0 -36
  160. data/spec/models/channel_lockdown_spec.rb +0 -54
  161. data/spec/models/channel_mode_spec.rb +0 -52
  162. data/spec/models/channel_sync_spec.rb +0 -46
  163. data/spec/models/create_credential422_response_errors_spec.rb +0 -48
  164. data/spec/models/create_credential422_response_spec.rb +0 -42
  165. data/spec/models/credential_input_person_credential_spec.rb +0 -48
  166. data/spec/models/credential_input_spec.rb +0 -36
  167. data/spec/models/credential_spec.rb +0 -86
  168. data/spec/models/credential_update_input_person_credential_spec.rb +0 -36
  169. data/spec/models/credential_update_input_spec.rb +0 -36
  170. data/spec/models/delete_group_reservation200_response_spec.rb +0 -36
  171. data/spec/models/error_spec.rb +0 -42
  172. data/spec/models/get_access_token200_response_spec.rb +0 -66
  173. data/spec/models/get_access_token400_response_spec.rb +0 -46
  174. data/spec/models/get_access_token401_response_spec.rb +0 -42
  175. data/spec/models/get_admission_request401_response_spec.rb +0 -42
  176. data/spec/models/get_admission_request403_response_spec.rb +0 -42
  177. data/spec/models/get_admission_request404_response_spec.rb +0 -42
  178. data/spec/models/get_admission_request500_response_spec.rb +0 -42
  179. data/spec/models/get_token_info200_response_application_spec.rb +0 -36
  180. data/spec/models/get_token_info200_response_spec.rb +0 -66
  181. data/spec/models/get_token_info401_response_spec.rb +0 -42
  182. data/spec/models/group_reservation_input_group_reservation_spec.rb +0 -54
  183. data/spec/models/group_reservation_input_spec.rb +0 -36
  184. data/spec/models/group_reservation_spec.rb +0 -82
  185. data/spec/models/initiate_sync429_response_spec.rb +0 -52
  186. data/spec/models/list_events400_response_spec.rb +0 -42
  187. data/spec/models/lockdown_channel_request_spec.rb +0 -48
  188. data/spec/models/notification_rule_actions_inner_spec.rb +0 -48
  189. data/spec/models/notification_rule_conditions_inner_spec.rb +0 -48
  190. data/spec/models/notification_rule_events_inner_spec.rb +0 -42
  191. data/spec/models/notification_rule_input_spec.rb +0 -60
  192. data/spec/models/person_input_spec.rb +0 -180
  193. data/spec/models/reservation_input_spec.rb +0 -60
  194. data/spec/models/revoke_token403_response_spec.rb +0 -42
  195. data/spec/models/site_site_ips_inner_spec.rb +0 -36
  196. data/spec/models/unlock_channel_request_spec.rb +0 -36
  197. data/spec/spec_helper.rb +0 -160
@@ -0,0 +1,475 @@
1
+ =begin
2
+ #DoorFlow API
3
+
4
+ #Access control and door management API for DoorFlow
5
+
6
+ The version of the OpenAPI document: 3.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DoorFlow
17
+ class CardTemplate < ApiModelBase
18
+ # Server-assigned identifier
19
+ attr_accessor :id
20
+
21
+ # Client-generated UUID (RFC 4122)
22
+ attr_accessor :uuid
23
+
24
+ # Template display name, unique per account
25
+ attr_accessor :name
26
+
27
+ # References a template type code
28
+ attr_accessor :template_type_code
29
+
30
+ # Card finish/format
31
+ attr_accessor :card_type
32
+
33
+ # Whether the card has a reverse side
34
+ attr_accessor :double_sided
35
+
36
+ # P = Portrait, L = Landscape
37
+ attr_accessor :orientation_front
38
+
39
+ # P = Portrait, L = Landscape
40
+ attr_accessor :orientation_back
41
+
42
+ # Whether this is the account default template
43
+ attr_accessor :default_template
44
+
45
+ # URL to the front background image, or null if not set
46
+ attr_accessor :background_image_front_url
47
+
48
+ # URL to the back background image, or null if not set
49
+ attr_accessor :background_image_back_url
50
+
51
+ # Free-form JSONB objects representing layout elements on this template
52
+ attr_accessor :template_objects
53
+
54
+ # ID of the user who owns this template, or null if unowned. Set server-side on create. May be reassigned via PATCH by the current owner or by any admin in the account; the new value must be the ID of an admin in the same account.
55
+ attr_accessor :owner_id
56
+
57
+ # Who can edit this template
58
+ attr_accessor :editable_by
59
+
60
+ # Soft-delete timestamp. Null for live templates. Writable via PATCH: sending a non-null value soft-deletes the template; sending null restores it. Soft-deleted templates are excluded from index by default (see include_deleted).
61
+ attr_accessor :deleted_at
62
+
63
+ # ID of the user who soft-deleted this template, set server-side from the authenticated user when deleted_at is written. Cleared when deleted_at is cleared.
64
+ attr_accessor :deleted_by_id
65
+
66
+ # Files linked to this template (images, fonts, etc.)
67
+ attr_accessor :linked_files
68
+
69
+ # ISO 8601 UTC timestamp.
70
+ attr_accessor :created_at
71
+
72
+ # ISO 8601 UTC timestamp.
73
+ attr_accessor :updated_at
74
+
75
+ class EnumAttributeValidator
76
+ attr_reader :datatype
77
+ attr_reader :allowable_values
78
+
79
+ def initialize(datatype, allowable_values)
80
+ @allowable_values = allowable_values.map do |value|
81
+ case datatype.to_s
82
+ when /Integer/i
83
+ value.to_i
84
+ when /Float/i
85
+ value.to_f
86
+ else
87
+ value
88
+ end
89
+ end
90
+ end
91
+
92
+ def valid?(value)
93
+ !value || allowable_values.include?(value)
94
+ end
95
+ end
96
+
97
+ # Attribute mapping from ruby-style variable name to JSON key.
98
+ def self.attribute_map
99
+ {
100
+ :'id' => :'id',
101
+ :'uuid' => :'uuid',
102
+ :'name' => :'name',
103
+ :'template_type_code' => :'template_type_code',
104
+ :'card_type' => :'card_type',
105
+ :'double_sided' => :'double_sided',
106
+ :'orientation_front' => :'orientation_front',
107
+ :'orientation_back' => :'orientation_back',
108
+ :'default_template' => :'default_template',
109
+ :'background_image_front_url' => :'background_image_front_url',
110
+ :'background_image_back_url' => :'background_image_back_url',
111
+ :'template_objects' => :'template_objects',
112
+ :'owner_id' => :'owner_id',
113
+ :'editable_by' => :'editable_by',
114
+ :'deleted_at' => :'deleted_at',
115
+ :'deleted_by_id' => :'deleted_by_id',
116
+ :'linked_files' => :'linked_files',
117
+ :'created_at' => :'created_at',
118
+ :'updated_at' => :'updated_at'
119
+ }
120
+ end
121
+
122
+ # Returns attribute mapping this model knows about
123
+ def self.acceptable_attribute_map
124
+ attribute_map
125
+ end
126
+
127
+ # Returns all the JSON keys this model knows about
128
+ def self.acceptable_attributes
129
+ acceptable_attribute_map.values
130
+ end
131
+
132
+ # Attribute type mapping.
133
+ def self.openapi_types
134
+ {
135
+ :'id' => :'Integer',
136
+ :'uuid' => :'String',
137
+ :'name' => :'String',
138
+ :'template_type_code' => :'String',
139
+ :'card_type' => :'String',
140
+ :'double_sided' => :'Boolean',
141
+ :'orientation_front' => :'String',
142
+ :'orientation_back' => :'String',
143
+ :'default_template' => :'Boolean',
144
+ :'background_image_front_url' => :'String',
145
+ :'background_image_back_url' => :'String',
146
+ :'template_objects' => :'Array<Object>',
147
+ :'owner_id' => :'Integer',
148
+ :'editable_by' => :'String',
149
+ :'deleted_at' => :'Time',
150
+ :'deleted_by_id' => :'Integer',
151
+ :'linked_files' => :'Array<LinkedFile>',
152
+ :'created_at' => :'Time',
153
+ :'updated_at' => :'Time'
154
+ }
155
+ end
156
+
157
+ # List of attributes with nullable: true
158
+ def self.openapi_nullable
159
+ Set.new([
160
+ :'background_image_front_url',
161
+ :'background_image_back_url',
162
+ :'owner_id',
163
+ :'deleted_at',
164
+ :'deleted_by_id',
165
+ ])
166
+ end
167
+
168
+ # Initializes the object
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ def initialize(attributes = {})
171
+ if (!attributes.is_a?(Hash))
172
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DoorFlow::CardTemplate` initialize method"
173
+ end
174
+
175
+ # check to see if the attribute exists and convert string to symbol for hash key
176
+ acceptable_attribute_map = self.class.acceptable_attribute_map
177
+ attributes = attributes.each_with_object({}) { |(k, v), h|
178
+ if (!acceptable_attribute_map.key?(k.to_sym))
179
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DoorFlow::CardTemplate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
180
+ end
181
+ h[k.to_sym] = v
182
+ }
183
+
184
+ if attributes.key?(:'id')
185
+ self.id = attributes[:'id']
186
+ else
187
+ self.id = nil
188
+ end
189
+
190
+ if attributes.key?(:'uuid')
191
+ self.uuid = attributes[:'uuid']
192
+ else
193
+ self.uuid = nil
194
+ end
195
+
196
+ if attributes.key?(:'name')
197
+ self.name = attributes[:'name']
198
+ else
199
+ self.name = nil
200
+ end
201
+
202
+ if attributes.key?(:'template_type_code')
203
+ self.template_type_code = attributes[:'template_type_code']
204
+ else
205
+ self.template_type_code = nil
206
+ end
207
+
208
+ if attributes.key?(:'card_type')
209
+ self.card_type = attributes[:'card_type']
210
+ end
211
+
212
+ if attributes.key?(:'double_sided')
213
+ self.double_sided = attributes[:'double_sided']
214
+ end
215
+
216
+ if attributes.key?(:'orientation_front')
217
+ self.orientation_front = attributes[:'orientation_front']
218
+ end
219
+
220
+ if attributes.key?(:'orientation_back')
221
+ self.orientation_back = attributes[:'orientation_back']
222
+ end
223
+
224
+ if attributes.key?(:'default_template')
225
+ self.default_template = attributes[:'default_template']
226
+ end
227
+
228
+ if attributes.key?(:'background_image_front_url')
229
+ self.background_image_front_url = attributes[:'background_image_front_url']
230
+ end
231
+
232
+ if attributes.key?(:'background_image_back_url')
233
+ self.background_image_back_url = attributes[:'background_image_back_url']
234
+ end
235
+
236
+ if attributes.key?(:'template_objects')
237
+ if (value = attributes[:'template_objects']).is_a?(Array)
238
+ self.template_objects = value
239
+ end
240
+ end
241
+
242
+ if attributes.key?(:'owner_id')
243
+ self.owner_id = attributes[:'owner_id']
244
+ end
245
+
246
+ if attributes.key?(:'editable_by')
247
+ self.editable_by = attributes[:'editable_by']
248
+ end
249
+
250
+ if attributes.key?(:'deleted_at')
251
+ self.deleted_at = attributes[:'deleted_at']
252
+ end
253
+
254
+ if attributes.key?(:'deleted_by_id')
255
+ self.deleted_by_id = attributes[:'deleted_by_id']
256
+ end
257
+
258
+ if attributes.key?(:'linked_files')
259
+ if (value = attributes[:'linked_files']).is_a?(Array)
260
+ self.linked_files = value
261
+ end
262
+ end
263
+
264
+ if attributes.key?(:'created_at')
265
+ self.created_at = attributes[:'created_at']
266
+ end
267
+
268
+ if attributes.key?(:'updated_at')
269
+ self.updated_at = attributes[:'updated_at']
270
+ end
271
+ end
272
+
273
+ # Show invalid properties with the reasons. Usually used together with valid?
274
+ # @return Array for valid properties with the reasons
275
+ def list_invalid_properties
276
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
277
+ invalid_properties = Array.new
278
+ if @id.nil?
279
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
280
+ end
281
+
282
+ if @uuid.nil?
283
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
284
+ end
285
+
286
+ if @name.nil?
287
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
288
+ end
289
+
290
+ if @template_type_code.nil?
291
+ invalid_properties.push('invalid value for "template_type_code", template_type_code cannot be nil.')
292
+ end
293
+
294
+ invalid_properties
295
+ end
296
+
297
+ # Check to see if the all the properties in the model are valid
298
+ # @return true if the model is valid
299
+ def valid?
300
+ warn '[DEPRECATED] the `valid?` method is obsolete'
301
+ return false if @id.nil?
302
+ return false if @uuid.nil?
303
+ return false if @name.nil?
304
+ return false if @template_type_code.nil?
305
+ card_type_validator = EnumAttributeValidator.new('String', ["standard", "signature_stripe"])
306
+ return false unless card_type_validator.valid?(@card_type)
307
+ orientation_front_validator = EnumAttributeValidator.new('String', ["P", "L"])
308
+ return false unless orientation_front_validator.valid?(@orientation_front)
309
+ orientation_back_validator = EnumAttributeValidator.new('String', ["P", "L"])
310
+ return false unless orientation_back_validator.valid?(@orientation_back)
311
+ editable_by_validator = EnumAttributeValidator.new('String', ["owner_only", "any_admin"])
312
+ return false unless editable_by_validator.valid?(@editable_by)
313
+ true
314
+ end
315
+
316
+ # Custom attribute writer method with validation
317
+ # @param [Object] id Value to be assigned
318
+ def id=(id)
319
+ if id.nil?
320
+ fail ArgumentError, 'id cannot be nil'
321
+ end
322
+
323
+ @id = id
324
+ end
325
+
326
+ # Custom attribute writer method with validation
327
+ # @param [Object] uuid Value to be assigned
328
+ def uuid=(uuid)
329
+ if uuid.nil?
330
+ fail ArgumentError, 'uuid cannot be nil'
331
+ end
332
+
333
+ @uuid = uuid
334
+ end
335
+
336
+ # Custom attribute writer method with validation
337
+ # @param [Object] name Value to be assigned
338
+ def name=(name)
339
+ if name.nil?
340
+ fail ArgumentError, 'name cannot be nil'
341
+ end
342
+
343
+ @name = name
344
+ end
345
+
346
+ # Custom attribute writer method with validation
347
+ # @param [Object] template_type_code Value to be assigned
348
+ def template_type_code=(template_type_code)
349
+ if template_type_code.nil?
350
+ fail ArgumentError, 'template_type_code cannot be nil'
351
+ end
352
+
353
+ @template_type_code = template_type_code
354
+ end
355
+
356
+ # Custom attribute writer method checking allowed values (enum).
357
+ # @param [Object] card_type Object to be assigned
358
+ def card_type=(card_type)
359
+ validator = EnumAttributeValidator.new('String', ["standard", "signature_stripe"])
360
+ unless validator.valid?(card_type)
361
+ fail ArgumentError, "invalid value for \"card_type\", must be one of #{validator.allowable_values}."
362
+ end
363
+ @card_type = card_type
364
+ end
365
+
366
+ # Custom attribute writer method checking allowed values (enum).
367
+ # @param [Object] orientation_front Object to be assigned
368
+ def orientation_front=(orientation_front)
369
+ validator = EnumAttributeValidator.new('String', ["P", "L"])
370
+ unless validator.valid?(orientation_front)
371
+ fail ArgumentError, "invalid value for \"orientation_front\", must be one of #{validator.allowable_values}."
372
+ end
373
+ @orientation_front = orientation_front
374
+ end
375
+
376
+ # Custom attribute writer method checking allowed values (enum).
377
+ # @param [Object] orientation_back Object to be assigned
378
+ def orientation_back=(orientation_back)
379
+ validator = EnumAttributeValidator.new('String', ["P", "L"])
380
+ unless validator.valid?(orientation_back)
381
+ fail ArgumentError, "invalid value for \"orientation_back\", must be one of #{validator.allowable_values}."
382
+ end
383
+ @orientation_back = orientation_back
384
+ end
385
+
386
+ # Custom attribute writer method checking allowed values (enum).
387
+ # @param [Object] editable_by Object to be assigned
388
+ def editable_by=(editable_by)
389
+ validator = EnumAttributeValidator.new('String', ["owner_only", "any_admin"])
390
+ unless validator.valid?(editable_by)
391
+ fail ArgumentError, "invalid value for \"editable_by\", must be one of #{validator.allowable_values}."
392
+ end
393
+ @editable_by = editable_by
394
+ end
395
+
396
+ # Checks equality by comparing each attribute.
397
+ # @param [Object] Object to be compared
398
+ def ==(o)
399
+ return true if self.equal?(o)
400
+ self.class == o.class &&
401
+ id == o.id &&
402
+ uuid == o.uuid &&
403
+ name == o.name &&
404
+ template_type_code == o.template_type_code &&
405
+ card_type == o.card_type &&
406
+ double_sided == o.double_sided &&
407
+ orientation_front == o.orientation_front &&
408
+ orientation_back == o.orientation_back &&
409
+ default_template == o.default_template &&
410
+ background_image_front_url == o.background_image_front_url &&
411
+ background_image_back_url == o.background_image_back_url &&
412
+ template_objects == o.template_objects &&
413
+ owner_id == o.owner_id &&
414
+ editable_by == o.editable_by &&
415
+ deleted_at == o.deleted_at &&
416
+ deleted_by_id == o.deleted_by_id &&
417
+ linked_files == o.linked_files &&
418
+ created_at == o.created_at &&
419
+ updated_at == o.updated_at
420
+ end
421
+
422
+ # @see the `==` method
423
+ # @param [Object] Object to be compared
424
+ def eql?(o)
425
+ self == o
426
+ end
427
+
428
+ # Calculates hash code according to all attributes.
429
+ # @return [Integer] Hash code
430
+ def hash
431
+ [id, uuid, name, template_type_code, card_type, double_sided, orientation_front, orientation_back, default_template, background_image_front_url, background_image_back_url, template_objects, owner_id, editable_by, deleted_at, deleted_by_id, linked_files, created_at, updated_at].hash
432
+ end
433
+
434
+ # Builds the object from hash
435
+ # @param [Hash] attributes Model attributes in the form of hash
436
+ # @return [Object] Returns the model itself
437
+ def self.build_from_hash(attributes)
438
+ return nil unless attributes.is_a?(Hash)
439
+ attributes = attributes.transform_keys(&:to_sym)
440
+ transformed_hash = {}
441
+ openapi_types.each_pair do |key, type|
442
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
443
+ transformed_hash["#{key}"] = nil
444
+ elsif type =~ /\AArray<(.*)>/i
445
+ # check to ensure the input is an array given that the attribute
446
+ # is documented as an array but the input is not
447
+ if attributes[attribute_map[key]].is_a?(Array)
448
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
449
+ end
450
+ elsif !attributes[attribute_map[key]].nil?
451
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
452
+ end
453
+ end
454
+ new(transformed_hash)
455
+ end
456
+
457
+ # Returns the object in the form of hash
458
+ # @return [Hash] Returns the object in the form of hash
459
+ def to_hash
460
+ hash = {}
461
+ self.class.attribute_map.each_pair do |attr, param|
462
+ value = self.send(attr)
463
+ if value.nil?
464
+ is_nullable = self.class.openapi_nullable.include?(attr)
465
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
466
+ end
467
+
468
+ hash[param] = _to_hash(value)
469
+ end
470
+ hash
471
+ end
472
+
473
+ end
474
+
475
+ end
@@ -0,0 +1,147 @@
1
+ =begin
2
+ #DoorFlow API
3
+
4
+ #Access control and door management API for DoorFlow
5
+
6
+ The version of the OpenAPI document: 3.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DoorFlow
17
+ class CardTemplateInput < ApiModelBase
18
+ attr_accessor :card_template
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'card_template' => :'card_template'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'card_template' => :'CardTemplateInputCardTemplate'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DoorFlow::CardTemplateInput` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DoorFlow::CardTemplateInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'card_template')
67
+ self.card_template = attributes[:'card_template']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ card_template == o.card_template
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [card_template].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ transformed_hash = {}
113
+ openapi_types.each_pair do |key, type|
114
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
+ transformed_hash["#{key}"] = nil
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
+ end
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
+ end
125
+ end
126
+ new(transformed_hash)
127
+ end
128
+
129
+ # Returns the object in the form of hash
130
+ # @return [Hash] Returns the object in the form of hash
131
+ def to_hash
132
+ hash = {}
133
+ self.class.attribute_map.each_pair do |attr, param|
134
+ value = self.send(attr)
135
+ if value.nil?
136
+ is_nullable = self.class.openapi_nullable.include?(attr)
137
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
138
+ end
139
+
140
+ hash[param] = _to_hash(value)
141
+ end
142
+ hash
143
+ end
144
+
145
+ end
146
+
147
+ end