petstroepack 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,90 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # GetTasksResponse Model.
8
+ class GetTasksResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Integer]
14
+ attr_accessor :count_filtered
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :count_total
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Integer]
22
+ attr_accessor :count_in_page
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [List of Task]
26
+ attr_accessor :objects
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['count_filtered'] = 'count_filtered'
32
+ @_hash['count_total'] = 'count_total'
33
+ @_hash['count_in_page'] = 'count_in_page'
34
+ @_hash['objects'] = 'objects'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ count_filtered
42
+ count_total
43
+ count_in_page
44
+ objects
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(count_filtered = SKIP,
54
+ count_total = SKIP,
55
+ count_in_page = SKIP,
56
+ objects = SKIP)
57
+ @count_filtered = count_filtered unless count_filtered == SKIP
58
+ @count_total = count_total unless count_total == SKIP
59
+ @count_in_page = count_in_page unless count_in_page == SKIP
60
+ @objects = objects unless objects == SKIP
61
+ end
62
+
63
+ # Creates an instance of the object from a hash.
64
+ def self.from_hash(hash)
65
+ return nil unless hash
66
+
67
+ # Extract variables from the hash.
68
+ count_filtered =
69
+ hash.key?('count_filtered') ? hash['count_filtered'] : SKIP
70
+ count_total = hash.key?('count_total') ? hash['count_total'] : SKIP
71
+ count_in_page = hash.key?('count_in_page') ? hash['count_in_page'] : SKIP
72
+ # Parameter is an array, so we need to iterate through it
73
+ objects = nil
74
+ unless hash['objects'].nil?
75
+ objects = []
76
+ hash['objects'].each do |structure|
77
+ objects << (Task.from_hash(structure) if structure)
78
+ end
79
+ end
80
+
81
+ objects = SKIP unless hash.key?('objects')
82
+
83
+ # Create object from extracted values.
84
+ GetTasksResponse.new(count_filtered,
85
+ count_total,
86
+ count_in_page,
87
+ objects)
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,57 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # GetTypesResponse Model.
8
+ class GetTypesResponse < 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 :data
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['success'] = 'success'
24
+ @_hash['data'] = 'data'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(success = nil,
39
+ data = nil)
40
+ @success = success
41
+ @data = data
42
+ end
43
+
44
+ # Creates an instance of the object from a hash.
45
+ def self.from_hash(hash)
46
+ return nil unless hash
47
+
48
+ # Extract variables from the hash.
49
+ success = hash.key?('success') ? hash['success'] : nil
50
+ data = hash.key?('data') ? hash['data'] : nil
51
+
52
+ # Create object from extracted values.
53
+ GetTypesResponse.new(success,
54
+ data)
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,73 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # Group Model.
8
+ class Group < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [TrueClass|FalseClass]
18
+ attr_accessor :is_admin
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [List of String]
22
+ attr_accessor :associated_external_groups
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['name'] = 'name'
28
+ @_hash['is_admin'] = 'is_admin'
29
+ @_hash['associated_external_groups'] = 'associated_external_groups'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ is_admin
37
+ associated_external_groups
38
+ ]
39
+ end
40
+
41
+ # An array for nullable fields
42
+ def self.nullables
43
+ []
44
+ end
45
+
46
+ def initialize(name = nil,
47
+ is_admin = SKIP,
48
+ associated_external_groups = SKIP)
49
+ @name = name
50
+ @is_admin = is_admin unless is_admin == SKIP
51
+ unless associated_external_groups == SKIP
52
+ @associated_external_groups =
53
+ associated_external_groups
54
+ end
55
+ end
56
+
57
+ # Creates an instance of the object from a hash.
58
+ def self.from_hash(hash)
59
+ return nil unless hash
60
+
61
+ # Extract variables from the hash.
62
+ name = hash.key?('name') ? hash['name'] : nil
63
+ is_admin = hash.key?('is_admin') ? hash['is_admin'] : SKIP
64
+ associated_external_groups =
65
+ hash.key?('associated_external_groups') ? hash['associated_external_groups'] : SKIP
66
+
67
+ # Create object from extracted values.
68
+ Group.new(name,
69
+ is_admin,
70
+ associated_external_groups)
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,70 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # Identifiable Model.
8
+ class Identifiable < 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
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['resource_id'] = 'resource_id'
28
+ @_hash['id'] = 'id'
29
+ @_hash['site_id'] = 'site_id'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ resource_id
37
+ id
38
+ site_id
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(resource_id = SKIP,
48
+ id = SKIP,
49
+ site_id = SKIP)
50
+ @resource_id = resource_id unless resource_id == SKIP
51
+ @id = id unless id == SKIP
52
+ @site_id = site_id unless site_id == SKIP
53
+ end
54
+
55
+ # Creates an instance of the object from a hash.
56
+ def self.from_hash(hash)
57
+ return nil unless hash
58
+
59
+ # Extract variables from the hash.
60
+ resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP
61
+ id = hash.key?('id') ? hash['id'] : SKIP
62
+ site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
63
+
64
+ # Create object from extracted values.
65
+ Identifiable.new(resource_id,
66
+ id,
67
+ site_id)
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,90 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # IndicatorInfo Model.
8
+ class IndicatorInfo < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Integer]
14
+ attr_accessor :id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :points
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 [Integer]
26
+ attr_accessor :type
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [String]
30
+ attr_accessor :description
31
+
32
+ # A mapping from model property names to API property names.
33
+ def self.names
34
+ @_hash = {} if @_hash.nil?
35
+ @_hash['id'] = 'id'
36
+ @_hash['points'] = 'points'
37
+ @_hash['site_id'] = 'site_id'
38
+ @_hash['type'] = 'type'
39
+ @_hash['description'] = 'description'
40
+ @_hash
41
+ end
42
+
43
+ # An array for optional fields
44
+ def self.optionals
45
+ %w[
46
+ id
47
+ points
48
+ site_id
49
+ type
50
+ description
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(id = SKIP,
60
+ points = SKIP,
61
+ site_id = SKIP,
62
+ type = SKIP,
63
+ description = SKIP)
64
+ @id = id unless id == SKIP
65
+ @points = points unless points == SKIP
66
+ @site_id = site_id unless site_id == SKIP
67
+ @type = type unless type == SKIP
68
+ @description = description unless description == SKIP
69
+ end
70
+
71
+ # Creates an instance of the object from a hash.
72
+ def self.from_hash(hash)
73
+ return nil unless hash
74
+
75
+ # Extract variables from the hash.
76
+ id = hash.key?('id') ? hash['id'] : SKIP
77
+ points = hash.key?('points') ? hash['points'] : SKIP
78
+ site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
79
+ type = hash.key?('type') ? hash['type'] : SKIP
80
+ description = hash.key?('description') ? hash['description'] : SKIP
81
+
82
+ # Create object from extracted values.
83
+ IndicatorInfo.new(id,
84
+ points,
85
+ site_id,
86
+ type,
87
+ description)
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,122 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # Indicators Model.
8
+ class Indicators < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Integer]
14
+ attr_accessor :id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :alert_id
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Integer]
22
+ attr_accessor :indicator_id
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [TrueClass|FalseClass]
26
+ attr_accessor :indicator_result
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [Integer]
30
+ attr_accessor :parent_indicator_id
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [Integer]
34
+ attr_accessor :site_id
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [IndicatorInfo]
38
+ attr_accessor :indicator_info
39
+
40
+ # TODO: Write general description for this method
41
+ # @return [String]
42
+ attr_accessor :icon
43
+
44
+ # A mapping from model property names to API property names.
45
+ def self.names
46
+ @_hash = {} if @_hash.nil?
47
+ @_hash['id'] = 'id'
48
+ @_hash['alert_id'] = 'alert_id'
49
+ @_hash['indicator_id'] = 'indicator_id'
50
+ @_hash['indicator_result'] = 'indicator_result'
51
+ @_hash['parent_indicator_id'] = 'parent_indicator_id'
52
+ @_hash['site_id'] = 'site_id'
53
+ @_hash['indicator_info'] = 'indicator_info'
54
+ @_hash['icon'] = 'icon'
55
+ @_hash
56
+ end
57
+
58
+ # An array for optional fields
59
+ def self.optionals
60
+ %w[
61
+ id
62
+ alert_id
63
+ indicator_id
64
+ indicator_result
65
+ parent_indicator_id
66
+ site_id
67
+ indicator_info
68
+ icon
69
+ ]
70
+ end
71
+
72
+ # An array for nullable fields
73
+ def self.nullables
74
+ []
75
+ end
76
+
77
+ def initialize(id = SKIP,
78
+ alert_id = SKIP,
79
+ indicator_id = SKIP,
80
+ indicator_result = SKIP,
81
+ parent_indicator_id = SKIP,
82
+ site_id = SKIP,
83
+ indicator_info = SKIP,
84
+ icon = SKIP)
85
+ @id = id unless id == SKIP
86
+ @alert_id = alert_id unless alert_id == SKIP
87
+ @indicator_id = indicator_id unless indicator_id == SKIP
88
+ @indicator_result = indicator_result unless indicator_result == SKIP
89
+ @parent_indicator_id = parent_indicator_id unless parent_indicator_id == SKIP
90
+ @site_id = site_id unless site_id == SKIP
91
+ @indicator_info = indicator_info unless indicator_info == SKIP
92
+ @icon = icon unless icon == SKIP
93
+ end
94
+
95
+ # Creates an instance of the object from a hash.
96
+ def self.from_hash(hash)
97
+ return nil unless hash
98
+
99
+ # Extract variables from the hash.
100
+ id = hash.key?('id') ? hash['id'] : SKIP
101
+ alert_id = hash.key?('alert_id') ? hash['alert_id'] : SKIP
102
+ indicator_id = hash.key?('indicator_id') ? hash['indicator_id'] : SKIP
103
+ indicator_result =
104
+ hash.key?('indicator_result') ? hash['indicator_result'] : SKIP
105
+ parent_indicator_id =
106
+ hash.key?('parent_indicator_id') ? hash['parent_indicator_id'] : SKIP
107
+ site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
108
+ indicator_info = IndicatorInfo.from_hash(hash['indicator_info']) if hash['indicator_info']
109
+ icon = hash.key?('icon') ? hash['icon'] : SKIP
110
+
111
+ # Create object from extracted values.
112
+ Indicators.new(id,
113
+ alert_id,
114
+ indicator_id,
115
+ indicator_result,
116
+ parent_indicator_id,
117
+ site_id,
118
+ indicator_info,
119
+ icon)
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,183 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # Information Model.
8
+ class Information < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Integer]
14
+ attr_accessor :site_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :resource_id
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Integer]
22
+ attr_accessor :id
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [Integer]
26
+ attr_accessor :asset_id
27
+
28
+ # TODO: Write general description for this method
29
+ # @return [List of CodeSections]
30
+ attr_accessor :code_sections
31
+
32
+ # TODO: Write general description for this method
33
+ # @return [String]
34
+ attr_accessor :source
35
+
36
+ # TODO: Write general description for this method
37
+ # @return [String]
38
+ attr_accessor :originator_name
39
+
40
+ # TODO: Write general description for this method
41
+ # @return [Integer]
42
+ attr_accessor :originator_number
43
+
44
+ # TODO: Write general description for this method
45
+ # @return [String]
46
+ attr_accessor :information_type_name
47
+
48
+ # TODO: Write general description for this method
49
+ # @return [Integer]
50
+ attr_accessor :information_type_number
51
+
52
+ # TODO: Write general description for this method
53
+ # @return [TrueClass|FalseClass]
54
+ attr_accessor :approved
55
+
56
+ # TODO: Write general description for this method
57
+ # @return [TrueClass|FalseClass]
58
+ attr_accessor :valid
59
+
60
+ # TODO: Write general description for this method
61
+ # @return [String]
62
+ attr_accessor :timestamp
63
+
64
+ # A mapping from model property names to API property names.
65
+ def self.names
66
+ @_hash = {} if @_hash.nil?
67
+ @_hash['site_id'] = 'site_id'
68
+ @_hash['resource_id'] = 'resource_id'
69
+ @_hash['id'] = 'id'
70
+ @_hash['asset_id'] = 'asset_id'
71
+ @_hash['code_sections'] = 'code_sections'
72
+ @_hash['source'] = 'source'
73
+ @_hash['originator_name'] = 'originator_name'
74
+ @_hash['originator_number'] = 'originator_number'
75
+ @_hash['information_type_name'] = 'information_type_name'
76
+ @_hash['information_type_number'] = 'information_type_number'
77
+ @_hash['approved'] = 'approved'
78
+ @_hash['valid'] = 'valid'
79
+ @_hash['timestamp'] = 'timestamp'
80
+ @_hash
81
+ end
82
+
83
+ # An array for optional fields
84
+ def self.optionals
85
+ %w[
86
+ site_id
87
+ resource_id
88
+ id
89
+ asset_id
90
+ code_sections
91
+ source
92
+ originator_name
93
+ originator_number
94
+ information_type_name
95
+ information_type_number
96
+ approved
97
+ valid
98
+ timestamp
99
+ ]
100
+ end
101
+
102
+ # An array for nullable fields
103
+ def self.nullables
104
+ []
105
+ end
106
+
107
+ def initialize(site_id = SKIP,
108
+ resource_id = SKIP,
109
+ id = SKIP,
110
+ asset_id = SKIP,
111
+ code_sections = SKIP,
112
+ source = SKIP,
113
+ originator_name = SKIP,
114
+ originator_number = SKIP,
115
+ information_type_name = SKIP,
116
+ information_type_number = SKIP,
117
+ approved = SKIP,
118
+ valid = SKIP,
119
+ timestamp = SKIP)
120
+ @site_id = site_id unless site_id == SKIP
121
+ @resource_id = resource_id unless resource_id == SKIP
122
+ @id = id unless id == SKIP
123
+ @asset_id = asset_id unless asset_id == SKIP
124
+ @code_sections = code_sections unless code_sections == SKIP
125
+ @source = source unless source == SKIP
126
+ @originator_name = originator_name unless originator_name == SKIP
127
+ @originator_number = originator_number unless originator_number == SKIP
128
+ @information_type_name = information_type_name unless information_type_name == SKIP
129
+ @information_type_number = information_type_number unless information_type_number == SKIP
130
+ @approved = approved unless approved == SKIP
131
+ @valid = valid unless valid == SKIP
132
+ @timestamp = timestamp unless timestamp == SKIP
133
+ end
134
+
135
+ # Creates an instance of the object from a hash.
136
+ def self.from_hash(hash)
137
+ return nil unless hash
138
+
139
+ # Extract variables from the hash.
140
+ site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
141
+ resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP
142
+ id = hash.key?('id') ? hash['id'] : SKIP
143
+ asset_id = hash.key?('asset_id') ? hash['asset_id'] : SKIP
144
+ # Parameter is an array, so we need to iterate through it
145
+ code_sections = nil
146
+ unless hash['code_sections'].nil?
147
+ code_sections = []
148
+ hash['code_sections'].each do |structure|
149
+ code_sections << (CodeSections.from_hash(structure) if structure)
150
+ end
151
+ end
152
+
153
+ code_sections = SKIP unless hash.key?('code_sections')
154
+ source = hash.key?('source') ? hash['source'] : SKIP
155
+ originator_name =
156
+ hash.key?('originator_name') ? hash['originator_name'] : SKIP
157
+ originator_number =
158
+ hash.key?('originator_number') ? hash['originator_number'] : SKIP
159
+ information_type_name =
160
+ hash.key?('information_type_name') ? hash['information_type_name'] : SKIP
161
+ information_type_number =
162
+ hash.key?('information_type_number') ? hash['information_type_number'] : SKIP
163
+ approved = hash.key?('approved') ? hash['approved'] : SKIP
164
+ valid = hash.key?('valid') ? hash['valid'] : SKIP
165
+ timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
166
+
167
+ # Create object from extracted values.
168
+ Information.new(site_id,
169
+ resource_id,
170
+ id,
171
+ asset_id,
172
+ code_sections,
173
+ source,
174
+ originator_name,
175
+ originator_number,
176
+ information_type_name,
177
+ information_type_number,
178
+ approved,
179
+ valid,
180
+ timestamp)
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,20 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # InsightStatus.
8
+ class InsightStatusEnum
9
+ INSIGHT_STATUS_ENUM = [
10
+ # TODO: Write general description for ENUM_NAMEOPENVALUE0
11
+ ENUM_NAMEOPENVALUE0 = '{"name":"Open","value":0}'.freeze,
12
+
13
+ # TODO: Write general description for ENUM_NAMEHIDDENVALUE1
14
+ ENUM_NAMEHIDDENVALUE1 = '{"name":"Hidden","value":1}'.freeze,
15
+
16
+ # TODO: Write general description for ENUM_NAMECOMPLETEDVALUE2
17
+ ENUM_NAMECOMPLETEDVALUE2 = '{"name":"Completed","value":2}'.freeze
18
+ ].freeze
19
+ end
20
+ end