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.
Files changed (200) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +205 -0
  4. data/bin/console +15 -0
  5. data/lib/semgrep_web_app/api_helper.rb +10 -0
  6. data/lib/semgrep_web_app/apis/base_api.rb +67 -0
  7. data/lib/semgrep_web_app/apis/deployments_service_api.rb +29 -0
  8. data/lib/semgrep_web_app/apis/findings_service_api.rb +107 -0
  9. data/lib/semgrep_web_app/apis/misc_service_api.rb +47 -0
  10. data/lib/semgrep_web_app/apis/policies_service_api.rb +97 -0
  11. data/lib/semgrep_web_app/apis/projects_service_api.rb +238 -0
  12. data/lib/semgrep_web_app/apis/scans_service_api.rb +65 -0
  13. data/lib/semgrep_web_app/apis/secrets_service_api.rb +55 -0
  14. data/lib/semgrep_web_app/apis/supply_chain_service_api.rb +154 -0
  15. data/lib/semgrep_web_app/apis/ticketing_service_api.rb +144 -0
  16. data/lib/semgrep_web_app/apis/triage_service_api.rb +43 -0
  17. data/lib/semgrep_web_app/client.rb +136 -0
  18. data/lib/semgrep_web_app/configuration.rb +178 -0
  19. data/lib/semgrep_web_app/exceptions/api_exception.rb +21 -0
  20. data/lib/semgrep_web_app/http/api_response.rb +19 -0
  21. data/lib/semgrep_web_app/http/auth/semgrep_admin_jwt.rb +53 -0
  22. data/lib/semgrep_web_app/http/auth/semgrep_jwt.rb +53 -0
  23. data/lib/semgrep_web_app/http/auth/semgrep_web_token.rb +53 -0
  24. data/lib/semgrep_web_app/http/http_call_back.rb +10 -0
  25. data/lib/semgrep_web_app/http/http_method_enum.rb +10 -0
  26. data/lib/semgrep_web_app/http/http_request.rb +10 -0
  27. data/lib/semgrep_web_app/http/http_response.rb +10 -0
  28. data/lib/semgrep_web_app/http/proxy_settings.rb +22 -0
  29. data/lib/semgrep_web_app/logging/configuration/api_logging_configuration.rb +186 -0
  30. data/lib/semgrep_web_app/logging/sdk_logger.rb +17 -0
  31. data/lib/semgrep_web_app/models/add_project_tags_request.rb +96 -0
  32. data/lib/semgrep_web_app/models/add_project_tags_response.rb +73 -0
  33. data/lib/semgrep_web_app/models/ai_powered_scan_finding.rb +426 -0
  34. data/lib/semgrep_web_app/models/ai_sast_findings.rb +85 -0
  35. data/lib/semgrep_web_app/models/api_v1_deployments_findings_response.rb +87 -0
  36. data/lib/semgrep_web_app/models/assistant.rb +127 -0
  37. data/lib/semgrep_web_app/models/autofix.rb +98 -0
  38. data/lib/semgrep_web_app/models/autotriage.rb +98 -0
  39. data/lib/semgrep_web_app/models/autotriage_verdict.rb +36 -0
  40. data/lib/semgrep_web_app/models/autotriage_verdict2.rb +38 -0
  41. data/lib/semgrep_web_app/models/base_model.rb +110 -0
  42. data/lib/semgrep_web_app/models/bulk_triage_request.rb +393 -0
  43. data/lib/semgrep_web_app/models/bulk_triage_response.rb +83 -0
  44. data/lib/semgrep_web_app/models/click_to_fix_failure.rb +95 -0
  45. data/lib/semgrep_web_app/models/click_to_fix_pr.rb +95 -0
  46. data/lib/semgrep_web_app/models/click_to_fix_pr_state.rb +38 -0
  47. data/lib/semgrep_web_app/models/component.rb +95 -0
  48. data/lib/semgrep_web_app/models/confidence.rb +42 -0
  49. data/lib/semgrep_web_app/models/confidence1.rb +40 -0
  50. data/lib/semgrep_web_app/models/confidence2.rb +40 -0
  51. data/lib/semgrep_web_app/models/confidence3.rb +40 -0
  52. data/lib/semgrep_web_app/models/confidence7.rb +41 -0
  53. data/lib/semgrep_web_app/models/confidence8.rb +42 -0
  54. data/lib/semgrep_web_app/models/create_sbom_export_request.rb +176 -0
  55. data/lib/semgrep_web_app/models/create_sbom_export_response.rb +74 -0
  56. data/lib/semgrep_web_app/models/create_ticket_request.rb +393 -0
  57. data/lib/semgrep_web_app/models/cyclonedx_version.rb +48 -0
  58. data/lib/semgrep_web_app/models/delete_project_response.rb +74 -0
  59. data/lib/semgrep_web_app/models/delete_project_tags_response.rb +73 -0
  60. data/lib/semgrep_web_app/models/deployment.rb +102 -0
  61. data/lib/semgrep_web_app/models/ecosystem.rb +91 -0
  62. data/lib/semgrep_web_app/models/ecosystem1.rb +92 -0
  63. data/lib/semgrep_web_app/models/ecosystem2.rb +76 -0
  64. data/lib/semgrep_web_app/models/endpoint_reference.rb +72 -0
  65. data/lib/semgrep_web_app/models/epss_probability.rb +45 -0
  66. data/lib/semgrep_web_app/models/epss_score.rb +95 -0
  67. data/lib/semgrep_web_app/models/exposures.rb +50 -0
  68. data/lib/semgrep_web_app/models/exposures2.rb +51 -0
  69. data/lib/semgrep_web_app/models/external_ticket.rb +116 -0
  70. data/lib/semgrep_web_app/models/finding_location.rb +126 -0
  71. data/lib/semgrep_web_app/models/finding_repository.rb +95 -0
  72. data/lib/semgrep_web_app/models/finding_rule.rb +158 -0
  73. data/lib/semgrep_web_app/models/fix_recommendation.rb +95 -0
  74. data/lib/semgrep_web_app/models/float_range.rb +85 -0
  75. data/lib/semgrep_web_app/models/format.rb +27 -0
  76. data/lib/semgrep_web_app/models/found_dependency.rb +128 -0
  77. data/lib/semgrep_web_app/models/get_project_response.rb +73 -0
  78. data/lib/semgrep_web_app/models/get_sbom_export_response.rb +100 -0
  79. data/lib/semgrep_web_app/models/guidance.rb +98 -0
  80. data/lib/semgrep_web_app/models/issue_type.rb +40 -0
  81. data/lib/semgrep_web_app/models/issue_type1.rb +40 -0
  82. data/lib/semgrep_web_app/models/issue_type2.rb +42 -0
  83. data/lib/semgrep_web_app/models/license_policy_settings.rb +42 -0
  84. data/lib/semgrep_web_app/models/link_ticket_request.rb +93 -0
  85. data/lib/semgrep_web_app/models/list_dependencies_request.rb +108 -0
  86. data/lib/semgrep_web_app/models/list_dependencies_response.rb +102 -0
  87. data/lib/semgrep_web_app/models/list_findings_response.rb +100 -0
  88. data/lib/semgrep_web_app/models/list_lockfiles_for_dependencies_request.rb +118 -0
  89. data/lib/semgrep_web_app/models/list_lockfiles_for_dependencies_response.rb +103 -0
  90. data/lib/semgrep_web_app/models/list_project.rb +145 -0
  91. data/lib/semgrep_web_app/models/list_projects_response.rb +82 -0
  92. data/lib/semgrep_web_app/models/list_repositories_for_dependencies_request.rb +107 -0
  93. data/lib/semgrep_web_app/models/list_repositories_for_dependencies_response.rb +103 -0
  94. data/lib/semgrep_web_app/models/managed_scan_config.rb +85 -0
  95. data/lib/semgrep_web_app/models/metadata_component_type.rb +101 -0
  96. data/lib/semgrep_web_app/models/mode.rb +48 -0
  97. data/lib/semgrep_web_app/models/new_triage_reason.rb +48 -0
  98. data/lib/semgrep_web_app/models/new_triage_state.rb +48 -0
  99. data/lib/semgrep_web_app/models/policy.rb +118 -0
  100. data/lib/semgrep_web_app/models/policy_mode.rb +48 -0
  101. data/lib/semgrep_web_app/models/policy_mode1.rb +40 -0
  102. data/lib/semgrep_web_app/models/policy_mode3.rb +51 -0
  103. data/lib/semgrep_web_app/models/policy_reference.rb +105 -0
  104. data/lib/semgrep_web_app/models/product_type.rb +38 -0
  105. data/lib/semgrep_web_app/models/products.rb +46 -0
  106. data/lib/semgrep_web_app/models/project.rb +157 -0
  107. data/lib/semgrep_web_app/models/protos_ai_v1_autotriage.rb +154 -0
  108. data/lib/semgrep_web_app/models/protos_ai_v1_autotriage_feedback.rb +98 -0
  109. data/lib/semgrep_web_app/models/protos_common_v1_review_comment.rb +90 -0
  110. data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response.rb +123 -0
  111. data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_failed.rb +85 -0
  112. data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_skipped.rb +85 -0
  113. data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_success.rb +106 -0
  114. data/lib/semgrep_web_app/models/protos_openapi_v1_delete_ticket_response.rb +76 -0
  115. data/lib/semgrep_web_app/models/protos_openapi_v1_diff_scan.rb +75 -0
  116. data/lib/semgrep_web_app/models/protos_openapi_v1_full_scan.rb +75 -0
  117. data/lib/semgrep_web_app/models/protos_openapi_v1_get_bootstrap_sms_vpc_response.rb +130 -0
  118. data/lib/semgrep_web_app/models/protos_openapi_v1_get_scan_response.rb +168 -0
  119. data/lib/semgrep_web_app/models/protos_openapi_v1_get_scan_response_scan_meta.rb +256 -0
  120. data/lib/semgrep_web_app/models/protos_openapi_v1_link_ticket_response.rb +119 -0
  121. data/lib/semgrep_web_app/models/protos_openapi_v1_list_deployments_response.rb +85 -0
  122. data/lib/semgrep_web_app/models/protos_openapi_v1_list_policies_response.rb +84 -0
  123. data/lib/semgrep_web_app/models/protos_openapi_v1_list_policy_rules_response.rb +104 -0
  124. data/lib/semgrep_web_app/models/protos_openapi_v1_list_secrets_path_response.rb +104 -0
  125. data/lib/semgrep_web_app/models/protos_openapi_v1_search_scans_response.rb +94 -0
  126. data/lib/semgrep_web_app/models/protos_openapi_v1_unlink_ticket_response.rb +77 -0
  127. data/lib/semgrep_web_app/models/protos_openapi_v1_update_policy_response.rb +88 -0
  128. data/lib/semgrep_web_app/models/protos_sca_v1_code_location.rb +144 -0
  129. data/lib/semgrep_web_app/models/protos_sca_v1_dependency.rb +87 -0
  130. data/lib/semgrep_web_app/models/protos_sca_v1_dependency_filter.rb +199 -0
  131. data/lib/semgrep_web_app/models/protos_sca_v1_found_dependency.rb +174 -0
  132. data/lib/semgrep_web_app/models/protos_sca_v1_lockfile_dependency_summary.rb +87 -0
  133. data/lib/semgrep_web_app/models/protos_sca_v1_package_filter.rb +124 -0
  134. data/lib/semgrep_web_app/models/protos_sca_v1_repository_dependency_summary.rb +111 -0
  135. data/lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb +109 -0
  136. data/lib/semgrep_web_app/models/protos_sca_v1_sbom_metadata_contact.rb +95 -0
  137. data/lib/semgrep_web_app/models/protos_sca_v1_sbom_metadata_supplier.rb +95 -0
  138. data/lib/semgrep_web_app/models/protos_scan_v1_scan_findings_counts.rb +105 -0
  139. data/lib/semgrep_web_app/models/protos_scan_v1_scan_public.rb +228 -0
  140. data/lib/semgrep_web_app/models/protos_secrets_v1_historical_info.rb +116 -0
  141. data/lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding.rb +320 -0
  142. data/lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb +121 -0
  143. data/lib/semgrep_web_app/models/protos_ticketing_v1_external_ticket.rb +106 -0
  144. data/lib/semgrep_web_app/models/rating.rb +38 -0
  145. data/lib/semgrep_web_app/models/reachability.rb +48 -0
  146. data/lib/semgrep_web_app/models/repository_visibility.rb +40 -0
  147. data/lib/semgrep_web_app/models/review_comment.rb +100 -0
  148. data/lib/semgrep_web_app/models/risk.rb +40 -0
  149. data/lib/semgrep_web_app/models/rule.rb +292 -0
  150. data/lib/semgrep_web_app/models/rule_explanation.rb +98 -0
  151. data/lib/semgrep_web_app/models/sast_finding.rb +426 -0
  152. data/lib/semgrep_web_app/models/sast_findings.rb +84 -0
  153. data/lib/semgrep_web_app/models/sbom_output_format.rb +37 -0
  154. data/lib/semgrep_web_app/models/sca_finding.rb +458 -0
  155. data/lib/semgrep_web_app/models/sca_findings.rb +85 -0
  156. data/lib/semgrep_web_app/models/scm_type.rb +70 -0
  157. data/lib/semgrep_web_app/models/search_scans_request.rb +202 -0
  158. data/lib/semgrep_web_app/models/severities.rb +44 -0
  159. data/lib/semgrep_web_app/models/severities2.rb +45 -0
  160. data/lib/semgrep_web_app/models/severity.rb +46 -0
  161. data/lib/semgrep_web_app/models/severity1.rb +45 -0
  162. data/lib/semgrep_web_app/models/severity4.rb +46 -0
  163. data/lib/semgrep_web_app/models/severity5.rb +48 -0
  164. data/lib/semgrep_web_app/models/source.rb +42 -0
  165. data/lib/semgrep_web_app/models/state.rb +42 -0
  166. data/lib/semgrep_web_app/models/status.rb +55 -0
  167. data/lib/semgrep_web_app/models/status1.rb +52 -0
  168. data/lib/semgrep_web_app/models/status3.rb +44 -0
  169. data/lib/semgrep_web_app/models/status6.rb +55 -0
  170. data/lib/semgrep_web_app/models/status7.rb +59 -0
  171. data/lib/semgrep_web_app/models/status8.rb +61 -0
  172. data/lib/semgrep_web_app/models/status9.rb +55 -0
  173. data/lib/semgrep_web_app/models/statuses.rb +63 -0
  174. data/lib/semgrep_web_app/models/toggle_project_managed_scan_request.rb +108 -0
  175. data/lib/semgrep_web_app/models/toggle_project_managed_scan_response.rb +73 -0
  176. data/lib/semgrep_web_app/models/transitivities.rb +40 -0
  177. data/lib/semgrep_web_app/models/transitivities2.rb +42 -0
  178. data/lib/semgrep_web_app/models/transitivity.rb +41 -0
  179. data/lib/semgrep_web_app/models/transitivity1.rb +42 -0
  180. data/lib/semgrep_web_app/models/transitivity2.rb +40 -0
  181. data/lib/semgrep_web_app/models/triage_reason.rb +48 -0
  182. data/lib/semgrep_web_app/models/triage_reasons.rb +48 -0
  183. data/lib/semgrep_web_app/models/triage_reasons2.rb +50 -0
  184. data/lib/semgrep_web_app/models/triage_state.rb +54 -0
  185. data/lib/semgrep_web_app/models/unlink_ticket_request.rb +83 -0
  186. data/lib/semgrep_web_app/models/update_policy_request.rb +113 -0
  187. data/lib/semgrep_web_app/models/update_project_request.rb +121 -0
  188. data/lib/semgrep_web_app/models/update_project_response.rb +73 -0
  189. data/lib/semgrep_web_app/models/usage.rb +99 -0
  190. data/lib/semgrep_web_app/models/validation_state.rb +45 -0
  191. data/lib/semgrep_web_app/models/validation_state2.rb +47 -0
  192. data/lib/semgrep_web_app/models/validation_state3.rb +48 -0
  193. data/lib/semgrep_web_app/models/verdict.rb +41 -0
  194. data/lib/semgrep_web_app/models/verdict1.rb +38 -0
  195. data/lib/semgrep_web_app/models/visibility.rb +42 -0
  196. data/lib/semgrep_web_app/utilities/date_time_helper.rb +11 -0
  197. data/lib/semgrep_web_app/utilities/file_wrapper.rb +28 -0
  198. data/lib/semgrep_web_app/utilities/union_type_lookup.rb +34 -0
  199. data/lib/semgrep_web_app.rb +245 -0
  200. metadata +283 -0
