petstroepack 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +86 -0
- data/lib/ctd_documentation/api_helper.rb +10 -0
- data/lib/ctd_documentation/client.rb +140 -0
- data/lib/ctd_documentation/configuration.rb +103 -0
- data/lib/ctd_documentation/controllers/activities_controller.rb +69 -0
- data/lib/ctd_documentation/controllers/alerts_controller.rb +170 -0
- data/lib/ctd_documentation/controllers/assets_controller.rb +409 -0
- data/lib/ctd_documentation/controllers/base_controller.rb +65 -0
- data/lib/ctd_documentation/controllers/custom_attributes_categories_controller.rb +50 -0
- data/lib/ctd_documentation/controllers/events_controller.rb +67 -0
- data/lib/ctd_documentation/controllers/groups_controller.rb +28 -0
- data/lib/ctd_documentation/controllers/insights_controller.rb +111 -0
- data/lib/ctd_documentation/controllers/license_controller.rb +73 -0
- data/lib/ctd_documentation/controllers/login_controller.rb +31 -0
- data/lib/ctd_documentation/controllers/queries_controller.rb +128 -0
- data/lib/ctd_documentation/controllers/sensors_controller.rb +26 -0
- data/lib/ctd_documentation/controllers/sites_controller.rb +39 -0
- data/lib/ctd_documentation/controllers/tasks_controller.rb +148 -0
- data/lib/ctd_documentation/controllers/tasks_queries_controller.rb +29 -0
- data/lib/ctd_documentation/controllers/users_controller.rb +28 -0
- data/lib/ctd_documentation/exceptions/api_exception.rb +10 -0
- data/lib/ctd_documentation/exceptions/auth_authenticate401_error_exception.rb +48 -0
- data/lib/ctd_documentation/http/auth/custom_header_auth.rb +25 -0
- data/lib/ctd_documentation/http/http_call_back.rb +10 -0
- data/lib/ctd_documentation/http/http_method_enum.rb +10 -0
- data/lib/ctd_documentation/http/http_request.rb +10 -0
- data/lib/ctd_documentation/http/http_response.rb +10 -0
- data/lib/ctd_documentation/models/actionable.rb +70 -0
- data/lib/ctd_documentation/models/actionable_asset.rb +80 -0
- data/lib/ctd_documentation/models/actionable_cap.rb +80 -0
- data/lib/ctd_documentation/models/actionable_information.rb +80 -0
- data/lib/ctd_documentation/models/actionable_policy.rb +361 -0
- data/lib/ctd_documentation/models/actionable_related_asset.rb +142 -0
- data/lib/ctd_documentation/models/active_history.rb +311 -0
- data/lib/ctd_documentation/models/activities_object.rb +150 -0
- data/lib/ctd_documentation/models/activities_response.rb +100 -0
- data/lib/ctd_documentation/models/activity.rb +150 -0
- data/lib/ctd_documentation/models/add_license_response.rb +79 -0
- data/lib/ctd_documentation/models/alert.rb +455 -0
- data/lib/ctd_documentation/models/alert_severity_enum.rb +23 -0
- data/lib/ctd_documentation/models/asset.rb +527 -0
- data/lib/ctd_documentation/models/assets_with_insights.rb +252 -0
- data/lib/ctd_documentation/models/assets_with_insights_response.rb +90 -0
- data/lib/ctd_documentation/models/authenticate.rb +57 -0
- data/lib/ctd_documentation/models/base_model.rb +58 -0
- data/lib/ctd_documentation/models/base_task.rb +198 -0
- data/lib/ctd_documentation/models/cap.rb +90 -0
- data/lib/ctd_documentation/models/code_sections.rb +70 -0
- data/lib/ctd_documentation/models/content_type_enum.rb +14 -0
- data/lib/ctd_documentation/models/create_a_new_query.rb +57 -0
- data/lib/ctd_documentation/models/create_a_new_query_response.rb +57 -0
- data/lib/ctd_documentation/models/create_group_response.rb +48 -0
- data/lib/ctd_documentation/models/create_user_response.rb +48 -0
- data/lib/ctd_documentation/models/createanewtask.rb +57 -0
- data/lib/ctd_documentation/models/createanewtask_response.rb +57 -0
- data/lib/ctd_documentation/models/ctd_login_exception.rb +81 -0
- data/lib/ctd_documentation/models/ctd_login_response.rb +101 -0
- data/lib/ctd_documentation/models/custom_attribute_category.rb +90 -0
- data/lib/ctd_documentation/models/db_statistics.rb +50 -0
- data/lib/ctd_documentation/models/delete_a_query_response.rb +48 -0
- data/lib/ctd_documentation/models/delete_a_task_response.rb +48 -0
- data/lib/ctd_documentation/models/destination_virtual_zone.rb +60 -0
- data/lib/ctd_documentation/models/detail.rb +60 -0
- data/lib/ctd_documentation/models/discovery_params.rb +82 -0
- data/lib/ctd_documentation/models/entity.rb +70 -0
- data/lib/ctd_documentation/models/event.rb +175 -0
- data/lib/ctd_documentation/models/find_asset_by_id_response.rb +547 -0
- data/lib/ctd_documentation/models/format1_enum.rb +22 -0
- data/lib/ctd_documentation/models/format_enum.rb +20 -0
- data/lib/ctd_documentation/models/get_active_detection_history_response.rb +90 -0
- data/lib/ctd_documentation/models/get_alerts_response.rb +90 -0
- data/lib/ctd_documentation/models/get_all_sites_response.rb +90 -0
- data/lib/ctd_documentation/models/get_assets_response.rb +90 -0
- data/lib/ctd_documentation/models/get_custom_attribute_categories_response.rb +90 -0
- data/lib/ctd_documentation/models/get_events_response.rb +90 -0
- data/lib/ctd_documentation/models/get_license_details_response.rb +81 -0
- data/lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb +70 -0
- data/lib/ctd_documentation/models/get_queries_response.rb +90 -0
- data/lib/ctd_documentation/models/get_tasks_response.rb +90 -0
- data/lib/ctd_documentation/models/get_types_response.rb +57 -0
- data/lib/ctd_documentation/models/group.rb +73 -0
- data/lib/ctd_documentation/models/identifiable.rb +70 -0
- data/lib/ctd_documentation/models/indicator_info.rb +90 -0
- data/lib/ctd_documentation/models/indicators.rb +122 -0
- data/lib/ctd_documentation/models/information.rb +183 -0
- data/lib/ctd_documentation/models/insight_status_enum.rb +20 -0
- data/lib/ctd_documentation/models/insight_status_exact1_enum.rb +21 -0
- data/lib/ctd_documentation/models/insight_status_exact_enum.rb +20 -0
- data/lib/ctd_documentation/models/license_request.rb +48 -0
- data/lib/ctd_documentation/models/network.rb +80 -0
- data/lib/ctd_documentation/models/new_queryobject.rb +199 -0
- data/lib/ctd_documentation/models/new_taskobject.rb +199 -0
- data/lib/ctd_documentation/models/object.rb +70 -0
- data/lib/ctd_documentation/models/paginated_response.rb +71 -0
- data/lib/ctd_documentation/models/policy.rb +331 -0
- data/lib/ctd_documentation/models/queryextraparams.rb +60 -0
- data/lib/ctd_documentation/models/ranger_system_check_response.rb +57 -0
- data/lib/ctd_documentation/models/risk_vector.rb +89 -0
- data/lib/ctd_documentation/models/selection_params.rb +58 -0
- data/lib/ctd_documentation/models/selection_params1.rb +80 -0
- data/lib/ctd_documentation/models/site.rb +256 -0
- data/lib/ctd_documentation/models/site_list_slim_enum.rb +14 -0
- data/lib/ctd_documentation/models/slim_insight.rb +139 -0
- data/lib/ctd_documentation/models/sort1_enum.rb +65 -0
- data/lib/ctd_documentation/models/sort31_enum.rb +59 -0
- data/lib/ctd_documentation/models/sort3_enum.rb +59 -0
- data/lib/ctd_documentation/models/sort41_enum.rb +41 -0
- data/lib/ctd_documentation/models/sort4_enum.rb +41 -0
- data/lib/ctd_documentation/models/sort5_enum.rb +35 -0
- data/lib/ctd_documentation/models/sort6_enum.rb +41 -0
- data/lib/ctd_documentation/models/sort_enum.rb +125 -0
- data/lib/ctd_documentation/models/source_virtual_zone.rb +60 -0
- data/lib/ctd_documentation/models/special_hint_enum.rb +26 -0
- data/lib/ctd_documentation/models/special_hint_exact_enum.rb +26 -0
- data/lib/ctd_documentation/models/status_enum.rb +17 -0
- data/lib/ctd_documentation/models/status_exact_enum.rb +23 -0
- data/lib/ctd_documentation/models/subnet.rb +50 -0
- data/lib/ctd_documentation/models/task.rb +281 -0
- data/lib/ctd_documentation/models/taskextraparams.rb +71 -0
- data/lib/ctd_documentation/models/update_a_single_query_response.rb +57 -0
- data/lib/ctd_documentation/models/update_a_single_task_response.rb +57 -0
- data/lib/ctd_documentation/models/update_license_response.rb +79 -0
- data/lib/ctd_documentation/models/user.rb +88 -0
- data/lib/ctd_documentation/models/virtual_zones.rb +118 -0
- data/lib/ctd_documentation/utilities/date_time_helper.rb +11 -0
- data/lib/ctd_documentation/utilities/file_wrapper.rb +16 -0
- data/lib/ctd_documentation.rb +155 -0
- data/test/controllers/controller_test_base.rb +29 -0
- data/test/controllers/test_activities_controller.rb +64 -0
- data/test/controllers/test_alerts_controller.rb +16 -0
- data/test/controllers/test_assets_controller.rb +79 -0
- data/test/controllers/test_custom_attributes_categories_controller.rb +52 -0
- data/test/controllers/test_events_controller.rb +55 -0
- data/test/controllers/test_login_controller.rb +45 -0
- data/test/controllers/test_queries_controller.rb +292 -0
- data/test/controllers/test_sites_controller.rb +53 -0
- data/test/controllers/test_tasks_controller.rb +250 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +259 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
# ctd_documentation
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CtdDocumentation
|
7
|
+
# Auth Authenticate 401 Error class.
|
8
|
+
class AuthAuthenticate401ErrorException < APIException
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :error
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :exception
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :exception_class
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [TrueClass|FalseClass]
|
26
|
+
attr_accessor :success
|
27
|
+
|
28
|
+
# The constructor.
|
29
|
+
# @param [String] The reason for raising an exception.
|
30
|
+
# @param [HttpResponse] The HttpReponse of the API call.
|
31
|
+
def initialize(reason, response)
|
32
|
+
super(reason, response)
|
33
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
34
|
+
unbox(hash)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Populates this object by extracting properties from a hash.
|
38
|
+
# @param [Hash] The deserialized response sent by the server in the
|
39
|
+
# response body.
|
40
|
+
def unbox(hash)
|
41
|
+
@error = hash.key?('error') ? hash['error'] : SKIP
|
42
|
+
@exception = hash.key?('exception') ? hash['exception'] : SKIP
|
43
|
+
@exception_class =
|
44
|
+
hash.key?('exception_class') ? hash['exception_class'] : SKIP
|
45
|
+
@success = hash.key?('success') ? hash['success'] : SKIP
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# ctd_documentation
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CtdDocumentation
|
7
|
+
# Utility class for custom header authorization.
|
8
|
+
class CustomHeaderAuth < CoreLibrary::HeaderAuth
|
9
|
+
# Display error message on occurrence of authentication failure in CustomAuthentication.
|
10
|
+
# @returns [String] The oAuth error message.
|
11
|
+
def error_message
|
12
|
+
'CustomHeaderAuthentication: authorization is undefined.'
|
13
|
+
end
|
14
|
+
|
15
|
+
# Initialization constructor.
|
16
|
+
def initialize(authorization)
|
17
|
+
auth_params = {}
|
18
|
+
auth_params['Authorization'] = authorization unless authorization.nil?
|
19
|
+
|
20
|
+
super auth_params
|
21
|
+
|
22
|
+
@_authorization = authorization
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# ctd_documentation
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CtdDocumentation
|
7
|
+
# HttpCallBack allows defining callables for pre and post API calls.
|
8
|
+
class HttpCallBack < CoreLibrary::HttpCallback
|
9
|
+
end
|
10
|
+
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
|
+
# Actionable Model.
|
8
|
+
class Actionable < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [Integer]
|
14
|
+
attr_accessor :actionable_id
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :role_number
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :role_name
|
23
|
+
|
24
|
+
# A mapping from model property names to API property names.
|
25
|
+
def self.names
|
26
|
+
@_hash = {} if @_hash.nil?
|
27
|
+
@_hash['actionable_id'] = 'actionable_id'
|
28
|
+
@_hash['role_number'] = 'role_number'
|
29
|
+
@_hash['role_name'] = 'role_name'
|
30
|
+
@_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
# An array for optional fields
|
34
|
+
def self.optionals
|
35
|
+
%w[
|
36
|
+
actionable_id
|
37
|
+
role_number
|
38
|
+
role_name
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(actionable_id = SKIP,
|
48
|
+
role_number = SKIP,
|
49
|
+
role_name = SKIP)
|
50
|
+
@actionable_id = actionable_id unless actionable_id == SKIP
|
51
|
+
@role_number = role_number unless role_number == SKIP
|
52
|
+
@role_name = role_name unless role_name == 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
|
+
actionable_id = hash.key?('actionable_id') ? hash['actionable_id'] : SKIP
|
61
|
+
role_number = hash.key?('role_number') ? hash['role_number'] : SKIP
|
62
|
+
role_name = hash.key?('role_name') ? hash['role_name'] : SKIP
|
63
|
+
|
64
|
+
# Create object from extracted values.
|
65
|
+
Actionable.new(actionable_id,
|
66
|
+
role_number,
|
67
|
+
role_name)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# ctd_documentation
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CtdDocumentation
|
7
|
+
# ActionableAsset Model.
|
8
|
+
class ActionableAsset < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [Integer]
|
14
|
+
attr_accessor :actionable_id
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :role_number
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :role_name
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [ActionableRelatedAsset]
|
26
|
+
attr_accessor :asset
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['actionable_id'] = 'actionable_id'
|
32
|
+
@_hash['role_number'] = 'role_number'
|
33
|
+
@_hash['role_name'] = 'role_name'
|
34
|
+
@_hash['asset'] = 'asset'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
actionable_id
|
42
|
+
role_number
|
43
|
+
role_name
|
44
|
+
asset
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
# An array for nullable fields
|
49
|
+
def self.nullables
|
50
|
+
[]
|
51
|
+
end
|
52
|
+
|
53
|
+
def initialize(actionable_id = SKIP,
|
54
|
+
role_number = SKIP,
|
55
|
+
role_name = SKIP,
|
56
|
+
asset = SKIP)
|
57
|
+
@actionable_id = actionable_id unless actionable_id == SKIP
|
58
|
+
@role_number = role_number unless role_number == SKIP
|
59
|
+
@role_name = role_name unless role_name == SKIP
|
60
|
+
@asset = asset unless asset == 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
|
+
actionable_id = hash.key?('actionable_id') ? hash['actionable_id'] : SKIP
|
69
|
+
role_number = hash.key?('role_number') ? hash['role_number'] : SKIP
|
70
|
+
role_name = hash.key?('role_name') ? hash['role_name'] : SKIP
|
71
|
+
asset = ActionableRelatedAsset.from_hash(hash['asset']) if hash['asset']
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
ActionableAsset.new(actionable_id,
|
75
|
+
role_number,
|
76
|
+
role_name,
|
77
|
+
asset)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# ctd_documentation
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CtdDocumentation
|
7
|
+
# ActionableCap Model.
|
8
|
+
class ActionableCap < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [Integer]
|
14
|
+
attr_accessor :actionable_id
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :role_number
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :role_name
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [Cap]
|
26
|
+
attr_accessor :cap
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['actionable_id'] = 'actionable_id'
|
32
|
+
@_hash['role_number'] = 'role_number'
|
33
|
+
@_hash['role_name'] = 'role_name'
|
34
|
+
@_hash['cap'] = 'cap'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
actionable_id
|
42
|
+
role_number
|
43
|
+
role_name
|
44
|
+
cap
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
# An array for nullable fields
|
49
|
+
def self.nullables
|
50
|
+
[]
|
51
|
+
end
|
52
|
+
|
53
|
+
def initialize(actionable_id = SKIP,
|
54
|
+
role_number = SKIP,
|
55
|
+
role_name = SKIP,
|
56
|
+
cap = SKIP)
|
57
|
+
@actionable_id = actionable_id unless actionable_id == SKIP
|
58
|
+
@role_number = role_number unless role_number == SKIP
|
59
|
+
@role_name = role_name unless role_name == SKIP
|
60
|
+
@cap = cap unless cap == 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
|
+
actionable_id = hash.key?('actionable_id') ? hash['actionable_id'] : SKIP
|
69
|
+
role_number = hash.key?('role_number') ? hash['role_number'] : SKIP
|
70
|
+
role_name = hash.key?('role_name') ? hash['role_name'] : SKIP
|
71
|
+
cap = Cap.from_hash(hash['cap']) if hash['cap']
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
ActionableCap.new(actionable_id,
|
75
|
+
role_number,
|
76
|
+
role_name,
|
77
|
+
cap)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# ctd_documentation
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CtdDocumentation
|
7
|
+
# ActionableInformation Model.
|
8
|
+
class ActionableInformation < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [Integer]
|
14
|
+
attr_accessor :actionable_id
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :role_number
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :role_name
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [Information]
|
26
|
+
attr_accessor :information
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['actionable_id'] = 'actionable_id'
|
32
|
+
@_hash['role_number'] = 'role_number'
|
33
|
+
@_hash['role_name'] = 'role_name'
|
34
|
+
@_hash['information'] = 'information'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
actionable_id
|
42
|
+
role_number
|
43
|
+
role_name
|
44
|
+
information
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
# An array for nullable fields
|
49
|
+
def self.nullables
|
50
|
+
[]
|
51
|
+
end
|
52
|
+
|
53
|
+
def initialize(actionable_id = SKIP,
|
54
|
+
role_number = SKIP,
|
55
|
+
role_name = SKIP,
|
56
|
+
information = SKIP)
|
57
|
+
@actionable_id = actionable_id unless actionable_id == SKIP
|
58
|
+
@role_number = role_number unless role_number == SKIP
|
59
|
+
@role_name = role_name unless role_name == SKIP
|
60
|
+
@information = information unless information == 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
|
+
actionable_id = hash.key?('actionable_id') ? hash['actionable_id'] : SKIP
|
69
|
+
role_number = hash.key?('role_number') ? hash['role_number'] : SKIP
|
70
|
+
role_name = hash.key?('role_name') ? hash['role_name'] : SKIP
|
71
|
+
information = Information.from_hash(hash['information']) if hash['information']
|
72
|
+
|
73
|
+
# Create object from extracted values.
|
74
|
+
ActionableInformation.new(actionable_id,
|
75
|
+
role_number,
|
76
|
+
role_name,
|
77
|
+
information)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|