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
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -21,36 +21,31 @@ module DoorFlow
21
21
  # ApiError.new(:code => 404, :message => "Not Found")
22
22
  def initialize(arg = nil)
23
23
  if arg.is_a? Hash
24
- @message = arg[:message] || arg['message']
25
- super(@message)
24
+ if arg.key?(:message) || arg.key?('message')
25
+ super(arg[:message] || arg['message'])
26
+ else
27
+ super arg
28
+ end
26
29
 
27
30
  arg.each do |k, v|
28
31
  instance_variable_set "@#{k}", v
29
32
  end
30
33
  else
34
+ super arg
31
35
  @message = arg
32
- super(arg)
33
36
  end
34
37
  end
35
38
 
36
39
  # Override to_s to display a friendly error message
37
40
  def to_s
38
- build_message
41
+ message
39
42
  end
40
43
 
41
44
  def message
42
- build_message
43
- end
44
-
45
- private
46
-
47
- def build_message
48
45
  if @message.nil?
49
46
  msg = "Error message: the server returns an error"
50
- elsif @message.is_a?(String)
51
- msg = @message
52
47
  else
53
- msg = @message.to_s
48
+ msg = @message
54
49
  end
55
50
 
56
51
  msg += "\nHTTP status code: #{code}" if code
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 3.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.18.0-SNAPSHOT
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,243 @@
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 CardDesign < ApiModelBase
18
+ # Unique identifier for the card design
19
+ attr_accessor :id
20
+
21
+ # Name of the card design
22
+ attr_accessor :name
23
+
24
+ # Free-text notes about the card design
25
+ attr_accessor :notes
26
+
27
+ attr_accessor :image_front
28
+
29
+ attr_accessor :image_back
30
+
31
+ # Timestamp of creation
32
+ attr_accessor :created_at
33
+
34
+ # Timestamp of last update
35
+ attr_accessor :updated_at
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'id' => :'id',
41
+ :'name' => :'name',
42
+ :'notes' => :'notes',
43
+ :'image_front' => :'image_front',
44
+ :'image_back' => :'image_back',
45
+ :'created_at' => :'created_at',
46
+ :'updated_at' => :'updated_at'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'id' => :'Integer',
64
+ :'name' => :'String',
65
+ :'notes' => :'String',
66
+ :'image_front' => :'CardDesignImageFront',
67
+ :'image_back' => :'CardDesignImageBack',
68
+ :'created_at' => :'Time',
69
+ :'updated_at' => :'Time'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'notes',
77
+ :'image_front',
78
+ :'image_back',
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DoorFlow::CardDesign` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DoorFlow::CardDesign`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ else
101
+ self.id = nil
102
+ end
103
+
104
+ if attributes.key?(:'name')
105
+ self.name = attributes[:'name']
106
+ else
107
+ self.name = nil
108
+ end
109
+
110
+ if attributes.key?(:'notes')
111
+ self.notes = attributes[:'notes']
112
+ end
113
+
114
+ if attributes.key?(:'image_front')
115
+ self.image_front = attributes[:'image_front']
116
+ end
117
+
118
+ if attributes.key?(:'image_back')
119
+ self.image_back = attributes[:'image_back']
120
+ end
121
+
122
+ if attributes.key?(:'created_at')
123
+ self.created_at = attributes[:'created_at']
124
+ end
125
+
126
+ if attributes.key?(:'updated_at')
127
+ self.updated_at = attributes[:'updated_at']
128
+ end
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properties with the reasons
133
+ def list_invalid_properties
134
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
135
+ invalid_properties = Array.new
136
+ if @id.nil?
137
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
138
+ end
139
+
140
+ if @name.nil?
141
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
142
+ end
143
+
144
+ invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ warn '[DEPRECATED] the `valid?` method is obsolete'
151
+ return false if @id.nil?
152
+ return false if @name.nil?
153
+ true
154
+ end
155
+
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] id Value to be assigned
158
+ def id=(id)
159
+ if id.nil?
160
+ fail ArgumentError, 'id cannot be nil'
161
+ end
162
+
163
+ @id = id
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] name Value to be assigned
168
+ def name=(name)
169
+ if name.nil?
170
+ fail ArgumentError, 'name cannot be nil'
171
+ end
172
+
173
+ @name = name
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ id == o.id &&
182
+ name == o.name &&
183
+ notes == o.notes &&
184
+ image_front == o.image_front &&
185
+ image_back == o.image_back &&
186
+ created_at == o.created_at &&
187
+ updated_at == o.updated_at
188
+ end
189
+
190
+ # @see the `==` method
191
+ # @param [Object] Object to be compared
192
+ def eql?(o)
193
+ self == o
194
+ end
195
+
196
+ # Calculates hash code according to all attributes.
197
+ # @return [Integer] Hash code
198
+ def hash
199
+ [id, name, notes, image_front, image_back, created_at, updated_at].hash
200
+ end
201
+
202
+ # Builds the object from hash
203
+ # @param [Hash] attributes Model attributes in the form of hash
204
+ # @return [Object] Returns the model itself
205
+ def self.build_from_hash(attributes)
206
+ return nil unless attributes.is_a?(Hash)
207
+ attributes = attributes.transform_keys(&:to_sym)
208
+ transformed_hash = {}
209
+ openapi_types.each_pair do |key, type|
210
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
211
+ transformed_hash["#{key}"] = nil
212
+ elsif type =~ /\AArray<(.*)>/i
213
+ # check to ensure the input is an array given that the attribute
214
+ # is documented as an array but the input is not
215
+ if attributes[attribute_map[key]].is_a?(Array)
216
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
217
+ end
218
+ elsif !attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
220
+ end
221
+ end
222
+ new(transformed_hash)
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ if value.nil?
232
+ is_nullable = self.class.openapi_nullable.include?(attr)
233
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
234
+ end
235
+
236
+ hash[param] = _to_hash(value)
237
+ end
238
+ hash
239
+ end
240
+
241
+ end
242
+
243
+ end
@@ -0,0 +1,179 @@
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
+ # Back image URLs at multiple sizes, or null if no image is set
18
+ class CardDesignImageBack < ApiModelBase
19
+ # Original uploaded image URL
20
+ attr_accessor :original
21
+
22
+ # Medium size (600x378) image URL
23
+ attr_accessor :medium
24
+
25
+ # Small size (300x189) image URL
26
+ attr_accessor :small
27
+
28
+ # Thumbnail size (100x94) image URL
29
+ attr_accessor :thumb
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'original' => :'original',
35
+ :'medium' => :'medium',
36
+ :'small' => :'small',
37
+ :'thumb' => :'thumb'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'original' => :'String',
55
+ :'medium' => :'String',
56
+ :'small' => :'String',
57
+ :'thumb' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DoorFlow::CardDesignImageBack` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DoorFlow::CardDesignImageBack`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'original')
84
+ self.original = attributes[:'original']
85
+ end
86
+
87
+ if attributes.key?(:'medium')
88
+ self.medium = attributes[:'medium']
89
+ end
90
+
91
+ if attributes.key?(:'small')
92
+ self.small = attributes[:'small']
93
+ end
94
+
95
+ if attributes.key?(:'thumb')
96
+ self.thumb = attributes[:'thumb']
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ warn '[DEPRECATED] the `valid?` method is obsolete'
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ original == o.original &&
121
+ medium == o.medium &&
122
+ small == o.small &&
123
+ thumb == o.thumb
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Integer] Hash code
134
+ def hash
135
+ [original, medium, small, thumb].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ attributes = attributes.transform_keys(&:to_sym)
144
+ transformed_hash = {}
145
+ openapi_types.each_pair do |key, type|
146
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = nil
148
+ elsif type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[attribute_map[key]].is_a?(Array)
152
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
153
+ end
154
+ elsif !attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
156
+ end
157
+ end
158
+ new(transformed_hash)
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ if value.nil?
168
+ is_nullable = self.class.openapi_nullable.include?(attr)
169
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
170
+ end
171
+
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ end
178
+
179
+ end