petstroepack 1.0.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 (141) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +86 -0
  4. data/lib/ctd_documentation/api_helper.rb +10 -0
  5. data/lib/ctd_documentation/client.rb +140 -0
  6. data/lib/ctd_documentation/configuration.rb +103 -0
  7. data/lib/ctd_documentation/controllers/activities_controller.rb +69 -0
  8. data/lib/ctd_documentation/controllers/alerts_controller.rb +170 -0
  9. data/lib/ctd_documentation/controllers/assets_controller.rb +409 -0
  10. data/lib/ctd_documentation/controllers/base_controller.rb +65 -0
  11. data/lib/ctd_documentation/controllers/custom_attributes_categories_controller.rb +50 -0
  12. data/lib/ctd_documentation/controllers/events_controller.rb +67 -0
  13. data/lib/ctd_documentation/controllers/groups_controller.rb +28 -0
  14. data/lib/ctd_documentation/controllers/insights_controller.rb +111 -0
  15. data/lib/ctd_documentation/controllers/license_controller.rb +73 -0
  16. data/lib/ctd_documentation/controllers/login_controller.rb +31 -0
  17. data/lib/ctd_documentation/controllers/queries_controller.rb +128 -0
  18. data/lib/ctd_documentation/controllers/sensors_controller.rb +26 -0
  19. data/lib/ctd_documentation/controllers/sites_controller.rb +39 -0
  20. data/lib/ctd_documentation/controllers/tasks_controller.rb +148 -0
  21. data/lib/ctd_documentation/controllers/tasks_queries_controller.rb +29 -0
  22. data/lib/ctd_documentation/controllers/users_controller.rb +28 -0
  23. data/lib/ctd_documentation/exceptions/api_exception.rb +10 -0
  24. data/lib/ctd_documentation/exceptions/auth_authenticate401_error_exception.rb +48 -0
  25. data/lib/ctd_documentation/http/auth/custom_header_auth.rb +25 -0
  26. data/lib/ctd_documentation/http/http_call_back.rb +10 -0
  27. data/lib/ctd_documentation/http/http_method_enum.rb +10 -0
  28. data/lib/ctd_documentation/http/http_request.rb +10 -0
  29. data/lib/ctd_documentation/http/http_response.rb +10 -0
  30. data/lib/ctd_documentation/models/actionable.rb +70 -0
  31. data/lib/ctd_documentation/models/actionable_asset.rb +80 -0
  32. data/lib/ctd_documentation/models/actionable_cap.rb +80 -0
  33. data/lib/ctd_documentation/models/actionable_information.rb +80 -0
  34. data/lib/ctd_documentation/models/actionable_policy.rb +361 -0
  35. data/lib/ctd_documentation/models/actionable_related_asset.rb +142 -0
  36. data/lib/ctd_documentation/models/active_history.rb +311 -0
  37. data/lib/ctd_documentation/models/activities_object.rb +150 -0
  38. data/lib/ctd_documentation/models/activities_response.rb +100 -0
  39. data/lib/ctd_documentation/models/activity.rb +150 -0
  40. data/lib/ctd_documentation/models/add_license_response.rb +79 -0
  41. data/lib/ctd_documentation/models/alert.rb +455 -0
  42. data/lib/ctd_documentation/models/alert_severity_enum.rb +23 -0
  43. data/lib/ctd_documentation/models/asset.rb +527 -0
  44. data/lib/ctd_documentation/models/assets_with_insights.rb +252 -0
  45. data/lib/ctd_documentation/models/assets_with_insights_response.rb +90 -0
  46. data/lib/ctd_documentation/models/authenticate.rb +57 -0
  47. data/lib/ctd_documentation/models/base_model.rb +58 -0
  48. data/lib/ctd_documentation/models/base_task.rb +198 -0
  49. data/lib/ctd_documentation/models/cap.rb +90 -0
  50. data/lib/ctd_documentation/models/code_sections.rb +70 -0
  51. data/lib/ctd_documentation/models/content_type_enum.rb +14 -0
  52. data/lib/ctd_documentation/models/create_a_new_query.rb +57 -0
  53. data/lib/ctd_documentation/models/create_a_new_query_response.rb +57 -0
  54. data/lib/ctd_documentation/models/create_group_response.rb +48 -0
  55. data/lib/ctd_documentation/models/create_user_response.rb +48 -0
  56. data/lib/ctd_documentation/models/createanewtask.rb +57 -0
  57. data/lib/ctd_documentation/models/createanewtask_response.rb +57 -0
  58. data/lib/ctd_documentation/models/ctd_login_exception.rb +81 -0
  59. data/lib/ctd_documentation/models/ctd_login_response.rb +101 -0
  60. data/lib/ctd_documentation/models/custom_attribute_category.rb +90 -0
  61. data/lib/ctd_documentation/models/db_statistics.rb +50 -0
  62. data/lib/ctd_documentation/models/delete_a_query_response.rb +48 -0
  63. data/lib/ctd_documentation/models/delete_a_task_response.rb +48 -0
  64. data/lib/ctd_documentation/models/destination_virtual_zone.rb +60 -0
  65. data/lib/ctd_documentation/models/detail.rb +60 -0
  66. data/lib/ctd_documentation/models/discovery_params.rb +82 -0
  67. data/lib/ctd_documentation/models/entity.rb +70 -0
  68. data/lib/ctd_documentation/models/event.rb +175 -0
  69. data/lib/ctd_documentation/models/find_asset_by_id_response.rb +547 -0
  70. data/lib/ctd_documentation/models/format1_enum.rb +22 -0
  71. data/lib/ctd_documentation/models/format_enum.rb +20 -0
  72. data/lib/ctd_documentation/models/get_active_detection_history_response.rb +90 -0
  73. data/lib/ctd_documentation/models/get_alerts_response.rb +90 -0
  74. data/lib/ctd_documentation/models/get_all_sites_response.rb +90 -0
  75. data/lib/ctd_documentation/models/get_assets_response.rb +90 -0
  76. data/lib/ctd_documentation/models/get_custom_attribute_categories_response.rb +90 -0
  77. data/lib/ctd_documentation/models/get_events_response.rb +90 -0
  78. data/lib/ctd_documentation/models/get_license_details_response.rb +81 -0
  79. data/lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb +70 -0
  80. data/lib/ctd_documentation/models/get_queries_response.rb +90 -0
  81. data/lib/ctd_documentation/models/get_tasks_response.rb +90 -0
  82. data/lib/ctd_documentation/models/get_types_response.rb +57 -0
  83. data/lib/ctd_documentation/models/group.rb +73 -0
  84. data/lib/ctd_documentation/models/identifiable.rb +70 -0
  85. data/lib/ctd_documentation/models/indicator_info.rb +90 -0
  86. data/lib/ctd_documentation/models/indicators.rb +122 -0
  87. data/lib/ctd_documentation/models/information.rb +183 -0
  88. data/lib/ctd_documentation/models/insight_status_enum.rb +20 -0
  89. data/lib/ctd_documentation/models/insight_status_exact1_enum.rb +21 -0
  90. data/lib/ctd_documentation/models/insight_status_exact_enum.rb +20 -0
  91. data/lib/ctd_documentation/models/license_request.rb +48 -0
  92. data/lib/ctd_documentation/models/network.rb +80 -0
  93. data/lib/ctd_documentation/models/new_queryobject.rb +199 -0
  94. data/lib/ctd_documentation/models/new_taskobject.rb +199 -0
  95. data/lib/ctd_documentation/models/object.rb +70 -0
  96. data/lib/ctd_documentation/models/paginated_response.rb +71 -0
  97. data/lib/ctd_documentation/models/policy.rb +331 -0
  98. data/lib/ctd_documentation/models/queryextraparams.rb +60 -0
  99. data/lib/ctd_documentation/models/ranger_system_check_response.rb +57 -0
  100. data/lib/ctd_documentation/models/risk_vector.rb +89 -0
  101. data/lib/ctd_documentation/models/selection_params.rb +58 -0
  102. data/lib/ctd_documentation/models/selection_params1.rb +80 -0
  103. data/lib/ctd_documentation/models/site.rb +256 -0
  104. data/lib/ctd_documentation/models/site_list_slim_enum.rb +14 -0
  105. data/lib/ctd_documentation/models/slim_insight.rb +139 -0
  106. data/lib/ctd_documentation/models/sort1_enum.rb +65 -0
  107. data/lib/ctd_documentation/models/sort31_enum.rb +59 -0
  108. data/lib/ctd_documentation/models/sort3_enum.rb +59 -0
  109. data/lib/ctd_documentation/models/sort41_enum.rb +41 -0
  110. data/lib/ctd_documentation/models/sort4_enum.rb +41 -0
  111. data/lib/ctd_documentation/models/sort5_enum.rb +35 -0
  112. data/lib/ctd_documentation/models/sort6_enum.rb +41 -0
  113. data/lib/ctd_documentation/models/sort_enum.rb +125 -0
  114. data/lib/ctd_documentation/models/source_virtual_zone.rb +60 -0
  115. data/lib/ctd_documentation/models/special_hint_enum.rb +26 -0
  116. data/lib/ctd_documentation/models/special_hint_exact_enum.rb +26 -0
  117. data/lib/ctd_documentation/models/status_enum.rb +17 -0
  118. data/lib/ctd_documentation/models/status_exact_enum.rb +23 -0
  119. data/lib/ctd_documentation/models/subnet.rb +50 -0
  120. data/lib/ctd_documentation/models/task.rb +281 -0
  121. data/lib/ctd_documentation/models/taskextraparams.rb +71 -0
  122. data/lib/ctd_documentation/models/update_a_single_query_response.rb +57 -0
  123. data/lib/ctd_documentation/models/update_a_single_task_response.rb +57 -0
  124. data/lib/ctd_documentation/models/update_license_response.rb +79 -0
  125. data/lib/ctd_documentation/models/user.rb +88 -0
  126. data/lib/ctd_documentation/models/virtual_zones.rb +118 -0
  127. data/lib/ctd_documentation/utilities/date_time_helper.rb +11 -0
  128. data/lib/ctd_documentation/utilities/file_wrapper.rb +16 -0
  129. data/lib/ctd_documentation.rb +155 -0
  130. data/test/controllers/controller_test_base.rb +29 -0
  131. data/test/controllers/test_activities_controller.rb +64 -0
  132. data/test/controllers/test_alerts_controller.rb +16 -0
  133. data/test/controllers/test_assets_controller.rb +79 -0
  134. data/test/controllers/test_custom_attributes_categories_controller.rb +52 -0
  135. data/test/controllers/test_events_controller.rb +55 -0
  136. data/test/controllers/test_login_controller.rb +45 -0
  137. data/test/controllers/test_queries_controller.rb +292 -0
  138. data/test/controllers/test_sites_controller.rb +53 -0
  139. data/test/controllers/test_tasks_controller.rb +250 -0
  140. data/test/http_response_catcher.rb +19 -0
  141. metadata +259 -0
