apimatic-semgrep-sdk 0.0.1
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.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +205 -0
- data/bin/console +15 -0
- data/lib/semgrep_web_app/api_helper.rb +10 -0
- data/lib/semgrep_web_app/apis/base_api.rb +67 -0
- data/lib/semgrep_web_app/apis/deployments_service_api.rb +29 -0
- data/lib/semgrep_web_app/apis/findings_service_api.rb +107 -0
- data/lib/semgrep_web_app/apis/misc_service_api.rb +47 -0
- data/lib/semgrep_web_app/apis/policies_service_api.rb +97 -0
- data/lib/semgrep_web_app/apis/projects_service_api.rb +238 -0
- data/lib/semgrep_web_app/apis/scans_service_api.rb +65 -0
- data/lib/semgrep_web_app/apis/secrets_service_api.rb +55 -0
- data/lib/semgrep_web_app/apis/supply_chain_service_api.rb +154 -0
- data/lib/semgrep_web_app/apis/ticketing_service_api.rb +144 -0
- data/lib/semgrep_web_app/apis/triage_service_api.rb +43 -0
- data/lib/semgrep_web_app/client.rb +136 -0
- data/lib/semgrep_web_app/configuration.rb +178 -0
- data/lib/semgrep_web_app/exceptions/api_exception.rb +21 -0
- data/lib/semgrep_web_app/http/api_response.rb +19 -0
- data/lib/semgrep_web_app/http/auth/semgrep_admin_jwt.rb +53 -0
- data/lib/semgrep_web_app/http/auth/semgrep_jwt.rb +53 -0
- data/lib/semgrep_web_app/http/auth/semgrep_web_token.rb +53 -0
- data/lib/semgrep_web_app/http/http_call_back.rb +10 -0
- data/lib/semgrep_web_app/http/http_method_enum.rb +10 -0
- data/lib/semgrep_web_app/http/http_request.rb +10 -0
- data/lib/semgrep_web_app/http/http_response.rb +10 -0
- data/lib/semgrep_web_app/http/proxy_settings.rb +22 -0
- data/lib/semgrep_web_app/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/semgrep_web_app/logging/sdk_logger.rb +17 -0
- data/lib/semgrep_web_app/models/add_project_tags_request.rb +96 -0
- data/lib/semgrep_web_app/models/add_project_tags_response.rb +73 -0
- data/lib/semgrep_web_app/models/ai_powered_scan_finding.rb +426 -0
- data/lib/semgrep_web_app/models/ai_sast_findings.rb +85 -0
- data/lib/semgrep_web_app/models/api_v1_deployments_findings_response.rb +87 -0
- data/lib/semgrep_web_app/models/assistant.rb +127 -0
- data/lib/semgrep_web_app/models/autofix.rb +98 -0
- data/lib/semgrep_web_app/models/autotriage.rb +98 -0
- data/lib/semgrep_web_app/models/autotriage_verdict.rb +36 -0
- data/lib/semgrep_web_app/models/autotriage_verdict2.rb +38 -0
- data/lib/semgrep_web_app/models/base_model.rb +110 -0
- data/lib/semgrep_web_app/models/bulk_triage_request.rb +393 -0
- data/lib/semgrep_web_app/models/bulk_triage_response.rb +83 -0
- data/lib/semgrep_web_app/models/click_to_fix_failure.rb +95 -0
- data/lib/semgrep_web_app/models/click_to_fix_pr.rb +95 -0
- data/lib/semgrep_web_app/models/click_to_fix_pr_state.rb +38 -0
- data/lib/semgrep_web_app/models/component.rb +95 -0
- data/lib/semgrep_web_app/models/confidence.rb +42 -0
- data/lib/semgrep_web_app/models/confidence1.rb +40 -0
- data/lib/semgrep_web_app/models/confidence2.rb +40 -0
- data/lib/semgrep_web_app/models/confidence3.rb +40 -0
- data/lib/semgrep_web_app/models/confidence7.rb +41 -0
- data/lib/semgrep_web_app/models/confidence8.rb +42 -0
- data/lib/semgrep_web_app/models/create_sbom_export_request.rb +176 -0
- data/lib/semgrep_web_app/models/create_sbom_export_response.rb +74 -0
- data/lib/semgrep_web_app/models/create_ticket_request.rb +393 -0
- data/lib/semgrep_web_app/models/cyclonedx_version.rb +48 -0
- data/lib/semgrep_web_app/models/delete_project_response.rb +74 -0
- data/lib/semgrep_web_app/models/delete_project_tags_response.rb +73 -0
- data/lib/semgrep_web_app/models/deployment.rb +102 -0
- data/lib/semgrep_web_app/models/ecosystem.rb +91 -0
- data/lib/semgrep_web_app/models/ecosystem1.rb +92 -0
- data/lib/semgrep_web_app/models/ecosystem2.rb +76 -0
- data/lib/semgrep_web_app/models/endpoint_reference.rb +72 -0
- data/lib/semgrep_web_app/models/epss_probability.rb +45 -0
- data/lib/semgrep_web_app/models/epss_score.rb +95 -0
- data/lib/semgrep_web_app/models/exposures.rb +50 -0
- data/lib/semgrep_web_app/models/exposures2.rb +51 -0
- data/lib/semgrep_web_app/models/external_ticket.rb +116 -0
- data/lib/semgrep_web_app/models/finding_location.rb +126 -0
- data/lib/semgrep_web_app/models/finding_repository.rb +95 -0
- data/lib/semgrep_web_app/models/finding_rule.rb +158 -0
- data/lib/semgrep_web_app/models/fix_recommendation.rb +95 -0
- data/lib/semgrep_web_app/models/float_range.rb +85 -0
- data/lib/semgrep_web_app/models/format.rb +27 -0
- data/lib/semgrep_web_app/models/found_dependency.rb +128 -0
- data/lib/semgrep_web_app/models/get_project_response.rb +73 -0
- data/lib/semgrep_web_app/models/get_sbom_export_response.rb +100 -0
- data/lib/semgrep_web_app/models/guidance.rb +98 -0
- data/lib/semgrep_web_app/models/issue_type.rb +40 -0
- data/lib/semgrep_web_app/models/issue_type1.rb +40 -0
- data/lib/semgrep_web_app/models/issue_type2.rb +42 -0
- data/lib/semgrep_web_app/models/license_policy_settings.rb +42 -0
- data/lib/semgrep_web_app/models/link_ticket_request.rb +93 -0
- data/lib/semgrep_web_app/models/list_dependencies_request.rb +108 -0
- data/lib/semgrep_web_app/models/list_dependencies_response.rb +102 -0
- data/lib/semgrep_web_app/models/list_findings_response.rb +100 -0
- data/lib/semgrep_web_app/models/list_lockfiles_for_dependencies_request.rb +118 -0
- data/lib/semgrep_web_app/models/list_lockfiles_for_dependencies_response.rb +103 -0
- data/lib/semgrep_web_app/models/list_project.rb +145 -0
- data/lib/semgrep_web_app/models/list_projects_response.rb +82 -0
- data/lib/semgrep_web_app/models/list_repositories_for_dependencies_request.rb +107 -0
- data/lib/semgrep_web_app/models/list_repositories_for_dependencies_response.rb +103 -0
- data/lib/semgrep_web_app/models/managed_scan_config.rb +85 -0
- data/lib/semgrep_web_app/models/metadata_component_type.rb +101 -0
- data/lib/semgrep_web_app/models/mode.rb +48 -0
- data/lib/semgrep_web_app/models/new_triage_reason.rb +48 -0
- data/lib/semgrep_web_app/models/new_triage_state.rb +48 -0
- data/lib/semgrep_web_app/models/policy.rb +118 -0
- data/lib/semgrep_web_app/models/policy_mode.rb +48 -0
- data/lib/semgrep_web_app/models/policy_mode1.rb +40 -0
- data/lib/semgrep_web_app/models/policy_mode3.rb +51 -0
- data/lib/semgrep_web_app/models/policy_reference.rb +105 -0
- data/lib/semgrep_web_app/models/product_type.rb +38 -0
- data/lib/semgrep_web_app/models/products.rb +46 -0
- data/lib/semgrep_web_app/models/project.rb +157 -0
- data/lib/semgrep_web_app/models/protos_ai_v1_autotriage.rb +154 -0
- data/lib/semgrep_web_app/models/protos_ai_v1_autotriage_feedback.rb +98 -0
- data/lib/semgrep_web_app/models/protos_common_v1_review_comment.rb +90 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response.rb +123 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_failed.rb +85 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_skipped.rb +85 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_success.rb +106 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_delete_ticket_response.rb +76 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_diff_scan.rb +75 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_full_scan.rb +75 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_get_bootstrap_sms_vpc_response.rb +130 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_get_scan_response.rb +168 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_get_scan_response_scan_meta.rb +256 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_link_ticket_response.rb +119 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_deployments_response.rb +85 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_policies_response.rb +84 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_policy_rules_response.rb +104 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_secrets_path_response.rb +104 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_search_scans_response.rb +94 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_unlink_ticket_response.rb +77 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_update_policy_response.rb +88 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_code_location.rb +144 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_dependency.rb +87 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_dependency_filter.rb +199 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_found_dependency.rb +174 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_lockfile_dependency_summary.rb +87 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_package_filter.rb +124 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_repository_dependency_summary.rb +111 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb +109 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_sbom_metadata_contact.rb +95 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_sbom_metadata_supplier.rb +95 -0
- data/lib/semgrep_web_app/models/protos_scan_v1_scan_findings_counts.rb +105 -0
- data/lib/semgrep_web_app/models/protos_scan_v1_scan_public.rb +228 -0
- data/lib/semgrep_web_app/models/protos_secrets_v1_historical_info.rb +116 -0
- data/lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding.rb +320 -0
- data/lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb +121 -0
- data/lib/semgrep_web_app/models/protos_ticketing_v1_external_ticket.rb +106 -0
- data/lib/semgrep_web_app/models/rating.rb +38 -0
- data/lib/semgrep_web_app/models/reachability.rb +48 -0
- data/lib/semgrep_web_app/models/repository_visibility.rb +40 -0
- data/lib/semgrep_web_app/models/review_comment.rb +100 -0
- data/lib/semgrep_web_app/models/risk.rb +40 -0
- data/lib/semgrep_web_app/models/rule.rb +292 -0
- data/lib/semgrep_web_app/models/rule_explanation.rb +98 -0
- data/lib/semgrep_web_app/models/sast_finding.rb +426 -0
- data/lib/semgrep_web_app/models/sast_findings.rb +84 -0
- data/lib/semgrep_web_app/models/sbom_output_format.rb +37 -0
- data/lib/semgrep_web_app/models/sca_finding.rb +458 -0
- data/lib/semgrep_web_app/models/sca_findings.rb +85 -0
- data/lib/semgrep_web_app/models/scm_type.rb +70 -0
- data/lib/semgrep_web_app/models/search_scans_request.rb +202 -0
- data/lib/semgrep_web_app/models/severities.rb +44 -0
- data/lib/semgrep_web_app/models/severities2.rb +45 -0
- data/lib/semgrep_web_app/models/severity.rb +46 -0
- data/lib/semgrep_web_app/models/severity1.rb +45 -0
- data/lib/semgrep_web_app/models/severity4.rb +46 -0
- data/lib/semgrep_web_app/models/severity5.rb +48 -0
- data/lib/semgrep_web_app/models/source.rb +42 -0
- data/lib/semgrep_web_app/models/state.rb +42 -0
- data/lib/semgrep_web_app/models/status.rb +55 -0
- data/lib/semgrep_web_app/models/status1.rb +52 -0
- data/lib/semgrep_web_app/models/status3.rb +44 -0
- data/lib/semgrep_web_app/models/status6.rb +55 -0
- data/lib/semgrep_web_app/models/status7.rb +59 -0
- data/lib/semgrep_web_app/models/status8.rb +61 -0
- data/lib/semgrep_web_app/models/status9.rb +55 -0
- data/lib/semgrep_web_app/models/statuses.rb +63 -0
- data/lib/semgrep_web_app/models/toggle_project_managed_scan_request.rb +108 -0
- data/lib/semgrep_web_app/models/toggle_project_managed_scan_response.rb +73 -0
- data/lib/semgrep_web_app/models/transitivities.rb +40 -0
- data/lib/semgrep_web_app/models/transitivities2.rb +42 -0
- data/lib/semgrep_web_app/models/transitivity.rb +41 -0
- data/lib/semgrep_web_app/models/transitivity1.rb +42 -0
- data/lib/semgrep_web_app/models/transitivity2.rb +40 -0
- data/lib/semgrep_web_app/models/triage_reason.rb +48 -0
- data/lib/semgrep_web_app/models/triage_reasons.rb +48 -0
- data/lib/semgrep_web_app/models/triage_reasons2.rb +50 -0
- data/lib/semgrep_web_app/models/triage_state.rb +54 -0
- data/lib/semgrep_web_app/models/unlink_ticket_request.rb +83 -0
- data/lib/semgrep_web_app/models/update_policy_request.rb +113 -0
- data/lib/semgrep_web_app/models/update_project_request.rb +121 -0
- data/lib/semgrep_web_app/models/update_project_response.rb +73 -0
- data/lib/semgrep_web_app/models/usage.rb +99 -0
- data/lib/semgrep_web_app/models/validation_state.rb +45 -0
- data/lib/semgrep_web_app/models/validation_state2.rb +47 -0
- data/lib/semgrep_web_app/models/validation_state3.rb +48 -0
- data/lib/semgrep_web_app/models/verdict.rb +41 -0
- data/lib/semgrep_web_app/models/verdict1.rb +38 -0
- data/lib/semgrep_web_app/models/visibility.rb +42 -0
- data/lib/semgrep_web_app/utilities/date_time_helper.rb +11 -0
- data/lib/semgrep_web_app/utilities/file_wrapper.rb +28 -0
- data/lib/semgrep_web_app/utilities/union_type_lookup.rb +34 -0
- data/lib/semgrep_web_app.rb +245 -0
- metadata +283 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# Return the list of projects in an organization.
|
|
8
|
+
class ListProjectsResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[ListProject]]
|
|
14
|
+
attr_accessor :projects
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['projects'] = 'projects'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(projects:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@projects = projects
|
|
38
|
+
@additional_properties = additional_properties
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
# Parameter is an array, so we need to iterate through it
|
|
47
|
+
projects = nil
|
|
48
|
+
unless hash['projects'].nil?
|
|
49
|
+
projects = []
|
|
50
|
+
hash['projects'].each do |structure|
|
|
51
|
+
projects << (ListProject.from_hash(structure) if structure)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
projects = nil unless hash.key?('projects')
|
|
56
|
+
|
|
57
|
+
# Create a new hash for additional properties, removing known properties.
|
|
58
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
59
|
+
|
|
60
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
61
|
+
new_hash, proc { |value| value }
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Create object from extracted values.
|
|
65
|
+
ListProjectsResponse.new(projects: projects,
|
|
66
|
+
additional_properties: additional_properties)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} projects: #{@projects}, additional_properties: #{@additional_properties}>"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
76
|
+
def inspect
|
|
77
|
+
class_name = self.class.name.split('::').last
|
|
78
|
+
"<#{class_name} projects: #{@projects.inspect}, additional_properties:"\
|
|
79
|
+
" #{@additional_properties}>"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# ListRepositoriesForDependenciesRequest Model.
|
|
8
|
+
class ListRepositoriesForDependenciesRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Use cursor in response to get next page of results.
|
|
13
|
+
# @return [Integer]
|
|
14
|
+
attr_accessor :cursor
|
|
15
|
+
|
|
16
|
+
# Object to provide dependency details to filter by.
|
|
17
|
+
# @return [ProtosScaV1DependencyFilter]
|
|
18
|
+
attr_accessor :dependency_filter
|
|
19
|
+
|
|
20
|
+
# Deployment ID (numeric). Example: `123`. Can be found at `/deployments`,
|
|
21
|
+
# or in your Settings in the web UI.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :deployment_id
|
|
24
|
+
|
|
25
|
+
# Number of repositories per page. Default: 5, min: 1, max: 100.
|
|
26
|
+
# @return [Integer]
|
|
27
|
+
attr_accessor :page_size
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['cursor'] = 'cursor'
|
|
33
|
+
@_hash['dependency_filter'] = 'dependencyFilter'
|
|
34
|
+
@_hash['deployment_id'] = 'deploymentId'
|
|
35
|
+
@_hash['page_size'] = 'pageSize'
|
|
36
|
+
@_hash
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An array for optional fields
|
|
40
|
+
def self.optionals
|
|
41
|
+
%w[
|
|
42
|
+
cursor
|
|
43
|
+
dependency_filter
|
|
44
|
+
page_size
|
|
45
|
+
]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(deployment_id:, cursor: SKIP, dependency_filter: SKIP,
|
|
54
|
+
page_size: 5, additional_properties: nil)
|
|
55
|
+
# Add additional model properties to the instance
|
|
56
|
+
additional_properties = {} if additional_properties.nil?
|
|
57
|
+
|
|
58
|
+
@cursor = cursor unless cursor == SKIP
|
|
59
|
+
@dependency_filter = dependency_filter unless dependency_filter == SKIP
|
|
60
|
+
@deployment_id = deployment_id
|
|
61
|
+
@page_size = page_size unless page_size == SKIP
|
|
62
|
+
@additional_properties = additional_properties
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Creates an instance of the object from a hash.
|
|
66
|
+
def self.from_hash(hash)
|
|
67
|
+
return nil unless hash
|
|
68
|
+
|
|
69
|
+
# Extract variables from the hash.
|
|
70
|
+
deployment_id = hash.key?('deploymentId') ? hash['deploymentId'] : nil
|
|
71
|
+
cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
|
|
72
|
+
dependency_filter = ProtosScaV1DependencyFilter.from_hash(hash['dependencyFilter']) if
|
|
73
|
+
hash['dependencyFilter']
|
|
74
|
+
page_size = hash['pageSize'] ||= 5
|
|
75
|
+
|
|
76
|
+
# Create a new hash for additional properties, removing known properties.
|
|
77
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
new_hash, proc { |value| value }
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Create object from extracted values.
|
|
84
|
+
ListRepositoriesForDependenciesRequest.new(deployment_id: deployment_id,
|
|
85
|
+
cursor: cursor,
|
|
86
|
+
dependency_filter: dependency_filter,
|
|
87
|
+
page_size: page_size,
|
|
88
|
+
additional_properties: additional_properties)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Provides a human-readable string representation of the object.
|
|
92
|
+
def to_s
|
|
93
|
+
class_name = self.class.name.split('::').last
|
|
94
|
+
"<#{class_name} cursor: #{@cursor}, dependency_filter: #{@dependency_filter},"\
|
|
95
|
+
" deployment_id: #{@deployment_id}, page_size: #{@page_size}, additional_properties:"\
|
|
96
|
+
" #{@additional_properties}>"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
100
|
+
def inspect
|
|
101
|
+
class_name = self.class.name.split('::').last
|
|
102
|
+
"<#{class_name} cursor: #{@cursor.inspect}, dependency_filter:"\
|
|
103
|
+
" #{@dependency_filter.inspect}, deployment_id: #{@deployment_id.inspect}, page_size:"\
|
|
104
|
+
" #{@page_size.inspect}, additional_properties: #{@additional_properties}>"
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# ListRepositoriesForDependenciesResponse Model.
|
|
8
|
+
class ListRepositoriesForDependenciesResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Pass to next request to get next page of results.
|
|
13
|
+
# @return [Integer]
|
|
14
|
+
attr_accessor :cursor
|
|
15
|
+
|
|
16
|
+
# True if there are more repositories to get.
|
|
17
|
+
# @return [TrueClass | FalseClass]
|
|
18
|
+
attr_accessor :has_more
|
|
19
|
+
|
|
20
|
+
# List of repositories.
|
|
21
|
+
# @return [Array[ProtosScaV1RepositoryDependencySummary]]
|
|
22
|
+
attr_accessor :repository_summaries
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['cursor'] = 'cursor'
|
|
28
|
+
@_hash['has_more'] = 'hasMore'
|
|
29
|
+
@_hash['repository_summaries'] = 'repositorySummaries'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
cursor
|
|
37
|
+
]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for nullable fields
|
|
41
|
+
def self.nullables
|
|
42
|
+
[]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def initialize(has_more:, repository_summaries:, cursor: SKIP,
|
|
46
|
+
additional_properties: nil)
|
|
47
|
+
# Add additional model properties to the instance
|
|
48
|
+
additional_properties = {} if additional_properties.nil?
|
|
49
|
+
|
|
50
|
+
@cursor = cursor unless cursor == SKIP
|
|
51
|
+
@has_more = has_more
|
|
52
|
+
@repository_summaries = repository_summaries
|
|
53
|
+
@additional_properties = additional_properties
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Creates an instance of the object from a hash.
|
|
57
|
+
def self.from_hash(hash)
|
|
58
|
+
return nil unless hash
|
|
59
|
+
|
|
60
|
+
# Extract variables from the hash.
|
|
61
|
+
has_more = hash.key?('hasMore') ? hash['hasMore'] : nil
|
|
62
|
+
# Parameter is an array, so we need to iterate through it
|
|
63
|
+
repository_summaries = nil
|
|
64
|
+
unless hash['repositorySummaries'].nil?
|
|
65
|
+
repository_summaries = []
|
|
66
|
+
hash['repositorySummaries'].each do |structure|
|
|
67
|
+
repository_summaries << (ProtosScaV1RepositoryDependencySummary.from_hash(structure) if structure)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
repository_summaries = nil unless hash.key?('repositorySummaries')
|
|
72
|
+
cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
|
|
73
|
+
|
|
74
|
+
# Create a new hash for additional properties, removing known properties.
|
|
75
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
76
|
+
|
|
77
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
78
|
+
new_hash, proc { |value| value }
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# Create object from extracted values.
|
|
82
|
+
ListRepositoriesForDependenciesResponse.new(has_more: has_more,
|
|
83
|
+
repository_summaries: repository_summaries,
|
|
84
|
+
cursor: cursor,
|
|
85
|
+
additional_properties: additional_properties)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a human-readable string representation of the object.
|
|
89
|
+
def to_s
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} cursor: #{@cursor}, has_more: #{@has_more}, repository_summaries:"\
|
|
92
|
+
" #{@repository_summaries}, additional_properties: #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
96
|
+
def inspect
|
|
97
|
+
class_name = self.class.name.split('::').last
|
|
98
|
+
"<#{class_name} cursor: #{@cursor.inspect}, has_more: #{@has_more.inspect},"\
|
|
99
|
+
" repository_summaries: #{@repository_summaries.inspect}, additional_properties:"\
|
|
100
|
+
" #{@additional_properties}>"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# [Beta] Configuration of Semgrep Managed Scans for the project, if relevant.
|
|
8
|
+
class ManagedScanConfig < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [ProtosOpenapiV1DiffScan]
|
|
14
|
+
attr_accessor :diff_scan
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [ProtosOpenapiV1FullScan]
|
|
18
|
+
attr_accessor :full_scan
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['diff_scan'] = 'diff_scan'
|
|
24
|
+
@_hash['full_scan'] = 'full_scan'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
diff_scan
|
|
32
|
+
full_scan
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(diff_scan: SKIP, full_scan: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@diff_scan = diff_scan unless diff_scan == SKIP
|
|
46
|
+
@full_scan = full_scan unless full_scan == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
diff_scan = ProtosOpenapiV1DiffScan.from_hash(hash['diff_scan']) if hash['diff_scan']
|
|
56
|
+
full_scan = ProtosOpenapiV1FullScan.from_hash(hash['full_scan']) if hash['full_scan']
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
ManagedScanConfig.new(diff_scan: diff_scan,
|
|
67
|
+
full_scan: full_scan,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} diff_scan: #{@diff_scan}, full_scan: #{@full_scan}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} diff_scan: #{@diff_scan.inspect}, full_scan: #{@full_scan.inspect},"\
|
|
82
|
+
" additional_properties: #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# Metadata component type for the SBOM export. | value | description |
|
|
8
|
+
# |-------|---------------| |
|
|
9
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_APPLICATION | | |
|
|
10
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FRAMEWORK | | |
|
|
11
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_LIBRARY | | |
|
|
12
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_CONTAINER | | |
|
|
13
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_PLATFORM | | |
|
|
14
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_OPERATING_SYSTEM | | |
|
|
15
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE | | |
|
|
16
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE_DRIVER | | |
|
|
17
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FIRMWARE | | |
|
|
18
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FILE | | |
|
|
19
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_MACHINE_LEARNING_MODEL | | |
|
|
20
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DATA | |
|
|
21
|
+
class MetadataComponentType
|
|
22
|
+
METADATA_COMPONENT_TYPE = [
|
|
23
|
+
# TODO: Write general description for
|
|
24
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_APPLICATION
|
|
25
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_APPLICATION = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_APPLICATION'.freeze,
|
|
26
|
+
|
|
27
|
+
# TODO: Write general description for
|
|
28
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FRAMEWORK
|
|
29
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FRAMEWORK = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FRAMEWORK'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for
|
|
32
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_LIBRARY
|
|
33
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_LIBRARY = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_LIBRARY'.freeze,
|
|
34
|
+
|
|
35
|
+
# TODO: Write general description for
|
|
36
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_CONTAINER
|
|
37
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_CONTAINER = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_CONTAINER'.freeze,
|
|
38
|
+
|
|
39
|
+
# TODO: Write general description for
|
|
40
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_PLATFORM
|
|
41
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_PLATFORM = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_PLATFORM'.freeze,
|
|
42
|
+
|
|
43
|
+
# TODO: Write general description for
|
|
44
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_OPERATING_SYSTEM
|
|
45
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_OPERATING_SYSTEM = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_OPERATING_SYSTEM'.freeze,
|
|
46
|
+
|
|
47
|
+
# TODO: Write general description for
|
|
48
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE
|
|
49
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE'.freeze,
|
|
50
|
+
|
|
51
|
+
# TODO: Write general description for
|
|
52
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE_DRIVER
|
|
53
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE_DRIVER = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE_DRIVER'.freeze,
|
|
54
|
+
|
|
55
|
+
# TODO: Write general description for
|
|
56
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FIRMWARE
|
|
57
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FIRMWARE = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FIRMWARE'.freeze,
|
|
58
|
+
|
|
59
|
+
# TODO: Write general description for
|
|
60
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FILE
|
|
61
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FILE = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FILE'.freeze,
|
|
62
|
+
|
|
63
|
+
# TODO: Write general description for
|
|
64
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_MACHINE_LEARNING_MODEL
|
|
65
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_MACHINE_LEARNING_MODEL = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_MACHINE_LEARNING_MODEL'.freeze,
|
|
66
|
+
|
|
67
|
+
# TODO: Write general description for
|
|
68
|
+
# SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DATA
|
|
69
|
+
SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DATA = 'SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DATA'.freeze
|
|
70
|
+
].freeze
|
|
71
|
+
|
|
72
|
+
def self.validate(value)
|
|
73
|
+
return false if value.nil?
|
|
74
|
+
|
|
75
|
+
METADATA_COMPONENT_TYPE.include?(value)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def self.from_value(value, default_value = SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_APPLICATION)
|
|
79
|
+
return default_value if value.nil?
|
|
80
|
+
|
|
81
|
+
str = value.to_s.strip
|
|
82
|
+
|
|
83
|
+
case str.downcase
|
|
84
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_application' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_APPLICATION
|
|
85
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_framework' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FRAMEWORK
|
|
86
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_library' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_LIBRARY
|
|
87
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_container' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_CONTAINER
|
|
88
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_platform' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_PLATFORM
|
|
89
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_operating_system' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_OPERATING_SYSTEM
|
|
90
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_device' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE
|
|
91
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_device_driver' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DEVICE_DRIVER
|
|
92
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_firmware' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FIRMWARE
|
|
93
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_file' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_FILE
|
|
94
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_machine_learning_model' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_MACHINE_LEARNING_MODEL
|
|
95
|
+
when 'sbom_metadata_component_type_cyclone_dx_v15_data' then SBOM_METADATA_COMPONENT_TYPE_CYCLONE_DX_V15_DATA
|
|
96
|
+
else
|
|
97
|
+
default_value
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# The behavior of the finding reporting: Monitor / Comment / Block. | value |
|
|
8
|
+
# description | |-------|---------------| | MODE_MONITOR | Monitor mode,
|
|
9
|
+
# silently report findings | | MODE_COMMENT | Comment mode, leaves PR comments
|
|
10
|
+
# but does not block | | MODE_BLOCK | Block mode, leaves PR comments and
|
|
11
|
+
# blocks PR | | MODE_DISABLED | Disabled mode, not active |
|
|
12
|
+
class Mode
|
|
13
|
+
MODE = [
|
|
14
|
+
# TODO: Write general description for MODE_MONITOR
|
|
15
|
+
MODE_MONITOR = 'MODE_MONITOR'.freeze,
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for MODE_COMMENT
|
|
18
|
+
MODE_COMMENT = 'MODE_COMMENT'.freeze,
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for MODE_BLOCK
|
|
21
|
+
MODE_BLOCK = 'MODE_BLOCK'.freeze,
|
|
22
|
+
|
|
23
|
+
# TODO: Write general description for MODE_DISABLED
|
|
24
|
+
MODE_DISABLED = 'MODE_DISABLED'.freeze
|
|
25
|
+
].freeze
|
|
26
|
+
|
|
27
|
+
def self.validate(value)
|
|
28
|
+
return false if value.nil?
|
|
29
|
+
|
|
30
|
+
MODE.include?(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.from_value(value, default_value = MODE_MONITOR)
|
|
34
|
+
return default_value if value.nil?
|
|
35
|
+
|
|
36
|
+
str = value.to_s.strip
|
|
37
|
+
|
|
38
|
+
case str.downcase
|
|
39
|
+
when 'mode_monitor' then MODE_MONITOR
|
|
40
|
+
when 'mode_comment' then MODE_COMMENT
|
|
41
|
+
when 'mode_block' then MODE_BLOCK
|
|
42
|
+
when 'mode_disabled' then MODE_DISABLED
|
|
43
|
+
else
|
|
44
|
+
default_value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# The reason for triaging to a given triage state.
|
|
8
|
+
class NewTriageReason
|
|
9
|
+
NEW_TRIAGE_REASON = [
|
|
10
|
+
# TODO: Write general description for ACCEPTABLE_RISK
|
|
11
|
+
ACCEPTABLE_RISK = 'acceptable_risk'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for FALSE_POSITIVE
|
|
14
|
+
FALSE_POSITIVE = 'false_positive'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for NO_TIME
|
|
17
|
+
NO_TIME = 'no_time'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for NO_TRIAGE_REASON
|
|
20
|
+
NO_TRIAGE_REASON = 'no_triage_reason'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for DUPLICATE
|
|
23
|
+
DUPLICATE = 'duplicate'.freeze
|
|
24
|
+
].freeze
|
|
25
|
+
|
|
26
|
+
def self.validate(value)
|
|
27
|
+
return false if value.nil?
|
|
28
|
+
|
|
29
|
+
NEW_TRIAGE_REASON.include?(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.from_value(value, default_value = ACCEPTABLE_RISK)
|
|
33
|
+
return default_value if value.nil?
|
|
34
|
+
|
|
35
|
+
str = value.to_s.strip
|
|
36
|
+
|
|
37
|
+
case str.downcase
|
|
38
|
+
when 'acceptable_risk' then ACCEPTABLE_RISK
|
|
39
|
+
when 'false_positive' then FALSE_POSITIVE
|
|
40
|
+
when 'no_time' then NO_TIME
|
|
41
|
+
when 'no_triage_reason' then NO_TRIAGE_REASON
|
|
42
|
+
when 'duplicate' then DUPLICATE
|
|
43
|
+
else
|
|
44
|
+
default_value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# The triage state you would like to bulk triage your findings to.
|
|
8
|
+
class NewTriageState
|
|
9
|
+
NEW_TRIAGE_STATE = [
|
|
10
|
+
# TODO: Write general description for IGNORED
|
|
11
|
+
IGNORED = 'ignored'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for REVIEWING
|
|
14
|
+
REVIEWING = 'reviewing'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for FIXING
|
|
17
|
+
FIXING = 'fixing'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for REOPENED
|
|
20
|
+
REOPENED = 'reopened'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for PROVISIONALLY_IGNORED
|
|
23
|
+
PROVISIONALLY_IGNORED = 'provisionally_ignored'.freeze
|
|
24
|
+
].freeze
|
|
25
|
+
|
|
26
|
+
def self.validate(value)
|
|
27
|
+
return false if value.nil?
|
|
28
|
+
|
|
29
|
+
NEW_TRIAGE_STATE.include?(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.from_value(value, default_value = IGNORED)
|
|
33
|
+
return default_value if value.nil?
|
|
34
|
+
|
|
35
|
+
str = value.to_s.strip
|
|
36
|
+
|
|
37
|
+
case str.downcase
|
|
38
|
+
when 'ignored' then IGNORED
|
|
39
|
+
when 'reviewing' then REVIEWING
|
|
40
|
+
when 'fixing' then FIXING
|
|
41
|
+
when 'reopened' then REOPENED
|
|
42
|
+
when 'provisionally_ignored' then PROVISIONALLY_IGNORED
|
|
43
|
+
else
|
|
44
|
+
default_value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|