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,426 @@
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
+ # A Code finding that Semgrep has identified in your organization
8
+ class SastFinding < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Semgrep Assistant data. Only present if Assistant is enabled
13
+ # @return [Assistant]
14
+ attr_accessor :assistant
15
+
16
+ # The categories of the finding as classified by the associated rule
17
+ # metadata
18
+ # @return [Array[String]]
19
+ attr_accessor :categories
20
+
21
+ # Failed PR creation attempts by Semgrep's autofix feature (Click to Fix)
22
+ # for this finding
23
+ # @return [Array[ClickToFixFailure]]
24
+ attr_accessor :click_to_fix_failures
25
+
26
+ # Pull requests created by Semgrep's autofix feature (Click to Fix) for this
27
+ # finding
28
+ # @return [Array[ClickToFixPr]]
29
+ attr_accessor :click_to_fix_prs
30
+
31
+ # Confidence of the finding, derived from the rule that triggered it
32
+ # @return [Confidence1]
33
+ attr_accessor :confidence
34
+
35
+ # The timestamp when this finding was created
36
+ # @return [String]
37
+ attr_accessor :created_at
38
+
39
+ # External ticket associated with finding
40
+ # @return [ExternalTicket]
41
+ attr_accessor :external_ticket
42
+
43
+ # Unique ID of the Semgrep scan that first identified this finding
44
+ # @return [Integer]
45
+ attr_accessor :first_seen_scan_id
46
+
47
+ # Unique ID of this finding
48
+ # @return [Integer]
49
+ attr_accessor :id
50
+
51
+ # The source URL including file and line number
52
+ # @return [String]
53
+ attr_accessor :line_of_code_url
54
+
55
+ # Location of the record in a file, as reported by Semgrep. If null, then
56
+ # the information does not exist or lacks integrity (older or broken scans)
57
+ # @return [FindingLocation]
58
+ attr_accessor :location
59
+
60
+ # ID calculated based on a finding's file path, rule identifier and pattern,
61
+ # and index
62
+ # @return [String]
63
+ attr_accessor :match_based_id
64
+
65
+ # External reference to the source of this finding (e.g. PR)
66
+ # @return [String]
67
+ attr_accessor :ref
68
+
69
+ # The timestamp when this finding was detected by Semgrep (the first time,
70
+ # or when reintroduced)
71
+ # @return [String]
72
+ attr_accessor :relevant_since
73
+
74
+ # Which repository this finding was identified in
75
+ # @return [FindingRepository]
76
+ attr_accessor :repository
77
+
78
+ # List of external review comment information associated with a finding
79
+ # @return [Array[ReviewComment]]
80
+ attr_accessor :review_comments
81
+
82
+ # Rule that applies to this finding
83
+ # @return [FindingRule]
84
+ attr_accessor :rule
85
+
86
+ # Deprecated in favor of rule.message. Rule message at the time of finding
87
+ # identification. Older findings may not have a value for this field
88
+ # @return [String]
89
+ attr_accessor :rule_message
90
+
91
+ # Deprecated in favor of rule.name
92
+ # @return [String]
93
+ attr_accessor :rule_name
94
+
95
+ # Severity of the finding, derived from the rule that triggered it. Low is
96
+ # equivalent to INFO, Medium to WARNING, and High to ERROR
97
+ # @return [Severity1]
98
+ attr_accessor :severity
99
+
100
+ # Reference to a policy, with some basic information. If null, then the
101
+ # information does not exist or lacks integrity (older or broken scans)
102
+ # @return [PolicyReference]
103
+ attr_accessor :sourcing_policy
104
+
105
+ # The finding's resolution state. Managed only by changes detected at scan
106
+ # time, the `state` is combined with `triage_state` to ultimately determine
107
+ # a final `status` which is exposed in the UI and API
108
+ # @return [State]
109
+ attr_accessor :state
110
+
111
+ # When this issue's `state` (resolution state) was last updated, as distinct
112
+ # from when the issue was triaged (`triaged_at`)
113
+ # @return [String]
114
+ attr_accessor :state_updated_at
115
+
116
+ # The finding's status as exposed in the UI. Status is a derived property
117
+ # combining information from the finding `state` and `triage_state`. The
118
+ # `triage_state` can be used to override the scan state if the finding is
119
+ # still detected
120
+ # @return [Status]
121
+ attr_accessor :status
122
+
123
+ # ID calculated based on a finding's file path, rule identifier and matched
124
+ # code, and index. Prefer `match_based_id`
125
+ # @return [String]
126
+ attr_accessor :syntactic_id
127
+
128
+ # The detailed comment provided during triage
129
+ # @return [String]
130
+ attr_accessor :triage_comment
131
+
132
+ # Reason provided when this issue was triaged
133
+ # @return [TriageReason]
134
+ attr_accessor :triage_reason
135
+
136
+ # The finding's triage state. Note: "reviewing" and "fixing" are only in
137
+ # private beta. Set by the user and used along with state to generate the
138
+ # final "status" viewable in the UI
139
+ # @return [TriageState]
140
+ attr_accessor :triage_state
141
+
142
+ # When the finding was triaged
143
+ # @return [String]
144
+ attr_accessor :triaged_at
145
+
146
+ # A mapping from model property names to API property names.
147
+ def self.names
148
+ @_hash = {} if @_hash.nil?
149
+ @_hash['assistant'] = 'assistant'
150
+ @_hash['categories'] = 'categories'
151
+ @_hash['click_to_fix_failures'] = 'click_to_fix_failures'
152
+ @_hash['click_to_fix_prs'] = 'click_to_fix_prs'
153
+ @_hash['confidence'] = 'confidence'
154
+ @_hash['created_at'] = 'created_at'
155
+ @_hash['external_ticket'] = 'external_ticket'
156
+ @_hash['first_seen_scan_id'] = 'first_seen_scan_id'
157
+ @_hash['id'] = 'id'
158
+ @_hash['line_of_code_url'] = 'line_of_code_url'
159
+ @_hash['location'] = 'location'
160
+ @_hash['match_based_id'] = 'match_based_id'
161
+ @_hash['ref'] = 'ref'
162
+ @_hash['relevant_since'] = 'relevant_since'
163
+ @_hash['repository'] = 'repository'
164
+ @_hash['review_comments'] = 'review_comments'
165
+ @_hash['rule'] = 'rule'
166
+ @_hash['rule_message'] = 'rule_message'
167
+ @_hash['rule_name'] = 'rule_name'
168
+ @_hash['severity'] = 'severity'
169
+ @_hash['sourcing_policy'] = 'sourcing_policy'
170
+ @_hash['state'] = 'state'
171
+ @_hash['state_updated_at'] = 'state_updated_at'
172
+ @_hash['status'] = 'status'
173
+ @_hash['syntactic_id'] = 'syntactic_id'
174
+ @_hash['triage_comment'] = 'triage_comment'
175
+ @_hash['triage_reason'] = 'triage_reason'
176
+ @_hash['triage_state'] = 'triage_state'
177
+ @_hash['triaged_at'] = 'triaged_at'
178
+ @_hash
179
+ end
180
+
181
+ # An array for optional fields
182
+ def self.optionals
183
+ %w[
184
+ assistant
185
+ categories
186
+ click_to_fix_failures
187
+ click_to_fix_prs
188
+ confidence
189
+ created_at
190
+ external_ticket
191
+ first_seen_scan_id
192
+ id
193
+ line_of_code_url
194
+ location
195
+ match_based_id
196
+ ref
197
+ relevant_since
198
+ repository
199
+ review_comments
200
+ rule
201
+ rule_message
202
+ rule_name
203
+ severity
204
+ sourcing_policy
205
+ state
206
+ state_updated_at
207
+ status
208
+ syntactic_id
209
+ triage_comment
210
+ triage_reason
211
+ triage_state
212
+ triaged_at
213
+ ]
214
+ end
215
+
216
+ # An array for nullable fields
217
+ def self.nullables
218
+ []
219
+ end
220
+
221
+ def initialize(assistant: SKIP, categories: SKIP,
222
+ click_to_fix_failures: SKIP, click_to_fix_prs: SKIP,
223
+ confidence: SKIP, created_at: SKIP, external_ticket: SKIP,
224
+ first_seen_scan_id: SKIP, id: SKIP, line_of_code_url: SKIP,
225
+ location: SKIP, match_based_id: SKIP, ref: SKIP,
226
+ relevant_since: SKIP, repository: SKIP,
227
+ review_comments: SKIP, rule: SKIP, rule_message: SKIP,
228
+ rule_name: SKIP, severity: SKIP, sourcing_policy: SKIP,
229
+ state: SKIP, state_updated_at: SKIP, status: SKIP,
230
+ syntactic_id: SKIP, triage_comment: SKIP,
231
+ triage_reason: SKIP, triage_state: SKIP, triaged_at: SKIP,
232
+ additional_properties: nil)
233
+ # Add additional model properties to the instance
234
+ additional_properties = {} if additional_properties.nil?
235
+
236
+ @assistant = assistant unless assistant == SKIP
237
+ @categories = categories unless categories == SKIP
238
+ @click_to_fix_failures = click_to_fix_failures unless click_to_fix_failures == SKIP
239
+ @click_to_fix_prs = click_to_fix_prs unless click_to_fix_prs == SKIP
240
+ @confidence = confidence unless confidence == SKIP
241
+ @created_at = created_at unless created_at == SKIP
242
+ @external_ticket = external_ticket unless external_ticket == SKIP
243
+ @first_seen_scan_id = first_seen_scan_id unless first_seen_scan_id == SKIP
244
+ @id = id unless id == SKIP
245
+ @line_of_code_url = line_of_code_url unless line_of_code_url == SKIP
246
+ @location = location unless location == SKIP
247
+ @match_based_id = match_based_id unless match_based_id == SKIP
248
+ @ref = ref unless ref == SKIP
249
+ @relevant_since = relevant_since unless relevant_since == SKIP
250
+ @repository = repository unless repository == SKIP
251
+ @review_comments = review_comments unless review_comments == SKIP
252
+ @rule = rule unless rule == SKIP
253
+ @rule_message = rule_message unless rule_message == SKIP
254
+ @rule_name = rule_name unless rule_name == SKIP
255
+ @severity = severity unless severity == SKIP
256
+ @sourcing_policy = sourcing_policy unless sourcing_policy == SKIP
257
+ @state = state unless state == SKIP
258
+ @state_updated_at = state_updated_at unless state_updated_at == SKIP
259
+ @status = status unless status == SKIP
260
+ @syntactic_id = syntactic_id unless syntactic_id == SKIP
261
+ @triage_comment = triage_comment unless triage_comment == SKIP
262
+ @triage_reason = triage_reason unless triage_reason == SKIP
263
+ @triage_state = triage_state unless triage_state == SKIP
264
+ @triaged_at = triaged_at unless triaged_at == SKIP
265
+ @additional_properties = additional_properties
266
+ end
267
+
268
+ # Creates an instance of the object from a hash.
269
+ def self.from_hash(hash)
270
+ return nil unless hash
271
+
272
+ # Extract variables from the hash.
273
+ assistant = Assistant.from_hash(hash['assistant']) if hash['assistant']
274
+ categories = hash.key?('categories') ? hash['categories'] : SKIP
275
+ # Parameter is an array, so we need to iterate through it
276
+ click_to_fix_failures = nil
277
+ unless hash['click_to_fix_failures'].nil?
278
+ click_to_fix_failures = []
279
+ hash['click_to_fix_failures'].each do |structure|
280
+ click_to_fix_failures << (ClickToFixFailure.from_hash(structure) if structure)
281
+ end
282
+ end
283
+
284
+ click_to_fix_failures = SKIP unless hash.key?('click_to_fix_failures')
285
+ # Parameter is an array, so we need to iterate through it
286
+ click_to_fix_prs = nil
287
+ unless hash['click_to_fix_prs'].nil?
288
+ click_to_fix_prs = []
289
+ hash['click_to_fix_prs'].each do |structure|
290
+ click_to_fix_prs << (ClickToFixPr.from_hash(structure) if structure)
291
+ end
292
+ end
293
+
294
+ click_to_fix_prs = SKIP unless hash.key?('click_to_fix_prs')
295
+ confidence = hash.key?('confidence') ? hash['confidence'] : SKIP
296
+ created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
297
+ external_ticket = ExternalTicket.from_hash(hash['external_ticket']) if
298
+ hash['external_ticket']
299
+ first_seen_scan_id =
300
+ hash.key?('first_seen_scan_id') ? hash['first_seen_scan_id'] : SKIP
301
+ id = hash.key?('id') ? hash['id'] : SKIP
302
+ line_of_code_url =
303
+ hash.key?('line_of_code_url') ? hash['line_of_code_url'] : SKIP
304
+ location = FindingLocation.from_hash(hash['location']) if hash['location']
305
+ match_based_id =
306
+ hash.key?('match_based_id') ? hash['match_based_id'] : SKIP
307
+ ref = hash.key?('ref') ? hash['ref'] : SKIP
308
+ relevant_since =
309
+ hash.key?('relevant_since') ? hash['relevant_since'] : SKIP
310
+ repository = FindingRepository.from_hash(hash['repository']) if hash['repository']
311
+ # Parameter is an array, so we need to iterate through it
312
+ review_comments = nil
313
+ unless hash['review_comments'].nil?
314
+ review_comments = []
315
+ hash['review_comments'].each do |structure|
316
+ review_comments << (ReviewComment.from_hash(structure) if structure)
317
+ end
318
+ end
319
+
320
+ review_comments = SKIP unless hash.key?('review_comments')
321
+ rule = FindingRule.from_hash(hash['rule']) if hash['rule']
322
+ rule_message = hash.key?('rule_message') ? hash['rule_message'] : SKIP
323
+ rule_name = hash.key?('rule_name') ? hash['rule_name'] : SKIP
324
+ severity = hash.key?('severity') ? hash['severity'] : SKIP
325
+ sourcing_policy = PolicyReference.from_hash(hash['sourcing_policy']) if
326
+ hash['sourcing_policy']
327
+ state = hash.key?('state') ? hash['state'] : SKIP
328
+ state_updated_at =
329
+ hash.key?('state_updated_at') ? hash['state_updated_at'] : SKIP
330
+ status = hash.key?('status') ? hash['status'] : SKIP
331
+ syntactic_id = hash.key?('syntactic_id') ? hash['syntactic_id'] : SKIP
332
+ triage_comment =
333
+ hash.key?('triage_comment') ? hash['triage_comment'] : SKIP
334
+ triage_reason = hash.key?('triage_reason') ? hash['triage_reason'] : SKIP
335
+ triage_state = hash.key?('triage_state') ? hash['triage_state'] : SKIP
336
+ triaged_at = hash.key?('triaged_at') ? hash['triaged_at'] : SKIP
337
+
338
+ # Create a new hash for additional properties, removing known properties.
339
+ new_hash = hash.reject { |k, _| names.value?(k) }
340
+
341
+ additional_properties = APIHelper.get_additional_properties(
342
+ new_hash, proc { |value| value }
343
+ )
344
+
345
+ # Create object from extracted values.
346
+ SastFinding.new(assistant: assistant,
347
+ categories: categories,
348
+ click_to_fix_failures: click_to_fix_failures,
349
+ click_to_fix_prs: click_to_fix_prs,
350
+ confidence: confidence,
351
+ created_at: created_at,
352
+ external_ticket: external_ticket,
353
+ first_seen_scan_id: first_seen_scan_id,
354
+ id: id,
355
+ line_of_code_url: line_of_code_url,
356
+ location: location,
357
+ match_based_id: match_based_id,
358
+ ref: ref,
359
+ relevant_since: relevant_since,
360
+ repository: repository,
361
+ review_comments: review_comments,
362
+ rule: rule,
363
+ rule_message: rule_message,
364
+ rule_name: rule_name,
365
+ severity: severity,
366
+ sourcing_policy: sourcing_policy,
367
+ state: state,
368
+ state_updated_at: state_updated_at,
369
+ status: status,
370
+ syntactic_id: syntactic_id,
371
+ triage_comment: triage_comment,
372
+ triage_reason: triage_reason,
373
+ triage_state: triage_state,
374
+ triaged_at: triaged_at,
375
+ additional_properties: additional_properties)
376
+ end
377
+
378
+ # Validates an instance of the object from a given value.
379
+ # @param [SastFinding | Hash] The value against the validation is performed.
380
+ def self.validate(value)
381
+ return true if value.instance_of? self
382
+
383
+ return false unless value.instance_of? Hash
384
+
385
+ true
386
+ end
387
+
388
+ # Provides a human-readable string representation of the object.
389
+ def to_s
390
+ class_name = self.class.name.split('::').last
391
+ "<#{class_name} assistant: #{@assistant}, categories: #{@categories},"\
392
+ " click_to_fix_failures: #{@click_to_fix_failures}, click_to_fix_prs: #{@click_to_fix_prs},"\
393
+ " confidence: #{@confidence}, created_at: #{@created_at}, external_ticket:"\
394
+ " #{@external_ticket}, first_seen_scan_id: #{@first_seen_scan_id}, id: #{@id},"\
395
+ " line_of_code_url: #{@line_of_code_url}, location: #{@location}, match_based_id:"\
396
+ " #{@match_based_id}, ref: #{@ref}, relevant_since: #{@relevant_since}, repository:"\
397
+ " #{@repository}, review_comments: #{@review_comments}, rule: #{@rule}, rule_message:"\
398
+ " #{@rule_message}, rule_name: #{@rule_name}, severity: #{@severity}, sourcing_policy:"\
399
+ " #{@sourcing_policy}, state: #{@state}, state_updated_at: #{@state_updated_at}, status:"\
400
+ " #{@status}, syntactic_id: #{@syntactic_id}, triage_comment: #{@triage_comment},"\
401
+ " triage_reason: #{@triage_reason}, triage_state: #{@triage_state}, triaged_at:"\
402
+ " #{@triaged_at}, additional_properties: #{@additional_properties}>"
403
+ end
404
+
405
+ # Provides a debugging-friendly string with detailed object information.
406
+ def inspect
407
+ class_name = self.class.name.split('::').last
408
+ "<#{class_name} assistant: #{@assistant.inspect}, categories: #{@categories.inspect},"\
409
+ " click_to_fix_failures: #{@click_to_fix_failures.inspect}, click_to_fix_prs:"\
410
+ " #{@click_to_fix_prs.inspect}, confidence: #{@confidence.inspect}, created_at:"\
411
+ " #{@created_at.inspect}, external_ticket: #{@external_ticket.inspect}, first_seen_scan_id:"\
412
+ " #{@first_seen_scan_id.inspect}, id: #{@id.inspect}, line_of_code_url:"\
413
+ " #{@line_of_code_url.inspect}, location: #{@location.inspect}, match_based_id:"\
414
+ " #{@match_based_id.inspect}, ref: #{@ref.inspect}, relevant_since:"\
415
+ " #{@relevant_since.inspect}, repository: #{@repository.inspect}, review_comments:"\
416
+ " #{@review_comments.inspect}, rule: #{@rule.inspect}, rule_message:"\
417
+ " #{@rule_message.inspect}, rule_name: #{@rule_name.inspect}, severity:"\
418
+ " #{@severity.inspect}, sourcing_policy: #{@sourcing_policy.inspect}, state:"\
419
+ " #{@state.inspect}, state_updated_at: #{@state_updated_at.inspect}, status:"\
420
+ " #{@status.inspect}, syntactic_id: #{@syntactic_id.inspect}, triage_comment:"\
421
+ " #{@triage_comment.inspect}, triage_reason: #{@triage_reason.inspect}, triage_state:"\
422
+ " #{@triage_state.inspect}, triaged_at: #{@triaged_at.inspect}, additional_properties:"\
423
+ " #{@additional_properties}>"
424
+ end
425
+ end
426
+ end
@@ -0,0 +1,84 @@
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
+ # A list of Code findings that Semgrep has identified in your organization
8
+ class SastFindings < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # A list of Code findings.
13
+ # @return [Array[SastFinding]]
14
+ attr_accessor :findings
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['findings'] = 'findings'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ %w[
26
+ findings
27
+ ]
28
+ end
29
+
30
+ # An array for nullable fields
31
+ def self.nullables
32
+ []
33
+ end
34
+
35
+ def initialize(findings: SKIP, additional_properties: nil)
36
+ # Add additional model properties to the instance
37
+ additional_properties = {} if additional_properties.nil?
38
+
39
+ @findings = findings unless findings == SKIP
40
+ @additional_properties = additional_properties
41
+ end
42
+
43
+ # Creates an instance of the object from a hash.
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash.
48
+ # Parameter is an array, so we need to iterate through it
49
+ findings = nil
50
+ unless hash['findings'].nil?
51
+ findings = []
52
+ hash['findings'].each do |structure|
53
+ findings << (SastFinding.from_hash(structure) if structure)
54
+ end
55
+ end
56
+
57
+ findings = SKIP unless hash.key?('findings')
58
+
59
+ # Create a new hash for additional properties, removing known properties.
60
+ new_hash = hash.reject { |k, _| names.value?(k) }
61
+
62
+ additional_properties = APIHelper.get_additional_properties(
63
+ new_hash, proc { |value| value }
64
+ )
65
+
66
+ # Create object from extracted values.
67
+ SastFindings.new(findings: findings,
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} findings: #{@findings}, additional_properties: #{@additional_properties}>"
75
+ end
76
+
77
+ # Provides a debugging-friendly string with detailed object information.
78
+ def inspect
79
+ class_name = self.class.name.split('::').last
80
+ "<#{class_name} findings: #{@findings.inspect}, additional_properties:"\
81
+ " #{@additional_properties}>"
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,37 @@
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
+ # SBOM output format for the SBOM export. | value | description |
8
+ # |-------|---------------| | SBOM_OUTPUT_FORMAT_JSON | |
9
+ class SbomOutputFormat
10
+ SBOM_OUTPUT_FORMAT = [
11
+ # TODO: Write general description for SBOM_OUTPUT_FORMAT_JSON
12
+ SBOM_OUTPUT_FORMAT_JSON = 'SBOM_OUTPUT_FORMAT_JSON'.freeze,
13
+
14
+ # TODO: Write general description for SBOM_OUTPUT_FORMAT_CYCLONEDX
15
+ SBOM_OUTPUT_FORMAT_CYCLONEDX = 'SBOM_OUTPUT_FORMAT_CYCLONEDX'.freeze
16
+ ].freeze
17
+
18
+ def self.validate(value)
19
+ return false if value.nil?
20
+
21
+ SBOM_OUTPUT_FORMAT.include?(value)
22
+ end
23
+
24
+ def self.from_value(value, default_value = SBOM_OUTPUT_FORMAT_JSON)
25
+ return default_value if value.nil?
26
+
27
+ str = value.to_s.strip
28
+
29
+ case str.downcase
30
+ when 'sbom_output_format_json' then SBOM_OUTPUT_FORMAT_JSON
31
+ when 'sbom_output_format_cyclonedx' then SBOM_OUTPUT_FORMAT_CYCLONEDX
32
+ else
33
+ default_value
34
+ end
35
+ end
36
+ end
37
+ end