@@ -0,0 +1,150 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # Activity Model.
8
+ class Activity < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :resource_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :id
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Integer]
22
+ attr_accessor :site_id
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :description
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :display_type
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [String]
34
+ attr_accessor :site_name
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [String]
38
+ attr_accessor :timestamp
39
+
40
+ # TODO: Write general description for this method
41
+ # @return [Integer]
42
+ attr_accessor :type
43
+
44
+ # TODO: Write general description for this method
45
+ # @return [Integer]
46
+ attr_accessor :user_id
47
+
48
+ # TODO: Write general description for this method
49
+ # @return [String]
50
+ attr_accessor :user_name
51
+
52
+ # TODO: Write general description for this method
53
+ # @return [Entity]
54
+ attr_accessor :entity
55
+
56
+ # A mapping from model property names to API property names.
57
+ def self.names
58
+ @_hash = {} if @_hash.nil?
59
+ @_hash['resource_id'] = 'resource_id'
60
+ @_hash['id'] = 'id'
61
+ @_hash['site_id'] = 'site_id'
62
+ @_hash['description'] = 'description'
63
+ @_hash['display_type'] = 'display_type'
64
+ @_hash['site_name'] = 'site_name'
65
+ @_hash['timestamp'] = 'timestamp'
66
+ @_hash['type'] = 'type'
67
+ @_hash['user_id'] = 'user_id'
68
+ @_hash['user_name'] = 'user_name'
69
+ @_hash['entity'] = 'entity'
70
+ @_hash
71
+ end
72
+
73
+ # An array for optional fields
74
+ def self.optionals
75
+ %w[
76
+ resource_id
77
+ id
78
+ site_id
79
+ description
80
+ display_type
81
+ site_name
82
+ timestamp
83
+ type
84
+ user_id
85
+ user_name
86
+ entity
87
+ ]
88
+ end
89
+
90
+ # An array for nullable fields
91
+ def self.nullables
92
+ []
93
+ end
94
+
95
+ def initialize(resource_id = SKIP,
96
+ id = SKIP,
97
+ site_id = SKIP,
98
+ description = SKIP,
99
+ display_type = SKIP,
100
+ site_name = SKIP,
101
+ timestamp = SKIP,
102
+ type = SKIP,
103
+ user_id = SKIP,
104
+ user_name = SKIP,
105
+ entity = SKIP)
106
+ @resource_id = resource_id unless resource_id == SKIP
107
+ @id = id unless id == SKIP
108
+ @site_id = site_id unless site_id == SKIP
109
+ @description = description unless description == SKIP
110
+ @display_type = display_type unless display_type == SKIP
111
+ @site_name = site_name unless site_name == SKIP
112
+ @timestamp = timestamp unless timestamp == SKIP
113
+ @type = type unless type == SKIP
114
+ @user_id = user_id unless user_id == SKIP
115
+ @user_name = user_name unless user_name == SKIP
116
+ @entity = entity unless entity == SKIP
117
+ end
118
+
119
+ # Creates an instance of the object from a hash.
120
+ def self.from_hash(hash)
121
+ return nil unless hash
122
+
123
+ # Extract variables from the hash.
124
+ resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP
125
+ id = hash.key?('id') ? hash['id'] : SKIP
126
+ site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
127
+ description = hash.key?('description') ? hash['description'] : SKIP
128
+ display_type = hash.key?('display_type') ? hash['display_type'] : SKIP
129
+ site_name = hash.key?('site_name') ? hash['site_name'] : SKIP
130
+ timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
131
+ type = hash.key?('type') ? hash['type'] : SKIP
132
+ user_id = hash.key?('user_id') ? hash['user_id'] : SKIP
133
+ user_name = hash.key?('user_name') ? hash['user_name'] : SKIP
134
+ entity = Entity.from_hash(hash['entity']) if hash['entity']
135
+
136
+ # Create object from extracted values.
137
+ Activity.new(resource_id,
138
+ id,
139
+ site_id,
140
+ description,
141
+ display_type,
142
+ site_name,
143
+ timestamp,
144
+ type,
145
+ user_id,
146
+ user_name,
147
+ entity)
148
+ end
149
+ end
150
+ end
@@ -0,0 +1,79 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # AddLicenseResponse Model.
8
+ class AddLicenseResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [TrueClass|FalseClass]
14
+ attr_accessor :success
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :message
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [StatusEnum]
22
+ attr_accessor :status
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [String]
26
+ attr_accessor :expiration_date
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['success'] = 'success'
32
+ @_hash['message'] = 'message'
33
+ @_hash['status'] = 'status'
34
+ @_hash['expiration_date'] = 'expiration_date'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ status
42
+ expiration_date
43
+ ]
44
+ end
45
+
46
+ # An array for nullable fields
47
+ def self.nullables
48
+ []
49
+ end
50
+
51
+ def initialize(success = nil,
52
+ message = nil,
53
+ status = SKIP,
54
+ expiration_date = SKIP)
55
+ @success = success
56
+ @message = message
57
+ @status = status unless status == SKIP
58
+ @expiration_date = expiration_date unless expiration_date == SKIP
59
+ end
60
+
61
+ # Creates an instance of the object from a hash.
62
+ def self.from_hash(hash)
63
+ return nil unless hash
64
+
65
+ # Extract variables from the hash.
66
+ success = hash.key?('success') ? hash['success'] : nil
67
+ message = hash.key?('message') ? hash['message'] : nil
68
+ status = hash.key?('status') ? hash['status'] : SKIP
69
+ expiration_date =
70
+ hash.key?('expiration_date') ? hash['expiration_date'] : SKIP
71
+
72
+ # Create object from extracted values.
73
+ AddLicenseResponse.new(success,
74
+ message,
75
+ status,
76
+ expiration_date)
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,455 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # Alert Model.
8
+ class Alert < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :resource_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :id
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Integer]
22
+ attr_accessor :site_id
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [TrueClass|FalseClass]
26
+ attr_accessor :is_qualified
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [List of Actionable]
30
+ attr_accessor :actionable_diffs
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [List of Actionable]
34
+ attr_accessor :actionable_suspicious_files
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [List of ActionableInformation]
38
+ attr_accessor :actionable_information
39
+
40
+ # TODO: Write general description for this method
41
+ # @return [List of ActionablePolicy]
42
+ attr_accessor :actionable_policies
43
+
44
+ # TODO: Write general description for this method
45
+ # @return [List of ActionableAsset]
46
+ attr_accessor :actionable_assets
47
+
48
+ # TODO: Write general description for this method
49
+ # @return [List of ActionableCap]
50
+ attr_accessor :actionable_caps
51
+
52
+ # TODO: Write general description for this method
53
+ # @return [List of Indicators]
54
+ attr_accessor :significant_indicators
55
+
56
+ # TODO: Write general description for this method
57
+ # @return [List of Indicators]
58
+ attr_accessor :alert_indicators
59
+
60
+ # TODO: Write general description for this method
61
+ # @return [Integer]
62
+ attr_accessor :threat_type
63
+
64
+ # TODO: Write general description for this method
65
+ # @return [Integer]
66
+ attr_accessor :category_number
67
+
68
+ # TODO: Write general description for this method
69
+ # @return [String]
70
+ attr_accessor :category_name
71
+
72
+ # TODO: Write general description for this method
73
+ # @return [String]
74
+ attr_accessor :description
75
+
76
+ # TODO: Write general description for this method
77
+ # @return [Network]
78
+ attr_accessor :network
79
+
80
+ # TODO: Write general description for this method
81
+ # @return [Integer]
82
+ attr_accessor :score
83
+
84
+ # TODO: Write general description for this method
85
+ # @return [Integer]
86
+ attr_accessor :severity_number
87
+
88
+ # TODO: Write general description for this method
89
+ # @return [String]
90
+ attr_accessor :severity_name
91
+
92
+ # TODO: Write general description for this method
93
+ # @return [Integer]
94
+ attr_accessor :resolution_number
95
+
96
+ # TODO: Write general description for this method
97
+ # @return [String]
98
+ attr_accessor :resolution_name
99
+
100
+ # TODO: Write general description for this method
101
+ # @return [TrueClass|FalseClass]
102
+ attr_accessor :resolved
103
+
104
+ # TODO: Write general description for this method
105
+ # @return [TrueClass|FalseClass]
106
+ attr_accessor :relevant
107
+
108
+ # TODO: Write general description for this method
109
+ # @return [String]
110
+ attr_accessor :protocol
111
+
112
+ # TODO: Write general description for this method
113
+ # @return [Integer]
114
+ attr_accessor :network_id
115
+
116
+ # TODO: Write general description for this method
117
+ # @return [Integer]
118
+ attr_accessor :story_id
119
+
120
+ # TODO: Write general description for this method
121
+ # @return [List of String]
122
+ attr_accessor :actionable_virtual_zones_names
123
+
124
+ # TODO: Write general description for this method
125
+ # @return [List of String]
126
+ attr_accessor :story_group_name
127
+
128
+ # TODO: Write general description for this method
129
+ # @return [String]
130
+ attr_accessor :timestamp
131
+
132
+ # TODO: Write general description for this method
133
+ # @return [String]
134
+ attr_accessor :last_updated
135
+
136
+ # TODO: Write general description for this method
137
+ # @return [Integer]
138
+ attr_accessor :type_number
139
+
140
+ # TODO: Write general description for this method
141
+ # @return [String]
142
+ attr_accessor :type_name
143
+
144
+ # A mapping from model property names to API property names.
145
+ def self.names
146
+ @_hash = {} if @_hash.nil?
147
+ @_hash['resource_id'] = 'resource_id'
148
+ @_hash['id'] = 'id'
149
+ @_hash['site_id'] = 'site_id'
150
+ @_hash['is_qualified'] = 'is_qualified'
151
+ @_hash['actionable_diffs'] = 'actionable_diffs'
152
+ @_hash['actionable_suspicious_files'] = 'actionable_suspicious_files'
153
+ @_hash['actionable_information'] = 'actionable_information'
154
+ @_hash['actionable_policies'] = 'actionable_policies'
155
+ @_hash['actionable_assets'] = 'actionable_assets'
156
+ @_hash['actionable_caps'] = 'actionable_caps'
157
+ @_hash['significant_indicators'] = 'significant_indicators'
158
+ @_hash['alert_indicators'] = 'alert_indicators'
159
+ @_hash['threat_type'] = 'threat_type'
160
+ @_hash['category_number'] = 'category_number'
161
+ @_hash['category_name'] = 'category_name'
162
+ @_hash['description'] = 'description'
163
+ @_hash['network'] = 'network'
164
+ @_hash['score'] = 'score'
165
+ @_hash['severity_number'] = 'severity_number'
166
+ @_hash['severity_name'] = 'severity_name'
167
+ @_hash['resolution_number'] = 'resolution_number'
168
+ @_hash['resolution_name'] = 'resolution_name'
169
+ @_hash['resolved'] = 'resolved'
170
+ @_hash['relevant'] = 'relevant'
171
+ @_hash['protocol'] = 'protocol'
172
+ @_hash['network_id'] = 'network_id'
173
+ @_hash['story_id'] = 'story_id'
174
+ @_hash['actionable_virtual_zones_names'] =
175
+ 'actionable_virtual_zones_names'
176
+ @_hash['story_group_name'] = 'story_group_name'
177
+ @_hash['timestamp'] = 'timestamp'
178
+ @_hash['last_updated'] = 'last_updated'
179
+ @_hash['type_number'] = 'type_number'
180
+ @_hash['type_name'] = 'type_name'
181
+ @_hash
182
+ end
183
+
184
+ # An array for optional fields
185
+ def self.optionals
186
+ %w[
187
+ resource_id
188
+ id
189
+ site_id
190
+ is_qualified
191
+ actionable_diffs
192
+ actionable_suspicious_files
193
+ actionable_information
194
+ actionable_policies
195
+ actionable_assets
196
+ actionable_caps
197
+ significant_indicators
198
+ alert_indicators
199
+ threat_type
200
+ category_number
201
+ category_name
202
+ description
203
+ network
204
+ score
205
+ severity_number
206
+ severity_name
207
+ resolution_number
208
+ resolution_name
209
+ resolved
210
+ relevant
211
+ protocol
212
+ network_id
213
+ story_id
214
+ actionable_virtual_zones_names
215
+ story_group_name
216
+ timestamp
217
+ last_updated
218
+ type_number
219
+ type_name
220
+ ]
221
+ end
222
+
223
+ # An array for nullable fields
224
+ def self.nullables
225
+ []
226
+ end
227
+
228
+ def initialize(resource_id = SKIP,
229
+ id = SKIP,
230
+ site_id = SKIP,
231
+ is_qualified = SKIP,
232
+ actionable_diffs = SKIP,
233
+ actionable_suspicious_files = SKIP,
234
+ actionable_information = SKIP,
235
+ actionable_policies = SKIP,
236
+ actionable_assets = SKIP,
237
+ actionable_caps = SKIP,
238
+ significant_indicators = SKIP,
239
+ alert_indicators = SKIP,
240
+ threat_type = SKIP,
241
+ category_number = SKIP,
242
+ category_name = SKIP,
243
+ description = SKIP,
244
+ network = SKIP,
245
+ score = SKIP,
246
+ severity_number = SKIP,
247
+ severity_name = SKIP,
248
+ resolution_number = SKIP,
249
+ resolution_name = SKIP,
250
+ resolved = SKIP,
251
+ relevant = SKIP,
252
+ protocol = SKIP,
253
+ network_id = SKIP,
254
+ story_id = SKIP,
255
+ actionable_virtual_zones_names = SKIP,
256
+ story_group_name = SKIP,
257
+ timestamp = SKIP,
258
+ last_updated = SKIP,
259
+ type_number = SKIP,
260
+ type_name = SKIP)
261
+ @resource_id = resource_id unless resource_id == SKIP
262
+ @id = id unless id == SKIP
263
+ @site_id = site_id unless site_id == SKIP
264
+ @is_qualified = is_qualified unless is_qualified == SKIP
265
+ @actionable_diffs = actionable_diffs unless actionable_diffs == SKIP
266
+ unless actionable_suspicious_files == SKIP
267
+ @actionable_suspicious_files =
268
+ actionable_suspicious_files
269
+ end
270
+ @actionable_information = actionable_information unless actionable_information == SKIP
271
+ @actionable_policies = actionable_policies unless actionable_policies == SKIP
272
+ @actionable_assets = actionable_assets unless actionable_assets == SKIP
273
+ @actionable_caps = actionable_caps unless actionable_caps == SKIP
274
+ @significant_indicators = significant_indicators unless significant_indicators == SKIP
275
+ @alert_indicators = alert_indicators unless alert_indicators == SKIP
276
+ @threat_type = threat_type unless threat_type == SKIP
277
+ @category_number = category_number unless category_number == SKIP
278
+ @category_name = category_name unless category_name == SKIP
279
+ @description = description unless description == SKIP
280
+ @network = network unless network == SKIP
281
+ @score = score unless score == SKIP
282
+ @severity_number = severity_number unless severity_number == SKIP
283
+ @severity_name = severity_name unless severity_name == SKIP
284
+ @resolution_number = resolution_number unless resolution_number == SKIP
285
+ @resolution_name = resolution_name unless resolution_name == SKIP
286
+ @resolved = resolved unless resolved == SKIP
287
+ @relevant = relevant unless relevant == SKIP
288
+ @protocol = protocol unless protocol == SKIP
289
+ @network_id = network_id unless network_id == SKIP
290
+ @story_id = story_id unless story_id == SKIP
291
+ unless actionable_virtual_zones_names == SKIP
292
+ @actionable_virtual_zones_names =
293
+ actionable_virtual_zones_names
294
+ end
295
+ @story_group_name = story_group_name unless story_group_name == SKIP
296
+ @timestamp = timestamp unless timestamp == SKIP
297
+ @last_updated = last_updated unless last_updated == SKIP
298
+ @type_number = type_number unless type_number == SKIP
299
+ @type_name = type_name unless type_name == SKIP
300
+ end
301
+
302
+ # Creates an instance of the object from a hash.
303
+ def self.from_hash(hash)
304
+ return nil unless hash
305
+
306
+ # Extract variables from the hash.
307
+ resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP
308
+ id = hash.key?('id') ? hash['id'] : SKIP
309
+ site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
310
+ is_qualified = hash.key?('is_qualified') ? hash['is_qualified'] : SKIP
311
+ # Parameter is an array, so we need to iterate through it
312
+ actionable_diffs = nil
313
+ unless hash['actionable_diffs'].nil?
314
+ actionable_diffs = []
315
+ hash['actionable_diffs'].each do |structure|
316
+ actionable_diffs << (Actionable.from_hash(structure) if structure)
317
+ end
318
+ end
319
+
320
+ actionable_diffs = SKIP unless hash.key?('actionable_diffs')
321
+ # Parameter is an array, so we need to iterate through it
322
+ actionable_suspicious_files = nil
323
+ unless hash['actionable_suspicious_files'].nil?
324
+ actionable_suspicious_files = []
325
+ hash['actionable_suspicious_files'].each do |structure|
326
+ actionable_suspicious_files << (Actionable.from_hash(structure) if structure)
327
+ end
328
+ end
329
+
330
+ actionable_suspicious_files = SKIP unless hash.key?('actionable_suspicious_files')
331
+ # Parameter is an array, so we need to iterate through it
332
+ actionable_information = nil
333
+ unless hash['actionable_information'].nil?
334
+ actionable_information = []
335
+ hash['actionable_information'].each do |structure|
336
+ actionable_information << (ActionableInformation.from_hash(structure) if structure)
337
+ end
338
+ end
339
+
340
+ actionable_information = SKIP unless hash.key?('actionable_information')
341
+ # Parameter is an array, so we need to iterate through it
342
+ actionable_policies = nil
343
+ unless hash['actionable_policies'].nil?
344
+ actionable_policies = []
345
+ hash['actionable_policies'].each do |structure|
346
+ actionable_policies << (ActionablePolicy.from_hash(structure) if structure)
347
+ end
348
+ end
349
+
350
+ actionable_policies = SKIP unless hash.key?('actionable_policies')
351
+ # Parameter is an array, so we need to iterate through it
352
+ actionable_assets = nil
353
+ unless hash['actionable_assets'].nil?
354
+ actionable_assets = []
355
+ hash['actionable_assets'].each do |structure|
356
+ actionable_assets << (ActionableAsset.from_hash(structure) if structure)
357
+ end
358
+ end
359
+
360
+ actionable_assets = SKIP unless hash.key?('actionable_assets')
361
+ # Parameter is an array, so we need to iterate through it
362
+ actionable_caps = nil
363
+ unless hash['actionable_caps'].nil?
364
+ actionable_caps = []
365
+ hash['actionable_caps'].each do |structure|
366
+ actionable_caps << (ActionableCap.from_hash(structure) if structure)
367
+ end
368
+ end
369
+
370
+ actionable_caps = SKIP unless hash.key?('actionable_caps')
371
+ # Parameter is an array, so we need to iterate through it
372
+ significant_indicators = nil
373
+ unless hash['significant_indicators'].nil?
374
+ significant_indicators = []
375
+ hash['significant_indicators'].each do |structure|
376
+ significant_indicators << (Indicators.from_hash(structure) if structure)
377
+ end
378
+ end
379
+
380
+ significant_indicators = SKIP unless hash.key?('significant_indicators')
381
+ # Parameter is an array, so we need to iterate through it
382
+ alert_indicators = nil
383
+ unless hash['alert_indicators'].nil?
384
+ alert_indicators = []
385
+ hash['alert_indicators'].each do |structure|
386
+ alert_indicators << (Indicators.from_hash(structure) if structure)
387
+ end
388
+ end
389
+
390
+ alert_indicators = SKIP unless hash.key?('alert_indicators')
391
+ threat_type = hash.key?('threat_type') ? hash['threat_type'] : SKIP
392
+ category_number =
393
+ hash.key?('category_number') ? hash['category_number'] : SKIP
394
+ category_name = hash.key?('category_name') ? hash['category_name'] : SKIP
395
+ description = hash.key?('description') ? hash['description'] : SKIP
396
+ network = Network.from_hash(hash['network']) if hash['network']
397
+ score = hash.key?('score') ? hash['score'] : SKIP
398
+ severity_number =
399
+ hash.key?('severity_number') ? hash['severity_number'] : SKIP
400
+ severity_name = hash.key?('severity_name') ? hash['severity_name'] : SKIP
401
+ resolution_number =
402
+ hash.key?('resolution_number') ? hash['resolution_number'] : SKIP
403
+ resolution_name =
404
+ hash.key?('resolution_name') ? hash['resolution_name'] : SKIP
405
+ resolved = hash.key?('resolved') ? hash['resolved'] : SKIP
406
+ relevant = hash.key?('relevant') ? hash['relevant'] : SKIP
407
+ protocol = hash.key?('protocol') ? hash['protocol'] : SKIP
408
+ network_id = hash.key?('network_id') ? hash['network_id'] : SKIP
409
+ story_id = hash.key?('story_id') ? hash['story_id'] : SKIP
410
+ actionable_virtual_zones_names =
411
+ hash.key?('actionable_virtual_zones_names') ? hash['actionable_virtual_zones_names'] : SKIP
412
+ story_group_name =
413
+ hash.key?('story_group_name') ? hash['story_group_name'] : SKIP
414
+ timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
415
+ last_updated = hash.key?('last_updated') ? hash['last_updated'] : SKIP
416
+ type_number = hash.key?('type_number') ? hash['type_number'] : SKIP
417
+ type_name = hash.key?('type_name') ? hash['type_name'] : SKIP
418
+
419
+ # Create object from extracted values.
420
+ Alert.new(resource_id,
421
+ id,
422
+ site_id,
423
+ is_qualified,
424
+ actionable_diffs,
425
+ actionable_suspicious_files,
426
+ actionable_information,
427
+ actionable_policies,
428
+ actionable_assets,
429
+ actionable_caps,
430
+ significant_indicators,
431
+ alert_indicators,
432
+ threat_type,
433
+ category_number,
434
+ category_name,
435
+ description,
436
+ network,
437
+ score,
438
+ severity_number,
439
+ severity_name,
440
+ resolution_number,
441
+ resolution_name,
442
+ resolved,
443
+ relevant,
444
+ protocol,
445
+ network_id,
446
+ story_id,
447
+ actionable_virtual_zones_names,
448
+ story_group_name,
449
+ timestamp,
450
+ last_updated,
451
+ type_number,
452
+ type_name)
453
+ end
454
+ end
455
+ end