@@ -0,0 +1,116 @@
1
+ # semgrep_web_app
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module SemgrepWebApp
8
+ # ProtosSecretsV1HistoricalInfo Model.
9
+ class ProtosSecretsV1HistoricalInfo < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Git blob at which the finding is present. Sent in addition to the commit
14
+ # since some SCMs have permalinks which use the blob sha, so this
15
+ # information
16
+ # is useful when generating links back to the SCM.
17
+ # @return [String]
18
+ attr_accessor :git_blob
19
+
20
+ # Git commit at which the finding is present. Used by "historical" scans,
21
+ # which scan non-HEAD commits in the git history. Relevant for finding,
22
+ # e.g.,
23
+ # secrets which are buried in the git history which we wouldn't find at
24
+ # HEAD
25
+ # @return [String]
26
+ attr_accessor :git_commit
27
+
28
+ # Git commit at which the finding is present. Used by "historical" scans,
29
+ # which scan non-HEAD commits in the git history. Relevant for finding,
30
+ # e.g.,
31
+ # secrets which are buried in the git history which we wouldn't find at
32
+ # HEAD
33
+ # @return [DateTime]
34
+ attr_accessor :git_commit_timestamp
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['git_blob'] = 'gitBlob'
40
+ @_hash['git_commit'] = 'gitCommit'
41
+ @_hash['git_commit_timestamp'] = 'gitCommitTimestamp'
42
+ @_hash
43
+ end
44
+
45
+ # An array for optional fields
46
+ def self.optionals
47
+ %w[
48
+ git_blob
49
+ git_commit
50
+ git_commit_timestamp
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(git_blob: SKIP, git_commit: SKIP, git_commit_timestamp: SKIP,
60
+ additional_properties: nil)
61
+ # Add additional model properties to the instance
62
+ additional_properties = {} if additional_properties.nil?
63
+
64
+ @git_blob = git_blob unless git_blob == SKIP
65
+ @git_commit = git_commit unless git_commit == SKIP
66
+ @git_commit_timestamp = git_commit_timestamp unless git_commit_timestamp == SKIP
67
+ @additional_properties = additional_properties
68
+ end
69
+
70
+ # Creates an instance of the object from a hash.
71
+ def self.from_hash(hash)
72
+ return nil unless hash
73
+
74
+ # Extract variables from the hash.
75
+ git_blob = hash.key?('gitBlob') ? hash['gitBlob'] : SKIP
76
+ git_commit = hash.key?('gitCommit') ? hash['gitCommit'] : SKIP
77
+ git_commit_timestamp = if hash.key?('gitCommitTimestamp')
78
+ (DateTimeHelper.from_rfc3339(hash['gitCommitTimestamp']) if hash['gitCommitTimestamp'])
79
+ else
80
+ SKIP
81
+ end
82
+
83
+ # Create a new hash for additional properties, removing known properties.
84
+ new_hash = hash.reject { |k, _| names.value?(k) }
85
+
86
+ additional_properties = APIHelper.get_additional_properties(
87
+ new_hash, proc { |value| value }
88
+ )
89
+
90
+ # Create object from extracted values.
91
+ ProtosSecretsV1HistoricalInfo.new(git_blob: git_blob,
92
+ git_commit: git_commit,
93
+ git_commit_timestamp: git_commit_timestamp,
94
+ additional_properties: additional_properties)
95
+ end
96
+
97
+ def to_custom_git_commit_timestamp
98
+ DateTimeHelper.to_rfc3339(git_commit_timestamp)
99
+ end
100
+
101
+ # Provides a human-readable string representation of the object.
102
+ def to_s
103
+ class_name = self.class.name.split('::').last
104
+ "<#{class_name} git_blob: #{@git_blob}, git_commit: #{@git_commit}, git_commit_timestamp:"\
105
+ " #{@git_commit_timestamp}, additional_properties: #{@additional_properties}>"
106
+ end
107
+
108
+ # Provides a debugging-friendly string with detailed object information.
109
+ def inspect
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} git_blob: #{@git_blob.inspect}, git_commit: #{@git_commit.inspect},"\
112
+ " git_commit_timestamp: #{@git_commit_timestamp.inspect}, additional_properties:"\
113
+ " #{@additional_properties}>"
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,320 @@
1
+ # semgrep_web_app
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module SemgrepWebApp
8
+ # A Finding represents a single secret finding.
9
+ class ProtosSecretsV1SecretsFinding < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # * Autotriage info for the finding.
14
+ # This is used for the Generic Secrets Detection project, for
15
+ # autotriaging secrets findings with LLMs
16
+ # @return [ProtosAiV1Autotriage]
17
+ attr_accessor :autotriage
18
+
19
+ # Confidence of the finding.
20
+ # | value | description |
21
+ # |-------|---------------|
22
+ # | CONFIDENCE_HIGH | |
23
+ # | CONFIDENCE_MEDIUM | |
24
+ # | CONFIDENCE_LOW | |
25
+ # @return [Confidence7]
26
+ attr_accessor :confidence
27
+
28
+ # Creation timestamp.
29
+ # @return [DateTime]
30
+ attr_accessor :created_at
31
+
32
+ # The external ticket reference
33
+ # @return [ProtosTicketingV1ExternalTicket]
34
+ attr_accessor :external_ticket
35
+
36
+ # File path where the finding was detected.
37
+ # @return [String]
38
+ attr_accessor :finding_path
39
+
40
+ # URL to the file where the finding was detected.
41
+ # @return [String]
42
+ attr_accessor :finding_path_url
43
+
44
+ # Historical scanning info for the finding.
45
+ # @return [ProtosSecretsV1HistoricalInfo]
46
+ attr_accessor :historical_info
47
+
48
+ # ID of the finding.
49
+ # @return [String]
50
+ attr_accessor :id
51
+
52
+ # The behavior of the finding reporting: Monitor / Comment / Block.
53
+ # | value | description |
54
+ # |-------|---------------|
55
+ # | MODE_MONITOR | Monitor mode, silently report findings |
56
+ # | MODE_COMMENT | Comment mode, leaves PR comments but does not block |
57
+ # | MODE_BLOCK | Block mode, leaves PR comments and blocks PR |
58
+ # | MODE_DISABLED | Disabled mode, not active |
59
+ # @return [Mode]
60
+ attr_accessor :mode
61
+
62
+ # Branch where the finding was detected.
63
+ # @return [String]
64
+ attr_accessor :ref
65
+
66
+ # URL to the branch where the finding was detected.
67
+ # @return [String]
68
+ attr_accessor :ref_url
69
+
70
+ # Repository where the finding was detected.
71
+ # @return [ProtosSecretsV1SecretsFindingRepository]
72
+ attr_accessor :repository
73
+
74
+ # List of external review comment information associated with a finding
75
+ # @return [Array[ProtosCommonV1ReviewComment]]
76
+ attr_accessor :review_comments
77
+
78
+ # ID of the rule that triggered the finding.
79
+ # @return [String]
80
+ attr_accessor :rule_hash_id
81
+
82
+ # Severity of the finding.
83
+ # | value | description |
84
+ # |-------|---------------|
85
+ # | SEVERITY_HIGH | |
86
+ # | SEVERITY_MEDIUM | |
87
+ # | SEVERITY_LOW | |
88
+ # | SEVERITY_CRITICAL | |
89
+ # @return [Severity4]
90
+ attr_accessor :severity
91
+
92
+ # Status of the finding.
93
+ # | value | description |
94
+ # |-------|---------------|
95
+ # | FINDING_STATUS_OPEN | |
96
+ # | FINDING_STATUS_IGNORED | |
97
+ # | FINDING_STATUS_FIXED | |
98
+ # | FINDING_STATUS_REMOVED | |
99
+ # | FINDING_STATUS_UNKNOWN | |
100
+ # | FINDING_STATUS_PROVISIONALLY_IGNORED | |
101
+ # @return [Status6]
102
+ attr_accessor :status
103
+
104
+ # Service type for the secrets finding (e.g. AWS, GitHub, GitLab, etc).
105
+ # @return [String]
106
+ attr_accessor :type
107
+
108
+ # Update timestamp.
109
+ # @return [DateTime]
110
+ attr_accessor :updated_at
111
+
112
+ # Whether the finding was validated or not.
113
+ # | value | description |
114
+ # |-------|---------------|
115
+ # | VALIDATION_STATE_CONFIRMED_VALID | |
116
+ # | VALIDATION_STATE_CONFIRMED_INVALID | |
117
+ # | VALIDATION_STATE_VALIDATION_ERROR | |
118
+ # | VALIDATION_STATE_NO_VALIDATOR | |
119
+ # @return [ValidationState2]
120
+ attr_accessor :validation_state
121
+
122
+ # A mapping from model property names to API property names.
123
+ def self.names
124
+ @_hash = {} if @_hash.nil?
125
+ @_hash['autotriage'] = 'autotriage'
126
+ @_hash['confidence'] = 'confidence'
127
+ @_hash['created_at'] = 'createdAt'
128
+ @_hash['external_ticket'] = 'externalTicket'
129
+ @_hash['finding_path'] = 'findingPath'
130
+ @_hash['finding_path_url'] = 'findingPathUrl'
131
+ @_hash['historical_info'] = 'historicalInfo'
132
+ @_hash['id'] = 'id'
133
+ @_hash['mode'] = 'mode'
134
+ @_hash['ref'] = 'ref'
135
+ @_hash['ref_url'] = 'refUrl'
136
+ @_hash['repository'] = 'repository'
137
+ @_hash['review_comments'] = 'reviewComments'
138
+ @_hash['rule_hash_id'] = 'ruleHashId'
139
+ @_hash['severity'] = 'severity'
140
+ @_hash['status'] = 'status'
141
+ @_hash['type'] = 'type'
142
+ @_hash['updated_at'] = 'updatedAt'
143
+ @_hash['validation_state'] = 'validationState'
144
+ @_hash
145
+ end
146
+
147
+ # An array for optional fields
148
+ def self.optionals
149
+ %w[
150
+ autotriage
151
+ confidence
152
+ created_at
153
+ external_ticket
154
+ finding_path
155
+ finding_path_url
156
+ historical_info
157
+ id
158
+ mode
159
+ ref
160
+ ref_url
161
+ repository
162
+ review_comments
163
+ rule_hash_id
164
+ severity
165
+ status
166
+ type
167
+ updated_at
168
+ validation_state
169
+ ]
170
+ end
171
+
172
+ # An array for nullable fields
173
+ def self.nullables
174
+ []
175
+ end
176
+
177
+ def initialize(autotriage: SKIP, confidence: SKIP, created_at: SKIP,
178
+ external_ticket: SKIP, finding_path: SKIP,
179
+ finding_path_url: SKIP, historical_info: SKIP, id: SKIP,
180
+ mode: SKIP, ref: SKIP, ref_url: SKIP, repository: SKIP,
181
+ review_comments: SKIP, rule_hash_id: SKIP, severity: SKIP,
182
+ status: SKIP, type: SKIP, updated_at: SKIP,
183
+ validation_state: SKIP, additional_properties: nil)
184
+ # Add additional model properties to the instance
185
+ additional_properties = {} if additional_properties.nil?
186
+
187
+ @autotriage = autotriage unless autotriage == SKIP
188
+ @confidence = confidence unless confidence == SKIP
189
+ @created_at = created_at unless created_at == SKIP
190
+ @external_ticket = external_ticket unless external_ticket == SKIP
191
+ @finding_path = finding_path unless finding_path == SKIP
192
+ @finding_path_url = finding_path_url unless finding_path_url == SKIP
193
+ @historical_info = historical_info unless historical_info == SKIP
194
+ @id = id unless id == SKIP
195
+ @mode = mode unless mode == SKIP
196
+ @ref = ref unless ref == SKIP
197
+ @ref_url = ref_url unless ref_url == SKIP
198
+ @repository = repository unless repository == SKIP
199
+ @review_comments = review_comments unless review_comments == SKIP
200
+ @rule_hash_id = rule_hash_id unless rule_hash_id == SKIP
201
+ @severity = severity unless severity == SKIP
202
+ @status = status unless status == SKIP
203
+ @type = type unless type == SKIP
204
+ @updated_at = updated_at unless updated_at == SKIP
205
+ @validation_state = validation_state unless validation_state == SKIP
206
+ @additional_properties = additional_properties
207
+ end
208
+
209
+ # Creates an instance of the object from a hash.
210
+ def self.from_hash(hash)
211
+ return nil unless hash
212
+
213
+ # Extract variables from the hash.
214
+ autotriage = ProtosAiV1Autotriage.from_hash(hash['autotriage']) if hash['autotriage']
215
+ confidence = hash.key?('confidence') ? hash['confidence'] : SKIP
216
+ created_at = if hash.key?('createdAt')
217
+ (DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt'])
218
+ else
219
+ SKIP
220
+ end
221
+ external_ticket = ProtosTicketingV1ExternalTicket.from_hash(hash['externalTicket']) if
222
+ hash['externalTicket']
223
+ finding_path = hash.key?('findingPath') ? hash['findingPath'] : SKIP
224
+ finding_path_url =
225
+ hash.key?('findingPathUrl') ? hash['findingPathUrl'] : SKIP
226
+ historical_info = ProtosSecretsV1HistoricalInfo.from_hash(hash['historicalInfo']) if
227
+ hash['historicalInfo']
228
+ id = hash.key?('id') ? hash['id'] : SKIP
229
+ mode = hash.key?('mode') ? hash['mode'] : SKIP
230
+ ref = hash.key?('ref') ? hash['ref'] : SKIP
231
+ ref_url = hash.key?('refUrl') ? hash['refUrl'] : SKIP
232
+ repository = ProtosSecretsV1SecretsFindingRepository.from_hash(hash['repository']) if
233
+ hash['repository']
234
+ # Parameter is an array, so we need to iterate through it
235
+ review_comments = nil
236
+ unless hash['reviewComments'].nil?
237
+ review_comments = []
238
+ hash['reviewComments'].each do |structure|
239
+ review_comments << (ProtosCommonV1ReviewComment.from_hash(structure) if structure)
240
+ end
241
+ end
242
+
243
+ review_comments = SKIP unless hash.key?('reviewComments')
244
+ rule_hash_id = hash.key?('ruleHashId') ? hash['ruleHashId'] : SKIP
245
+ severity = hash.key?('severity') ? hash['severity'] : SKIP
246
+ status = hash.key?('status') ? hash['status'] : SKIP
247
+ type = hash.key?('type') ? hash['type'] : SKIP
248
+ updated_at = if hash.key?('updatedAt')
249
+ (DateTimeHelper.from_rfc3339(hash['updatedAt']) if hash['updatedAt'])
250
+ else
251
+ SKIP
252
+ end
253
+ validation_state =
254
+ hash.key?('validationState') ? hash['validationState'] : SKIP
255
+
256
+ # Create a new hash for additional properties, removing known properties.
257
+ new_hash = hash.reject { |k, _| names.value?(k) }
258
+
259
+ additional_properties = APIHelper.get_additional_properties(
260
+ new_hash, proc { |value| value }
261
+ )
262
+
263
+ # Create object from extracted values.
264
+ ProtosSecretsV1SecretsFinding.new(autotriage: autotriage,
265
+ confidence: confidence,
266
+ created_at: created_at,
267
+ external_ticket: external_ticket,
268
+ finding_path: finding_path,
269
+ finding_path_url: finding_path_url,
270
+ historical_info: historical_info,
271
+ id: id,
272
+ mode: mode,
273
+ ref: ref,
274
+ ref_url: ref_url,
275
+ repository: repository,
276
+ review_comments: review_comments,
277
+ rule_hash_id: rule_hash_id,
278
+ severity: severity,
279
+ status: status,
280
+ type: type,
281
+ updated_at: updated_at,
282
+ validation_state: validation_state,
283
+ additional_properties: additional_properties)
284
+ end
285
+
286
+ def to_custom_created_at
287
+ DateTimeHelper.to_rfc3339(created_at)
288
+ end
289
+
290
+ def to_custom_updated_at
291
+ DateTimeHelper.to_rfc3339(updated_at)
292
+ end
293
+
294
+ # Provides a human-readable string representation of the object.
295
+ def to_s
296
+ class_name = self.class.name.split('::').last
297
+ "<#{class_name} autotriage: #{@autotriage}, confidence: #{@confidence}, created_at:"\
298
+ " #{@created_at}, external_ticket: #{@external_ticket}, finding_path: #{@finding_path},"\
299
+ " finding_path_url: #{@finding_path_url}, historical_info: #{@historical_info}, id: #{@id},"\
300
+ " mode: #{@mode}, ref: #{@ref}, ref_url: #{@ref_url}, repository: #{@repository},"\
301
+ " review_comments: #{@review_comments}, rule_hash_id: #{@rule_hash_id}, severity:"\
302
+ " #{@severity}, status: #{@status}, type: #{@type}, updated_at: #{@updated_at},"\
303
+ " validation_state: #{@validation_state}, additional_properties: #{@additional_properties}>"
304
+ end
305
+
306
+ # Provides a debugging-friendly string with detailed object information.
307
+ def inspect
308
+ class_name = self.class.name.split('::').last
309
+ "<#{class_name} autotriage: #{@autotriage.inspect}, confidence: #{@confidence.inspect},"\
310
+ " created_at: #{@created_at.inspect}, external_ticket: #{@external_ticket.inspect},"\
311
+ " finding_path: #{@finding_path.inspect}, finding_path_url: #{@finding_path_url.inspect},"\
312
+ " historical_info: #{@historical_info.inspect}, id: #{@id.inspect}, mode: #{@mode.inspect},"\
313
+ " ref: #{@ref.inspect}, ref_url: #{@ref_url.inspect}, repository: #{@repository.inspect},"\
314
+ " review_comments: #{@review_comments.inspect}, rule_hash_id: #{@rule_hash_id.inspect},"\
315
+ " severity: #{@severity.inspect}, status: #{@status.inspect}, type: #{@type.inspect},"\
316
+ " updated_at: #{@updated_at.inspect}, validation_state: #{@validation_state.inspect},"\
317
+ " additional_properties: #{@additional_properties}>"
318
+ end
319
+ end
320
+ end
@@ -0,0 +1,121 @@
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
+ # Repository where the finding was detected.
8
+ class ProtosSecretsV1SecretsFindingRepository < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Repository name
13
+ # @return [String]
14
+ attr_accessor :name
15
+
16
+ # Provider for the finding (e.g. GitHub, GitLab, GHE, etc).
17
+ # | value | description |
18
+ # |-------|---------------|
19
+ # | SCM_TYPE_GITHUB | GitHub Cloud |
20
+ # | SCM_TYPE_GITHUB_ENTERPRISE | GitHub Enterprise |
21
+ # | SCM_TYPE_GITLAB | GitLab Cloud |
22
+ # | SCM_TYPE_GITLAB_SELFMANAGED | GitLab Self-Managed |
23
+ # | SCM_TYPE_BITBUCKET | Bitbucket Cloud |
24
+ # | SCM_TYPE_BITBUCKET_DATACENTER | Bitbucket Data Center |
25
+ # | SCM_TYPE_AZURE_DEVOPS | Azure DevOps |
26
+ # | SCM_TYPE_UNKNOWN | |
27
+ # | SCM_TYPE_HARNESS | Harness |
28
+ # @return [ScmType]
29
+ attr_accessor :scm_type
30
+
31
+ # URL to the repository where the finding was detected.
32
+ # @return [String]
33
+ attr_accessor :url
34
+
35
+ # Repository visbility (e.g. public, private, unknown).
36
+ # | value | description |
37
+ # |-------|---------------|
38
+ # | REPOSITORY_VISIBILITY_PUBLIC | |
39
+ # | REPOSITORY_VISIBILITY_PRIVATE | |
40
+ # | REPOSITORY_VISIBILITY_UNKNOWN | |
41
+ # @return [Visibility]
42
+ attr_accessor :visibility
43
+
44
+ # A mapping from model property names to API property names.
45
+ def self.names
46
+ @_hash = {} if @_hash.nil?
47
+ @_hash['name'] = 'name'
48
+ @_hash['scm_type'] = 'scmType'
49
+ @_hash['url'] = 'url'
50
+ @_hash['visibility'] = 'visibility'
51
+ @_hash
52
+ end
53
+
54
+ # An array for optional fields
55
+ def self.optionals
56
+ %w[
57
+ name
58
+ scm_type
59
+ url
60
+ visibility
61
+ ]
62
+ end
63
+
64
+ # An array for nullable fields
65
+ def self.nullables
66
+ []
67
+ end
68
+
69
+ def initialize(name: SKIP, scm_type: SKIP, url: SKIP, visibility: SKIP,
70
+ additional_properties: nil)
71
+ # Add additional model properties to the instance
72
+ additional_properties = {} if additional_properties.nil?
73
+
74
+ @name = name unless name == SKIP
75
+ @scm_type = scm_type unless scm_type == SKIP
76
+ @url = url unless url == SKIP
77
+ @visibility = visibility unless visibility == SKIP
78
+ @additional_properties = additional_properties
79
+ end
80
+
81
+ # Creates an instance of the object from a hash.
82
+ def self.from_hash(hash)
83
+ return nil unless hash
84
+
85
+ # Extract variables from the hash.
86
+ name = hash.key?('name') ? hash['name'] : SKIP
87
+ scm_type = hash.key?('scmType') ? hash['scmType'] : SKIP
88
+ url = hash.key?('url') ? hash['url'] : SKIP
89
+ visibility = hash.key?('visibility') ? hash['visibility'] : SKIP
90
+
91
+ # Create a new hash for additional properties, removing known properties.
92
+ new_hash = hash.reject { |k, _| names.value?(k) }
93
+
94
+ additional_properties = APIHelper.get_additional_properties(
95
+ new_hash, proc { |value| value }
96
+ )
97
+
98
+ # Create object from extracted values.
99
+ ProtosSecretsV1SecretsFindingRepository.new(name: name,
100
+ scm_type: scm_type,
101
+ url: url,
102
+ visibility: visibility,
103
+ additional_properties: additional_properties)
104
+ end
105
+
106
+ # Provides a human-readable string representation of the object.
107
+ def to_s
108
+ class_name = self.class.name.split('::').last
109
+ "<#{class_name} name: #{@name}, scm_type: #{@scm_type}, url: #{@url}, visibility:"\
110
+ " #{@visibility}, additional_properties: #{@additional_properties}>"
111
+ end
112
+
113
+ # Provides a debugging-friendly string with detailed object information.
114
+ def inspect
115
+ class_name = self.class.name.split('::').last
116
+ "<#{class_name} name: #{@name.inspect}, scm_type: #{@scm_type.inspect}, url:"\
117
+ " #{@url.inspect}, visibility: #{@visibility.inspect}, additional_properties:"\
118
+ " #{@additional_properties}>"
119
+ end
120
+ end
121
+ end
@@ -0,0 +1,106 @@
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
+ # ProtosTicketingV1ExternalTicket Model.
8
+ class ProtosTicketingV1ExternalTicket < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Identifier of the external ticket (e.g. for Jira, something like OPS-158).
13
+ # @return [String]
14
+ attr_accessor :external_slug
15
+
16
+ # Nango ticket id
17
+ # @return [String]
18
+ attr_accessor :id
19
+
20
+ # Semgrep issue ids that are linked to this external ticket
21
+ # @return [Array[String]]
22
+ attr_accessor :linked_issue_ids
23
+
24
+ # URL of the external ticket.
25
+ # @return [String]
26
+ attr_accessor :url
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['external_slug'] = 'externalSlug'
32
+ @_hash['id'] = 'id'
33
+ @_hash['linked_issue_ids'] = 'linkedIssueIds'
34
+ @_hash['url'] = 'url'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ external_slug
42
+ id
43
+ linked_issue_ids
44
+ url
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(external_slug: SKIP, id: SKIP, linked_issue_ids: SKIP,
54
+ url: SKIP, additional_properties: nil)
55
+ # Add additional model properties to the instance
56
+ additional_properties = {} if additional_properties.nil?
57
+
58
+ @external_slug = external_slug unless external_slug == SKIP
59
+ @id = id unless id == SKIP
60
+ @linked_issue_ids = linked_issue_ids unless linked_issue_ids == SKIP
61
+ @url = url unless url == 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
+ external_slug = hash.key?('externalSlug') ? hash['externalSlug'] : SKIP
71
+ id = hash.key?('id') ? hash['id'] : SKIP
72
+ linked_issue_ids =
73
+ hash.key?('linkedIssueIds') ? hash['linkedIssueIds'] : SKIP
74
+ url = hash.key?('url') ? hash['url'] : SKIP
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
+ ProtosTicketingV1ExternalTicket.new(external_slug: external_slug,
85
+ id: id,
86
+ linked_issue_ids: linked_issue_ids,
87
+ url: url,
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} external_slug: #{@external_slug}, id: #{@id}, linked_issue_ids:"\
95
+ " #{@linked_issue_ids}, url: #{@url}, additional_properties: #{@additional_properties}>"
96
+ end
97
+
98
+ # Provides a debugging-friendly string with detailed object information.
99
+ def inspect
100
+ class_name = self.class.name.split('::').last
101
+ "<#{class_name} external_slug: #{@external_slug.inspect}, id: #{@id.inspect},"\
102
+ " linked_issue_ids: #{@linked_issue_ids.inspect}, url: #{@url.inspect},"\
103
+ " additional_properties: #{@additional_properties}>"
104
+ end
105
+ end
106
+ end