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,109 @@
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
+ # ProtosScaV1SbomFormatVersion Model.
8
+ class ProtosScaV1SbomFormatVersion < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # CycloneDX schema version for the SBOM export. Supported: 1.4, 1.5, 1.6,
13
+ # 1.7. Defaults to 1.4 when unset.
14
+ # | value | description |
15
+ # |-------|---------------|
16
+ # | SBOM_CYCLONE_DX_VERSION_V1_4 | |
17
+ # | SBOM_CYCLONE_DX_VERSION_V1_5 | |
18
+ # | SBOM_CYCLONE_DX_VERSION_V1_6 | |
19
+ # | SBOM_CYCLONE_DX_VERSION_V1_7 | |
20
+ # @return [CyclonedxVersion]
21
+ attr_accessor :cyclonedx_version
22
+
23
+ # Format for the SBOM export.
24
+ # | value | description |
25
+ # |-------|---------------|
26
+ # | SBOM_FORMAT_CYCLONEDX | |
27
+ # @return [Format]
28
+ attr_accessor :format
29
+
30
+ # Deprecated. Use `cyclonedx_version`. Free-text CycloneDX version, e.g.
31
+ # "1.7".
32
+ # @return [String]
33
+ attr_accessor :version
34
+
35
+ # A mapping from model property names to API property names.
36
+ def self.names
37
+ @_hash = {} if @_hash.nil?
38
+ @_hash['cyclonedx_version'] = 'cyclonedxVersion'
39
+ @_hash['format'] = 'format'
40
+ @_hash['version'] = 'version'
41
+ @_hash
42
+ end
43
+
44
+ # An array for optional fields
45
+ def self.optionals
46
+ %w[
47
+ cyclonedx_version
48
+ format
49
+ version
50
+ ]
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ []
56
+ end
57
+
58
+ def initialize(cyclonedx_version: SKIP,
59
+ format: Format::SBOM_FORMAT_CYCLONEDX, version: SKIP,
60
+ additional_properties: nil)
61
+ # Add additional model properties to the instance
62
+ additional_properties = {} if additional_properties.nil?
63
+
64
+ @cyclonedx_version = cyclonedx_version unless cyclonedx_version == SKIP
65
+ @format = format unless format == SKIP
66
+ @version = version unless version == 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
+ cyclonedx_version =
76
+ hash.key?('cyclonedxVersion') ? hash['cyclonedxVersion'] : SKIP
77
+ format = hash['format'] ||= Format::SBOM_FORMAT_CYCLONEDX
78
+ version = hash.key?('version') ? hash['version'] : SKIP
79
+
80
+ # Create a new hash for additional properties, removing known properties.
81
+ new_hash = hash.reject { |k, _| names.value?(k) }
82
+
83
+ additional_properties = APIHelper.get_additional_properties(
84
+ new_hash, proc { |value| value }
85
+ )
86
+
87
+ # Create object from extracted values.
88
+ ProtosScaV1SbomFormatVersion.new(cyclonedx_version: cyclonedx_version,
89
+ format: format,
90
+ version: version,
91
+ additional_properties: additional_properties)
92
+ end
93
+
94
+ # Provides a human-readable string representation of the object.
95
+ def to_s
96
+ class_name = self.class.name.split('::').last
97
+ "<#{class_name} cyclonedx_version: #{@cyclonedx_version}, format: #{@format}, version:"\
98
+ " #{@version}, additional_properties: #{@additional_properties}>"
99
+ end
100
+
101
+ # Provides a debugging-friendly string with detailed object information.
102
+ def inspect
103
+ class_name = self.class.name.split('::').last
104
+ "<#{class_name} cyclonedx_version: #{@cyclonedx_version.inspect}, format:"\
105
+ " #{@format.inspect}, version: #{@version.inspect}, additional_properties:"\
106
+ " #{@additional_properties}>"
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,95 @@
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
+ # ProtosScaV1SbomMetadataContact Model.
8
+ class ProtosScaV1SbomMetadataContact < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :email
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :name
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :phone
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['email'] = 'email'
28
+ @_hash['name'] = 'name'
29
+ @_hash['phone'] = 'phone'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ email
37
+ name
38
+ phone
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(email: SKIP, name: SKIP, phone: SKIP,
48
+ additional_properties: nil)
49
+ # Add additional model properties to the instance
50
+ additional_properties = {} if additional_properties.nil?
51
+
52
+ @email = email unless email == SKIP
53
+ @name = name unless name == SKIP
54
+ @phone = phone unless phone == SKIP
55
+ @additional_properties = additional_properties
56
+ end
57
+
58
+ # Creates an instance of the object from a hash.
59
+ def self.from_hash(hash)
60
+ return nil unless hash
61
+
62
+ # Extract variables from the hash.
63
+ email = hash.key?('email') ? hash['email'] : SKIP
64
+ name = hash.key?('name') ? hash['name'] : SKIP
65
+ phone = hash.key?('phone') ? hash['phone'] : SKIP
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ ProtosScaV1SbomMetadataContact.new(email: email,
76
+ name: name,
77
+ phone: phone,
78
+ additional_properties: additional_properties)
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} email: #{@email}, name: #{@name}, phone: #{@phone}, additional_properties:"\
85
+ " #{@additional_properties}>"
86
+ end
87
+
88
+ # Provides a debugging-friendly string with detailed object information.
89
+ def inspect
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} email: #{@email.inspect}, name: #{@name.inspect}, phone: #{@phone.inspect},"\
92
+ " additional_properties: #{@additional_properties}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,95 @@
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
+ # ProtosScaV1SbomMetadataSupplier Model.
8
+ class ProtosScaV1SbomMetadataSupplier < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [ProtosScaV1SbomMetadataContact]
14
+ attr_accessor :contact
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :name
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :url
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['contact'] = 'contact'
28
+ @_hash['name'] = 'name'
29
+ @_hash['url'] = 'url'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ contact
37
+ name
38
+ url
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(contact: SKIP, name: SKIP, url: SKIP,
48
+ additional_properties: nil)
49
+ # Add additional model properties to the instance
50
+ additional_properties = {} if additional_properties.nil?
51
+
52
+ @contact = contact unless contact == SKIP
53
+ @name = name unless name == SKIP
54
+ @url = url unless url == SKIP
55
+ @additional_properties = additional_properties
56
+ end
57
+
58
+ # Creates an instance of the object from a hash.
59
+ def self.from_hash(hash)
60
+ return nil unless hash
61
+
62
+ # Extract variables from the hash.
63
+ contact = ProtosScaV1SbomMetadataContact.from_hash(hash['contact']) if hash['contact']
64
+ name = hash.key?('name') ? hash['name'] : SKIP
65
+ url = hash.key?('url') ? hash['url'] : SKIP
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ ProtosScaV1SbomMetadataSupplier.new(contact: contact,
76
+ name: name,
77
+ url: url,
78
+ additional_properties: additional_properties)
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} contact: #{@contact}, name: #{@name}, url: #{@url}, additional_properties:"\
85
+ " #{@additional_properties}>"
86
+ end
87
+
88
+ # Provides a debugging-friendly string with detailed object information.
89
+ def inspect
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} contact: #{@contact.inspect}, name: #{@name.inspect}, url: #{@url.inspect},"\
92
+ " additional_properties: #{@additional_properties}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,105 @@
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
+ # ProtosScanV1ScanFindingsCounts Model.
8
+ class ProtosScanV1ScanFindingsCounts < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Total number of Code findings in the scan
13
+ # @return [String]
14
+ attr_accessor :code
15
+
16
+ # Total number of Secrets findings in the scan
17
+ # @return [String]
18
+ attr_accessor :secrets
19
+
20
+ # Total number of Supply Chain findings in the scan
21
+ # @return [String]
22
+ attr_accessor :supply_chain
23
+
24
+ # Total number of findings in the scan
25
+ # @return [String]
26
+ attr_accessor :total
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['code'] = 'code'
32
+ @_hash['secrets'] = 'secrets'
33
+ @_hash['supply_chain'] = 'supply_chain'
34
+ @_hash['total'] = 'total'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ code
42
+ secrets
43
+ supply_chain
44
+ total
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(code: SKIP, secrets: SKIP, supply_chain: SKIP, total: SKIP,
54
+ additional_properties: nil)
55
+ # Add additional model properties to the instance
56
+ additional_properties = {} if additional_properties.nil?
57
+
58
+ @code = code unless code == SKIP
59
+ @secrets = secrets unless secrets == SKIP
60
+ @supply_chain = supply_chain unless supply_chain == SKIP
61
+ @total = total unless total == 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
+ code = hash.key?('code') ? hash['code'] : SKIP
71
+ secrets = hash.key?('secrets') ? hash['secrets'] : SKIP
72
+ supply_chain = hash.key?('supply_chain') ? hash['supply_chain'] : SKIP
73
+ total = hash.key?('total') ? hash['total'] : SKIP
74
+
75
+ # Create a new hash for additional properties, removing known properties.
76
+ new_hash = hash.reject { |k, _| names.value?(k) }
77
+
78
+ additional_properties = APIHelper.get_additional_properties(
79
+ new_hash, proc { |value| value }
80
+ )
81
+
82
+ # Create object from extracted values.
83
+ ProtosScanV1ScanFindingsCounts.new(code: code,
84
+ secrets: secrets,
85
+ supply_chain: supply_chain,
86
+ total: total,
87
+ additional_properties: additional_properties)
88
+ end
89
+
90
+ # Provides a human-readable string representation of the object.
91
+ def to_s
92
+ class_name = self.class.name.split('::').last
93
+ "<#{class_name} code: #{@code}, secrets: #{@secrets}, supply_chain: #{@supply_chain},"\
94
+ " total: #{@total}, additional_properties: #{@additional_properties}>"
95
+ end
96
+
97
+ # Provides a debugging-friendly string with detailed object information.
98
+ def inspect
99
+ class_name = self.class.name.split('::').last
100
+ "<#{class_name} code: #{@code.inspect}, secrets: #{@secrets.inspect}, supply_chain:"\
101
+ " #{@supply_chain.inspect}, total: #{@total.inspect}, additional_properties:"\
102
+ " #{@additional_properties}>"
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,228 @@
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
+ # ProtosScanV1ScanPublic Model.
9
+ class ProtosScanV1ScanPublic < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The scanned branch
14
+ # @return [String]
15
+ attr_accessor :branch
16
+
17
+ # The commit hash that was scanned
18
+ # @return [String]
19
+ attr_accessor :commit
20
+
21
+ # The timestamp when this scan completed (if it has completed).
22
+ # @return [DateTime]
23
+ attr_accessor :completed_at
24
+
25
+ # Unique identifier for the deployment of the scan.
26
+ # @return [String]
27
+ attr_accessor :deployment_id
28
+
29
+ # The products used when running the scan.
30
+ # @return [Array[String]]
31
+ attr_accessor :enabled_products
32
+
33
+ # The exit_code of the scan (see
34
+ # https://semgrep.dev/docs/cli-reference#exit-codes)
35
+ # @return [String]
36
+ attr_accessor :exit_code
37
+
38
+ # The exit_code of the scan (see
39
+ # https://semgrep.dev/docs/cli-reference#exit-codes)
40
+ # @return [ProtosScanV1ScanFindingsCounts]
41
+ attr_accessor :findings_counts
42
+
43
+ # ID of the scan.
44
+ # @return [String]
45
+ attr_accessor :id
46
+
47
+ # Whether the scan was a full scan (true) or a diff scan (false)
48
+ # @return [TrueClass | FalseClass]
49
+ attr_accessor :is_full_scan
50
+
51
+ # Unique identifier for the repository of the scan.
52
+ # @return [String]
53
+ attr_accessor :repository_id
54
+
55
+ # The timestamp when this scan started.
56
+ # @return [DateTime]
57
+ attr_accessor :started_at
58
+
59
+ # The current status of the scan
60
+ # | value | description |
61
+ # |-------|---------------|
62
+ # | SCAN_STATUS_RUNNING | The scan is currently running |
63
+ # | SCAN_STATUS_COMPLETED | The scan has completed successfully (0 or 1 exit
64
+ # code) |
65
+ # | SCAN_STATUS_PENDING | The scan is queued and waiting to start |
66
+ # | SCAN_STATUS_CANCELLED | The scan was cancelled before completion |
67
+ # | SCAN_STATUS_ERROR | The scan has exited with a failure (exit code not 0
68
+ # or 1) |
69
+ # | SCAN_STATUS_NEVER_FINISHED | The scan did not report an error or success
70
+ # after over an hour |
71
+ # @return [Status7]
72
+ attr_accessor :status
73
+
74
+ # Duration of scan, in seconds
75
+ # @return [Float]
76
+ attr_accessor :total_time
77
+
78
+ # A mapping from model property names to API property names.
79
+ def self.names
80
+ @_hash = {} if @_hash.nil?
81
+ @_hash['branch'] = 'branch'
82
+ @_hash['commit'] = 'commit'
83
+ @_hash['completed_at'] = 'completed_at'
84
+ @_hash['deployment_id'] = 'deployment_id'
85
+ @_hash['enabled_products'] = 'enabled_products'
86
+ @_hash['exit_code'] = 'exit_code'
87
+ @_hash['findings_counts'] = 'findings_counts'
88
+ @_hash['id'] = 'id'
89
+ @_hash['is_full_scan'] = 'is_full_scan'
90
+ @_hash['repository_id'] = 'repository_id'
91
+ @_hash['started_at'] = 'started_at'
92
+ @_hash['status'] = 'status'
93
+ @_hash['total_time'] = 'total_time'
94
+ @_hash
95
+ end
96
+
97
+ # An array for optional fields
98
+ def self.optionals
99
+ %w[
100
+ branch
101
+ commit
102
+ completed_at
103
+ deployment_id
104
+ enabled_products
105
+ exit_code
106
+ findings_counts
107
+ id
108
+ is_full_scan
109
+ repository_id
110
+ started_at
111
+ status
112
+ total_time
113
+ ]
114
+ end
115
+
116
+ # An array for nullable fields
117
+ def self.nullables
118
+ []
119
+ end
120
+
121
+ def initialize(branch: SKIP, commit: SKIP, completed_at: SKIP,
122
+ deployment_id: SKIP, enabled_products: SKIP, exit_code: SKIP,
123
+ findings_counts: SKIP, id: SKIP, is_full_scan: SKIP,
124
+ repository_id: SKIP, started_at: SKIP, status: SKIP,
125
+ total_time: SKIP, additional_properties: nil)
126
+ # Add additional model properties to the instance
127
+ additional_properties = {} if additional_properties.nil?
128
+
129
+ @branch = branch unless branch == SKIP
130
+ @commit = commit unless commit == SKIP
131
+ @completed_at = completed_at unless completed_at == SKIP
132
+ @deployment_id = deployment_id unless deployment_id == SKIP
133
+ @enabled_products = enabled_products unless enabled_products == SKIP
134
+ @exit_code = exit_code unless exit_code == SKIP
135
+ @findings_counts = findings_counts unless findings_counts == SKIP
136
+ @id = id unless id == SKIP
137
+ @is_full_scan = is_full_scan unless is_full_scan == SKIP
138
+ @repository_id = repository_id unless repository_id == SKIP
139
+ @started_at = started_at unless started_at == SKIP
140
+ @status = status unless status == SKIP
141
+ @total_time = total_time unless total_time == SKIP
142
+ @additional_properties = additional_properties
143
+ end
144
+
145
+ # Creates an instance of the object from a hash.
146
+ def self.from_hash(hash)
147
+ return nil unless hash
148
+
149
+ # Extract variables from the hash.
150
+ branch = hash.key?('branch') ? hash['branch'] : SKIP
151
+ commit = hash.key?('commit') ? hash['commit'] : SKIP
152
+ completed_at = if hash.key?('completed_at')
153
+ (DateTimeHelper.from_rfc3339(hash['completed_at']) if hash['completed_at'])
154
+ else
155
+ SKIP
156
+ end
157
+ deployment_id = hash.key?('deployment_id') ? hash['deployment_id'] : SKIP
158
+ enabled_products =
159
+ hash.key?('enabled_products') ? hash['enabled_products'] : SKIP
160
+ exit_code = hash.key?('exit_code') ? hash['exit_code'] : SKIP
161
+ findings_counts = ProtosScanV1ScanFindingsCounts.from_hash(hash['findings_counts']) if
162
+ hash['findings_counts']
163
+ id = hash.key?('id') ? hash['id'] : SKIP
164
+ is_full_scan = hash.key?('is_full_scan') ? hash['is_full_scan'] : SKIP
165
+ repository_id = hash.key?('repository_id') ? hash['repository_id'] : SKIP
166
+ started_at = if hash.key?('started_at')
167
+ (DateTimeHelper.from_rfc3339(hash['started_at']) if hash['started_at'])
168
+ else
169
+ SKIP
170
+ end
171
+ status = hash.key?('status') ? hash['status'] : SKIP
172
+ total_time = hash.key?('total_time') ? hash['total_time'] : SKIP
173
+
174
+ # Create a new hash for additional properties, removing known properties.
175
+ new_hash = hash.reject { |k, _| names.value?(k) }
176
+
177
+ additional_properties = APIHelper.get_additional_properties(
178
+ new_hash, proc { |value| value }
179
+ )
180
+
181
+ # Create object from extracted values.
182
+ ProtosScanV1ScanPublic.new(branch: branch,
183
+ commit: commit,
184
+ completed_at: completed_at,
185
+ deployment_id: deployment_id,
186
+ enabled_products: enabled_products,
187
+ exit_code: exit_code,
188
+ findings_counts: findings_counts,
189
+ id: id,
190
+ is_full_scan: is_full_scan,
191
+ repository_id: repository_id,
192
+ started_at: started_at,
193
+ status: status,
194
+ total_time: total_time,
195
+ additional_properties: additional_properties)
196
+ end
197
+
198
+ def to_custom_completed_at
199
+ DateTimeHelper.to_rfc3339(completed_at)
200
+ end
201
+
202
+ def to_custom_started_at
203
+ DateTimeHelper.to_rfc3339(started_at)
204
+ end
205
+
206
+ # Provides a human-readable string representation of the object.
207
+ def to_s
208
+ class_name = self.class.name.split('::').last
209
+ "<#{class_name} branch: #{@branch}, commit: #{@commit}, completed_at: #{@completed_at},"\
210
+ " deployment_id: #{@deployment_id}, enabled_products: #{@enabled_products}, exit_code:"\
211
+ " #{@exit_code}, findings_counts: #{@findings_counts}, id: #{@id}, is_full_scan:"\
212
+ " #{@is_full_scan}, repository_id: #{@repository_id}, started_at: #{@started_at}, status:"\
213
+ " #{@status}, total_time: #{@total_time}, additional_properties: #{@additional_properties}>"
214
+ end
215
+
216
+ # Provides a debugging-friendly string with detailed object information.
217
+ def inspect
218
+ class_name = self.class.name.split('::').last
219
+ "<#{class_name} branch: #{@branch.inspect}, commit: #{@commit.inspect}, completed_at:"\
220
+ " #{@completed_at.inspect}, deployment_id: #{@deployment_id.inspect}, enabled_products:"\
221
+ " #{@enabled_products.inspect}, exit_code: #{@exit_code.inspect}, findings_counts:"\
222
+ " #{@findings_counts.inspect}, id: #{@id.inspect}, is_full_scan: #{@is_full_scan.inspect},"\
223
+ " repository_id: #{@repository_id.inspect}, started_at: #{@started_at.inspect}, status:"\
224
+ " #{@status.inspect}, total_time: #{@total_time.inspect}, additional_properties:"\
225
+ " #{@additional_properties}>"
226
+ end
227
+ end
228
+ end