apimatic-semgrep-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +205 -0
- data/bin/console +15 -0
- data/lib/semgrep_web_app/api_helper.rb +10 -0
- data/lib/semgrep_web_app/apis/base_api.rb +67 -0
- data/lib/semgrep_web_app/apis/deployments_service_api.rb +29 -0
- data/lib/semgrep_web_app/apis/findings_service_api.rb +107 -0
- data/lib/semgrep_web_app/apis/misc_service_api.rb +47 -0
- data/lib/semgrep_web_app/apis/policies_service_api.rb +97 -0
- data/lib/semgrep_web_app/apis/projects_service_api.rb +238 -0
- data/lib/semgrep_web_app/apis/scans_service_api.rb +65 -0
- data/lib/semgrep_web_app/apis/secrets_service_api.rb +55 -0
- data/lib/semgrep_web_app/apis/supply_chain_service_api.rb +154 -0
- data/lib/semgrep_web_app/apis/ticketing_service_api.rb +144 -0
- data/lib/semgrep_web_app/apis/triage_service_api.rb +43 -0
- data/lib/semgrep_web_app/client.rb +136 -0
- data/lib/semgrep_web_app/configuration.rb +178 -0
- data/lib/semgrep_web_app/exceptions/api_exception.rb +21 -0
- data/lib/semgrep_web_app/http/api_response.rb +19 -0
- data/lib/semgrep_web_app/http/auth/semgrep_admin_jwt.rb +53 -0
- data/lib/semgrep_web_app/http/auth/semgrep_jwt.rb +53 -0
- data/lib/semgrep_web_app/http/auth/semgrep_web_token.rb +53 -0
- data/lib/semgrep_web_app/http/http_call_back.rb +10 -0
- data/lib/semgrep_web_app/http/http_method_enum.rb +10 -0
- data/lib/semgrep_web_app/http/http_request.rb +10 -0
- data/lib/semgrep_web_app/http/http_response.rb +10 -0
- data/lib/semgrep_web_app/http/proxy_settings.rb +22 -0
- data/lib/semgrep_web_app/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/semgrep_web_app/logging/sdk_logger.rb +17 -0
- data/lib/semgrep_web_app/models/add_project_tags_request.rb +96 -0
- data/lib/semgrep_web_app/models/add_project_tags_response.rb +73 -0
- data/lib/semgrep_web_app/models/ai_powered_scan_finding.rb +426 -0
- data/lib/semgrep_web_app/models/ai_sast_findings.rb +85 -0
- data/lib/semgrep_web_app/models/api_v1_deployments_findings_response.rb +87 -0
- data/lib/semgrep_web_app/models/assistant.rb +127 -0
- data/lib/semgrep_web_app/models/autofix.rb +98 -0
- data/lib/semgrep_web_app/models/autotriage.rb +98 -0
- data/lib/semgrep_web_app/models/autotriage_verdict.rb +36 -0
- data/lib/semgrep_web_app/models/autotriage_verdict2.rb +38 -0
- data/lib/semgrep_web_app/models/base_model.rb +110 -0
- data/lib/semgrep_web_app/models/bulk_triage_request.rb +393 -0
- data/lib/semgrep_web_app/models/bulk_triage_response.rb +83 -0
- data/lib/semgrep_web_app/models/click_to_fix_failure.rb +95 -0
- data/lib/semgrep_web_app/models/click_to_fix_pr.rb +95 -0
- data/lib/semgrep_web_app/models/click_to_fix_pr_state.rb +38 -0
- data/lib/semgrep_web_app/models/component.rb +95 -0
- data/lib/semgrep_web_app/models/confidence.rb +42 -0
- data/lib/semgrep_web_app/models/confidence1.rb +40 -0
- data/lib/semgrep_web_app/models/confidence2.rb +40 -0
- data/lib/semgrep_web_app/models/confidence3.rb +40 -0
- data/lib/semgrep_web_app/models/confidence7.rb +41 -0
- data/lib/semgrep_web_app/models/confidence8.rb +42 -0
- data/lib/semgrep_web_app/models/create_sbom_export_request.rb +176 -0
- data/lib/semgrep_web_app/models/create_sbom_export_response.rb +74 -0
- data/lib/semgrep_web_app/models/create_ticket_request.rb +393 -0
- data/lib/semgrep_web_app/models/cyclonedx_version.rb +48 -0
- data/lib/semgrep_web_app/models/delete_project_response.rb +74 -0
- data/lib/semgrep_web_app/models/delete_project_tags_response.rb +73 -0
- data/lib/semgrep_web_app/models/deployment.rb +102 -0
- data/lib/semgrep_web_app/models/ecosystem.rb +91 -0
- data/lib/semgrep_web_app/models/ecosystem1.rb +92 -0
- data/lib/semgrep_web_app/models/ecosystem2.rb +76 -0
- data/lib/semgrep_web_app/models/endpoint_reference.rb +72 -0
- data/lib/semgrep_web_app/models/epss_probability.rb +45 -0
- data/lib/semgrep_web_app/models/epss_score.rb +95 -0
- data/lib/semgrep_web_app/models/exposures.rb +50 -0
- data/lib/semgrep_web_app/models/exposures2.rb +51 -0
- data/lib/semgrep_web_app/models/external_ticket.rb +116 -0
- data/lib/semgrep_web_app/models/finding_location.rb +126 -0
- data/lib/semgrep_web_app/models/finding_repository.rb +95 -0
- data/lib/semgrep_web_app/models/finding_rule.rb +158 -0
- data/lib/semgrep_web_app/models/fix_recommendation.rb +95 -0
- data/lib/semgrep_web_app/models/float_range.rb +85 -0
- data/lib/semgrep_web_app/models/format.rb +27 -0
- data/lib/semgrep_web_app/models/found_dependency.rb +128 -0
- data/lib/semgrep_web_app/models/get_project_response.rb +73 -0
- data/lib/semgrep_web_app/models/get_sbom_export_response.rb +100 -0
- data/lib/semgrep_web_app/models/guidance.rb +98 -0
- data/lib/semgrep_web_app/models/issue_type.rb +40 -0
- data/lib/semgrep_web_app/models/issue_type1.rb +40 -0
- data/lib/semgrep_web_app/models/issue_type2.rb +42 -0
- data/lib/semgrep_web_app/models/license_policy_settings.rb +42 -0
- data/lib/semgrep_web_app/models/link_ticket_request.rb +93 -0
- data/lib/semgrep_web_app/models/list_dependencies_request.rb +108 -0
- data/lib/semgrep_web_app/models/list_dependencies_response.rb +102 -0
- data/lib/semgrep_web_app/models/list_findings_response.rb +100 -0
- data/lib/semgrep_web_app/models/list_lockfiles_for_dependencies_request.rb +118 -0
- data/lib/semgrep_web_app/models/list_lockfiles_for_dependencies_response.rb +103 -0
- data/lib/semgrep_web_app/models/list_project.rb +145 -0
- data/lib/semgrep_web_app/models/list_projects_response.rb +82 -0
- data/lib/semgrep_web_app/models/list_repositories_for_dependencies_request.rb +107 -0
- data/lib/semgrep_web_app/models/list_repositories_for_dependencies_response.rb +103 -0
- data/lib/semgrep_web_app/models/managed_scan_config.rb +85 -0
- data/lib/semgrep_web_app/models/metadata_component_type.rb +101 -0
- data/lib/semgrep_web_app/models/mode.rb +48 -0
- data/lib/semgrep_web_app/models/new_triage_reason.rb +48 -0
- data/lib/semgrep_web_app/models/new_triage_state.rb +48 -0
- data/lib/semgrep_web_app/models/policy.rb +118 -0
- data/lib/semgrep_web_app/models/policy_mode.rb +48 -0
- data/lib/semgrep_web_app/models/policy_mode1.rb +40 -0
- data/lib/semgrep_web_app/models/policy_mode3.rb +51 -0
- data/lib/semgrep_web_app/models/policy_reference.rb +105 -0
- data/lib/semgrep_web_app/models/product_type.rb +38 -0
- data/lib/semgrep_web_app/models/products.rb +46 -0
- data/lib/semgrep_web_app/models/project.rb +157 -0
- data/lib/semgrep_web_app/models/protos_ai_v1_autotriage.rb +154 -0
- data/lib/semgrep_web_app/models/protos_ai_v1_autotriage_feedback.rb +98 -0
- data/lib/semgrep_web_app/models/protos_common_v1_review_comment.rb +90 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response.rb +123 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_failed.rb +85 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_skipped.rb +85 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_create_ticket_response_ticket_creation_success.rb +106 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_delete_ticket_response.rb +76 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_diff_scan.rb +75 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_full_scan.rb +75 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_get_bootstrap_sms_vpc_response.rb +130 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_get_scan_response.rb +168 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_get_scan_response_scan_meta.rb +256 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_link_ticket_response.rb +119 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_deployments_response.rb +85 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_policies_response.rb +84 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_policy_rules_response.rb +104 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_list_secrets_path_response.rb +104 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_search_scans_response.rb +94 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_unlink_ticket_response.rb +77 -0
- data/lib/semgrep_web_app/models/protos_openapi_v1_update_policy_response.rb +88 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_code_location.rb +144 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_dependency.rb +87 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_dependency_filter.rb +199 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_found_dependency.rb +174 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_lockfile_dependency_summary.rb +87 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_package_filter.rb +124 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_repository_dependency_summary.rb +111 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_sbom_format_version.rb +109 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_sbom_metadata_contact.rb +95 -0
- data/lib/semgrep_web_app/models/protos_sca_v1_sbom_metadata_supplier.rb +95 -0
- data/lib/semgrep_web_app/models/protos_scan_v1_scan_findings_counts.rb +105 -0
- data/lib/semgrep_web_app/models/protos_scan_v1_scan_public.rb +228 -0
- data/lib/semgrep_web_app/models/protos_secrets_v1_historical_info.rb +116 -0
- data/lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding.rb +320 -0
- data/lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb +121 -0
- data/lib/semgrep_web_app/models/protos_ticketing_v1_external_ticket.rb +106 -0
- data/lib/semgrep_web_app/models/rating.rb +38 -0
- data/lib/semgrep_web_app/models/reachability.rb +48 -0
- data/lib/semgrep_web_app/models/repository_visibility.rb +40 -0
- data/lib/semgrep_web_app/models/review_comment.rb +100 -0
- data/lib/semgrep_web_app/models/risk.rb +40 -0
- data/lib/semgrep_web_app/models/rule.rb +292 -0
- data/lib/semgrep_web_app/models/rule_explanation.rb +98 -0
- data/lib/semgrep_web_app/models/sast_finding.rb +426 -0
- data/lib/semgrep_web_app/models/sast_findings.rb +84 -0
- data/lib/semgrep_web_app/models/sbom_output_format.rb +37 -0
- data/lib/semgrep_web_app/models/sca_finding.rb +458 -0
- data/lib/semgrep_web_app/models/sca_findings.rb +85 -0
- data/lib/semgrep_web_app/models/scm_type.rb +70 -0
- data/lib/semgrep_web_app/models/search_scans_request.rb +202 -0
- data/lib/semgrep_web_app/models/severities.rb +44 -0
- data/lib/semgrep_web_app/models/severities2.rb +45 -0
- data/lib/semgrep_web_app/models/severity.rb +46 -0
- data/lib/semgrep_web_app/models/severity1.rb +45 -0
- data/lib/semgrep_web_app/models/severity4.rb +46 -0
- data/lib/semgrep_web_app/models/severity5.rb +48 -0
- data/lib/semgrep_web_app/models/source.rb +42 -0
- data/lib/semgrep_web_app/models/state.rb +42 -0
- data/lib/semgrep_web_app/models/status.rb +55 -0
- data/lib/semgrep_web_app/models/status1.rb +52 -0
- data/lib/semgrep_web_app/models/status3.rb +44 -0
- data/lib/semgrep_web_app/models/status6.rb +55 -0
- data/lib/semgrep_web_app/models/status7.rb +59 -0
- data/lib/semgrep_web_app/models/status8.rb +61 -0
- data/lib/semgrep_web_app/models/status9.rb +55 -0
- data/lib/semgrep_web_app/models/statuses.rb +63 -0
- data/lib/semgrep_web_app/models/toggle_project_managed_scan_request.rb +108 -0
- data/lib/semgrep_web_app/models/toggle_project_managed_scan_response.rb +73 -0
- data/lib/semgrep_web_app/models/transitivities.rb +40 -0
- data/lib/semgrep_web_app/models/transitivities2.rb +42 -0
- data/lib/semgrep_web_app/models/transitivity.rb +41 -0
- data/lib/semgrep_web_app/models/transitivity1.rb +42 -0
- data/lib/semgrep_web_app/models/transitivity2.rb +40 -0
- data/lib/semgrep_web_app/models/triage_reason.rb +48 -0
- data/lib/semgrep_web_app/models/triage_reasons.rb +48 -0
- data/lib/semgrep_web_app/models/triage_reasons2.rb +50 -0
- data/lib/semgrep_web_app/models/triage_state.rb +54 -0
- data/lib/semgrep_web_app/models/unlink_ticket_request.rb +83 -0
- data/lib/semgrep_web_app/models/update_policy_request.rb +113 -0
- data/lib/semgrep_web_app/models/update_project_request.rb +121 -0
- data/lib/semgrep_web_app/models/update_project_response.rb +73 -0
- data/lib/semgrep_web_app/models/usage.rb +99 -0
- data/lib/semgrep_web_app/models/validation_state.rb +45 -0
- data/lib/semgrep_web_app/models/validation_state2.rb +47 -0
- data/lib/semgrep_web_app/models/validation_state3.rb +48 -0
- data/lib/semgrep_web_app/models/verdict.rb +41 -0
- data/lib/semgrep_web_app/models/verdict1.rb +38 -0
- data/lib/semgrep_web_app/models/visibility.rb +42 -0
- data/lib/semgrep_web_app/utilities/date_time_helper.rb +11 -0
- data/lib/semgrep_web_app/utilities/file_wrapper.rb +28 -0
- data/lib/semgrep_web_app/utilities/union_type_lookup.rb +34 -0
- data/lib/semgrep_web_app.rb +245 -0
- metadata +283 -0
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
# ListDependenciesRequest Model.
|
|
8
|
+
class ListDependenciesRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Cursor to paginate through the dependencies. Provide a cursor value from
|
|
13
|
+
# the response to retrieve the next page.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :cursor
|
|
16
|
+
|
|
17
|
+
# Object to provide dependency details to filter by.
|
|
18
|
+
# @return [ProtosScaV1DependencyFilter]
|
|
19
|
+
attr_accessor :dependency_filter
|
|
20
|
+
|
|
21
|
+
# Deployment ID (numeric). Example: `123`. Can be found at `/deployments`,
|
|
22
|
+
# or in your Settings in the web UI.
|
|
23
|
+
# @return [String]
|
|
24
|
+
attr_accessor :deployment_id
|
|
25
|
+
|
|
26
|
+
# Number of dependencies per page. Default: 1000, min: 1, max: 10000.
|
|
27
|
+
# @return [Integer]
|
|
28
|
+
attr_accessor :page_size
|
|
29
|
+
|
|
30
|
+
# A mapping from model property names to API property names.
|
|
31
|
+
def self.names
|
|
32
|
+
@_hash = {} if @_hash.nil?
|
|
33
|
+
@_hash['cursor'] = 'cursor'
|
|
34
|
+
@_hash['dependency_filter'] = 'dependencyFilter'
|
|
35
|
+
@_hash['deployment_id'] = 'deploymentId'
|
|
36
|
+
@_hash['page_size'] = 'pageSize'
|
|
37
|
+
@_hash
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for optional fields
|
|
41
|
+
def self.optionals
|
|
42
|
+
%w[
|
|
43
|
+
cursor
|
|
44
|
+
dependency_filter
|
|
45
|
+
page_size
|
|
46
|
+
]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for nullable fields
|
|
50
|
+
def self.nullables
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(deployment_id:, cursor: SKIP, dependency_filter: SKIP,
|
|
55
|
+
page_size: SKIP, additional_properties: nil)
|
|
56
|
+
# Add additional model properties to the instance
|
|
57
|
+
additional_properties = {} if additional_properties.nil?
|
|
58
|
+
|
|
59
|
+
@cursor = cursor unless cursor == SKIP
|
|
60
|
+
@dependency_filter = dependency_filter unless dependency_filter == SKIP
|
|
61
|
+
@deployment_id = deployment_id
|
|
62
|
+
@page_size = page_size unless page_size == SKIP
|
|
63
|
+
@additional_properties = additional_properties
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Creates an instance of the object from a hash.
|
|
67
|
+
def self.from_hash(hash)
|
|
68
|
+
return nil unless hash
|
|
69
|
+
|
|
70
|
+
# Extract variables from the hash.
|
|
71
|
+
deployment_id = hash.key?('deploymentId') ? hash['deploymentId'] : nil
|
|
72
|
+
cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
|
|
73
|
+
dependency_filter = ProtosScaV1DependencyFilter.from_hash(hash['dependencyFilter']) if
|
|
74
|
+
hash['dependencyFilter']
|
|
75
|
+
page_size = hash.key?('pageSize') ? hash['pageSize'] : SKIP
|
|
76
|
+
|
|
77
|
+
# Create a new hash for additional properties, removing known properties.
|
|
78
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
79
|
+
|
|
80
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
81
|
+
new_hash, proc { |value| value }
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Create object from extracted values.
|
|
85
|
+
ListDependenciesRequest.new(deployment_id: deployment_id,
|
|
86
|
+
cursor: cursor,
|
|
87
|
+
dependency_filter: dependency_filter,
|
|
88
|
+
page_size: page_size,
|
|
89
|
+
additional_properties: additional_properties)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Provides a human-readable string representation of the object.
|
|
93
|
+
def to_s
|
|
94
|
+
class_name = self.class.name.split('::').last
|
|
95
|
+
"<#{class_name} cursor: #{@cursor}, dependency_filter: #{@dependency_filter},"\
|
|
96
|
+
" deployment_id: #{@deployment_id}, page_size: #{@page_size}, additional_properties:"\
|
|
97
|
+
" #{@additional_properties}>"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
101
|
+
def inspect
|
|
102
|
+
class_name = self.class.name.split('::').last
|
|
103
|
+
"<#{class_name} cursor: #{@cursor.inspect}, dependency_filter:"\
|
|
104
|
+
" #{@dependency_filter.inspect}, deployment_id: #{@deployment_id.inspect}, page_size:"\
|
|
105
|
+
" #{@page_size.inspect}, additional_properties: #{@additional_properties}>"
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
# ListDependenciesResponse Model.
|
|
8
|
+
class ListDependenciesResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Pass to next request to get next page of results.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :cursor
|
|
15
|
+
|
|
16
|
+
# List of dependencies.
|
|
17
|
+
# @return [Array[ProtosScaV1FoundDependency]]
|
|
18
|
+
attr_accessor :dependencies
|
|
19
|
+
|
|
20
|
+
# True if there are more dependencies to get.
|
|
21
|
+
# @return [TrueClass | FalseClass]
|
|
22
|
+
attr_accessor :has_more
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['cursor'] = 'cursor'
|
|
28
|
+
@_hash['dependencies'] = 'dependencies'
|
|
29
|
+
@_hash['has_more'] = 'hasMore'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
cursor
|
|
37
|
+
]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for nullable fields
|
|
41
|
+
def self.nullables
|
|
42
|
+
[]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def initialize(dependencies:, has_more:, cursor: SKIP,
|
|
46
|
+
additional_properties: nil)
|
|
47
|
+
# Add additional model properties to the instance
|
|
48
|
+
additional_properties = {} if additional_properties.nil?
|
|
49
|
+
|
|
50
|
+
@cursor = cursor unless cursor == SKIP
|
|
51
|
+
@dependencies = dependencies
|
|
52
|
+
@has_more = has_more
|
|
53
|
+
@additional_properties = additional_properties
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Creates an instance of the object from a hash.
|
|
57
|
+
def self.from_hash(hash)
|
|
58
|
+
return nil unless hash
|
|
59
|
+
|
|
60
|
+
# Extract variables from the hash.
|
|
61
|
+
# Parameter is an array, so we need to iterate through it
|
|
62
|
+
dependencies = nil
|
|
63
|
+
unless hash['dependencies'].nil?
|
|
64
|
+
dependencies = []
|
|
65
|
+
hash['dependencies'].each do |structure|
|
|
66
|
+
dependencies << (ProtosScaV1FoundDependency.from_hash(structure) if structure)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
dependencies = nil unless hash.key?('dependencies')
|
|
71
|
+
has_more = hash.key?('hasMore') ? hash['hasMore'] : nil
|
|
72
|
+
cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
|
|
73
|
+
|
|
74
|
+
# Create a new hash for additional properties, removing known properties.
|
|
75
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
76
|
+
|
|
77
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
78
|
+
new_hash, proc { |value| value }
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# Create object from extracted values.
|
|
82
|
+
ListDependenciesResponse.new(dependencies: dependencies,
|
|
83
|
+
has_more: has_more,
|
|
84
|
+
cursor: cursor,
|
|
85
|
+
additional_properties: additional_properties)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a human-readable string representation of the object.
|
|
89
|
+
def to_s
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} cursor: #{@cursor}, dependencies: #{@dependencies}, has_more: #{@has_more},"\
|
|
92
|
+
" additional_properties: #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
96
|
+
def inspect
|
|
97
|
+
class_name = self.class.name.split('::').last
|
|
98
|
+
"<#{class_name} cursor: #{@cursor.inspect}, dependencies: #{@dependencies.inspect},"\
|
|
99
|
+
" has_more: #{@has_more.inspect}, additional_properties: #{@additional_properties}>"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
# Response containing a paginated list of findings (either Code or Supply
|
|
8
|
+
# Chain findings) with optional filtering applied
|
|
9
|
+
class ListFindingsResponse < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# A list of AI-powered scan findings that Semgrep has identified in your
|
|
14
|
+
# organization
|
|
15
|
+
# @return [AiSastFindings]
|
|
16
|
+
attr_accessor :ai_sast_findings
|
|
17
|
+
|
|
18
|
+
# A list of Code findings that Semgrep has identified in your organization
|
|
19
|
+
# @return [SastFindings]
|
|
20
|
+
attr_accessor :sast_findings
|
|
21
|
+
|
|
22
|
+
# A list of Supply Chain findings that Semgrep has identified in your
|
|
23
|
+
# organization
|
|
24
|
+
# @return [ScaFindings]
|
|
25
|
+
attr_accessor :sca_findings
|
|
26
|
+
|
|
27
|
+
# A mapping from model property names to API property names.
|
|
28
|
+
def self.names
|
|
29
|
+
@_hash = {} if @_hash.nil?
|
|
30
|
+
@_hash['ai_sast_findings'] = 'aiSastFindings'
|
|
31
|
+
@_hash['sast_findings'] = 'sastFindings'
|
|
32
|
+
@_hash['sca_findings'] = 'scaFindings'
|
|
33
|
+
@_hash
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for optional fields
|
|
37
|
+
def self.optionals
|
|
38
|
+
%w[
|
|
39
|
+
ai_sast_findings
|
|
40
|
+
sast_findings
|
|
41
|
+
sca_findings
|
|
42
|
+
]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# An array for nullable fields
|
|
46
|
+
def self.nullables
|
|
47
|
+
[]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def initialize(ai_sast_findings: SKIP, sast_findings: SKIP,
|
|
51
|
+
sca_findings: SKIP, additional_properties: nil)
|
|
52
|
+
# Add additional model properties to the instance
|
|
53
|
+
additional_properties = {} if additional_properties.nil?
|
|
54
|
+
|
|
55
|
+
@ai_sast_findings = ai_sast_findings unless ai_sast_findings == SKIP
|
|
56
|
+
@sast_findings = sast_findings unless sast_findings == SKIP
|
|
57
|
+
@sca_findings = sca_findings unless sca_findings == SKIP
|
|
58
|
+
@additional_properties = additional_properties
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Creates an instance of the object from a hash.
|
|
62
|
+
def self.from_hash(hash)
|
|
63
|
+
return nil unless hash
|
|
64
|
+
|
|
65
|
+
# Extract variables from the hash.
|
|
66
|
+
ai_sast_findings = AiSastFindings.from_hash(hash['aiSastFindings']) if
|
|
67
|
+
hash['aiSastFindings']
|
|
68
|
+
sast_findings = SastFindings.from_hash(hash['sastFindings']) if hash['sastFindings']
|
|
69
|
+
sca_findings = ScaFindings.from_hash(hash['scaFindings']) if hash['scaFindings']
|
|
70
|
+
|
|
71
|
+
# Create a new hash for additional properties, removing known properties.
|
|
72
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
73
|
+
|
|
74
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
75
|
+
new_hash, proc { |value| value }
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Create object from extracted values.
|
|
79
|
+
ListFindingsResponse.new(ai_sast_findings: ai_sast_findings,
|
|
80
|
+
sast_findings: sast_findings,
|
|
81
|
+
sca_findings: sca_findings,
|
|
82
|
+
additional_properties: additional_properties)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Provides a human-readable string representation of the object.
|
|
86
|
+
def to_s
|
|
87
|
+
class_name = self.class.name.split('::').last
|
|
88
|
+
"<#{class_name} ai_sast_findings: #{@ai_sast_findings}, sast_findings: #{@sast_findings},"\
|
|
89
|
+
" sca_findings: #{@sca_findings}, additional_properties: #{@additional_properties}>"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
93
|
+
def inspect
|
|
94
|
+
class_name = self.class.name.split('::').last
|
|
95
|
+
"<#{class_name} ai_sast_findings: #{@ai_sast_findings.inspect}, sast_findings:"\
|
|
96
|
+
" #{@sast_findings.inspect}, sca_findings: #{@sca_findings.inspect}, additional_properties:"\
|
|
97
|
+
" #{@additional_properties}>"
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
# ListLockfilesForDependenciesRequest Model.
|
|
8
|
+
class ListLockfilesForDependenciesRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Use cursor in response to get next page of results.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :cursor
|
|
15
|
+
|
|
16
|
+
# Object to provide dependency details to filter by.
|
|
17
|
+
# @return [ProtosScaV1DependencyFilter]
|
|
18
|
+
attr_accessor :dependency_filter
|
|
19
|
+
|
|
20
|
+
# Deployment ID (numeric). Example: `123`. Can be found at `/deployments`,
|
|
21
|
+
# or in your Settings in the web UI.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :deployment_id
|
|
24
|
+
|
|
25
|
+
# Number of repositories per page. Default: 5, min: 1, max: 100.
|
|
26
|
+
# @return [Integer]
|
|
27
|
+
attr_accessor :page_size
|
|
28
|
+
|
|
29
|
+
# Repository ID to filter by. Use Projects endpoints to retrieve repository
|
|
30
|
+
# IDs.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :repository_id
|
|
33
|
+
|
|
34
|
+
# A mapping from model property names to API property names.
|
|
35
|
+
def self.names
|
|
36
|
+
@_hash = {} if @_hash.nil?
|
|
37
|
+
@_hash['cursor'] = 'cursor'
|
|
38
|
+
@_hash['dependency_filter'] = 'dependencyFilter'
|
|
39
|
+
@_hash['deployment_id'] = 'deploymentId'
|
|
40
|
+
@_hash['page_size'] = 'pageSize'
|
|
41
|
+
@_hash['repository_id'] = 'repositoryId'
|
|
42
|
+
@_hash
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# An array for optional fields
|
|
46
|
+
def self.optionals
|
|
47
|
+
%w[
|
|
48
|
+
cursor
|
|
49
|
+
dependency_filter
|
|
50
|
+
page_size
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for nullable fields
|
|
55
|
+
def self.nullables
|
|
56
|
+
[]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def initialize(deployment_id:, repository_id:, cursor: SKIP,
|
|
60
|
+
dependency_filter: SKIP, page_size: 5,
|
|
61
|
+
additional_properties: nil)
|
|
62
|
+
# Add additional model properties to the instance
|
|
63
|
+
additional_properties = {} if additional_properties.nil?
|
|
64
|
+
|
|
65
|
+
@cursor = cursor unless cursor == SKIP
|
|
66
|
+
@dependency_filter = dependency_filter unless dependency_filter == SKIP
|
|
67
|
+
@deployment_id = deployment_id
|
|
68
|
+
@page_size = page_size unless page_size == SKIP
|
|
69
|
+
@repository_id = repository_id
|
|
70
|
+
@additional_properties = additional_properties
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Creates an instance of the object from a hash.
|
|
74
|
+
def self.from_hash(hash)
|
|
75
|
+
return nil unless hash
|
|
76
|
+
|
|
77
|
+
# Extract variables from the hash.
|
|
78
|
+
deployment_id = hash.key?('deploymentId') ? hash['deploymentId'] : nil
|
|
79
|
+
repository_id = hash.key?('repositoryId') ? hash['repositoryId'] : nil
|
|
80
|
+
cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
|
|
81
|
+
dependency_filter = ProtosScaV1DependencyFilter.from_hash(hash['dependencyFilter']) if
|
|
82
|
+
hash['dependencyFilter']
|
|
83
|
+
page_size = hash['pageSize'] ||= 5
|
|
84
|
+
|
|
85
|
+
# Create a new hash for additional properties, removing known properties.
|
|
86
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
87
|
+
|
|
88
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
89
|
+
new_hash, proc { |value| value }
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Create object from extracted values.
|
|
93
|
+
ListLockfilesForDependenciesRequest.new(deployment_id: deployment_id,
|
|
94
|
+
repository_id: repository_id,
|
|
95
|
+
cursor: cursor,
|
|
96
|
+
dependency_filter: dependency_filter,
|
|
97
|
+
page_size: page_size,
|
|
98
|
+
additional_properties: additional_properties)
|
|
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} cursor: #{@cursor}, dependency_filter: #{@dependency_filter},"\
|
|
105
|
+
" deployment_id: #{@deployment_id}, page_size: #{@page_size}, repository_id:"\
|
|
106
|
+
" #{@repository_id}, additional_properties: #{@additional_properties}>"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
110
|
+
def inspect
|
|
111
|
+
class_name = self.class.name.split('::').last
|
|
112
|
+
"<#{class_name} cursor: #{@cursor.inspect}, dependency_filter:"\
|
|
113
|
+
" #{@dependency_filter.inspect}, deployment_id: #{@deployment_id.inspect}, page_size:"\
|
|
114
|
+
" #{@page_size.inspect}, repository_id: #{@repository_id.inspect}, additional_properties:"\
|
|
115
|
+
" #{@additional_properties}>"
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# ListLockfilesForDependenciesResponse Model.
|
|
8
|
+
class ListLockfilesForDependenciesResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Pass to next request to get next page of results.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :cursor
|
|
15
|
+
|
|
16
|
+
# True if there are more lockfiles to get.
|
|
17
|
+
# @return [TrueClass | FalseClass]
|
|
18
|
+
attr_accessor :has_more
|
|
19
|
+
|
|
20
|
+
# List of lockfiles.
|
|
21
|
+
# @return [Array[ProtosScaV1LockfileDependencySummary]]
|
|
22
|
+
attr_accessor :lockfile_summaries
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['cursor'] = 'cursor'
|
|
28
|
+
@_hash['has_more'] = 'hasMore'
|
|
29
|
+
@_hash['lockfile_summaries'] = 'lockfileSummaries'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
cursor
|
|
37
|
+
]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for nullable fields
|
|
41
|
+
def self.nullables
|
|
42
|
+
[]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def initialize(has_more:, lockfile_summaries:, cursor: SKIP,
|
|
46
|
+
additional_properties: nil)
|
|
47
|
+
# Add additional model properties to the instance
|
|
48
|
+
additional_properties = {} if additional_properties.nil?
|
|
49
|
+
|
|
50
|
+
@cursor = cursor unless cursor == SKIP
|
|
51
|
+
@has_more = has_more
|
|
52
|
+
@lockfile_summaries = lockfile_summaries
|
|
53
|
+
@additional_properties = additional_properties
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Creates an instance of the object from a hash.
|
|
57
|
+
def self.from_hash(hash)
|
|
58
|
+
return nil unless hash
|
|
59
|
+
|
|
60
|
+
# Extract variables from the hash.
|
|
61
|
+
has_more = hash.key?('hasMore') ? hash['hasMore'] : nil
|
|
62
|
+
# Parameter is an array, so we need to iterate through it
|
|
63
|
+
lockfile_summaries = nil
|
|
64
|
+
unless hash['lockfileSummaries'].nil?
|
|
65
|
+
lockfile_summaries = []
|
|
66
|
+
hash['lockfileSummaries'].each do |structure|
|
|
67
|
+
lockfile_summaries << (ProtosScaV1LockfileDependencySummary.from_hash(structure) if structure)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
lockfile_summaries = nil unless hash.key?('lockfileSummaries')
|
|
72
|
+
cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
|
|
73
|
+
|
|
74
|
+
# Create a new hash for additional properties, removing known properties.
|
|
75
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
76
|
+
|
|
77
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
78
|
+
new_hash, proc { |value| value }
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# Create object from extracted values.
|
|
82
|
+
ListLockfilesForDependenciesResponse.new(has_more: has_more,
|
|
83
|
+
lockfile_summaries: lockfile_summaries,
|
|
84
|
+
cursor: cursor,
|
|
85
|
+
additional_properties: additional_properties)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a human-readable string representation of the object.
|
|
89
|
+
def to_s
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} cursor: #{@cursor}, has_more: #{@has_more}, lockfile_summaries:"\
|
|
92
|
+
" #{@lockfile_summaries}, additional_properties: #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
96
|
+
def inspect
|
|
97
|
+
class_name = self.class.name.split('::').last
|
|
98
|
+
"<#{class_name} cursor: #{@cursor.inspect}, has_more: #{@has_more.inspect},"\
|
|
99
|
+
" lockfile_summaries: #{@lockfile_summaries.inspect}, additional_properties:"\
|
|
100
|
+
" #{@additional_properties}>"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,145 @@
|
|
|
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 project in your organization that uses Semgrep.
|
|
8
|
+
class ListProject < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Time when this project was created.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :created_at
|
|
15
|
+
|
|
16
|
+
# The default branch in the SCM.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :default_branch
|
|
19
|
+
|
|
20
|
+
# Unique ID of this project.
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :id
|
|
23
|
+
|
|
24
|
+
# Time of latest scan, if there is one.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :latest_scan_at
|
|
27
|
+
|
|
28
|
+
# Name of the project.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :name
|
|
31
|
+
|
|
32
|
+
# The primary branch of the project, if known.
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :primary_branch
|
|
35
|
+
|
|
36
|
+
# Tags associated to this project.
|
|
37
|
+
# @return [Array[String]]
|
|
38
|
+
attr_accessor :tags
|
|
39
|
+
|
|
40
|
+
# URL of the project, if there is one.
|
|
41
|
+
# @return [String]
|
|
42
|
+
attr_accessor :url
|
|
43
|
+
|
|
44
|
+
# A mapping from model property names to API property names.
|
|
45
|
+
def self.names
|
|
46
|
+
@_hash = {} if @_hash.nil?
|
|
47
|
+
@_hash['created_at'] = 'created_at'
|
|
48
|
+
@_hash['default_branch'] = 'default_branch'
|
|
49
|
+
@_hash['id'] = 'id'
|
|
50
|
+
@_hash['latest_scan_at'] = 'latest_scan_at'
|
|
51
|
+
@_hash['name'] = 'name'
|
|
52
|
+
@_hash['primary_branch'] = 'primary_branch'
|
|
53
|
+
@_hash['tags'] = 'tags'
|
|
54
|
+
@_hash['url'] = 'url'
|
|
55
|
+
@_hash
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# An array for optional fields
|
|
59
|
+
def self.optionals
|
|
60
|
+
%w[
|
|
61
|
+
created_at
|
|
62
|
+
default_branch
|
|
63
|
+
latest_scan_at
|
|
64
|
+
primary_branch
|
|
65
|
+
url
|
|
66
|
+
]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# An array for nullable fields
|
|
70
|
+
def self.nullables
|
|
71
|
+
[]
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def initialize(id:, name:, tags:, created_at: SKIP, default_branch: SKIP,
|
|
75
|
+
latest_scan_at: SKIP, primary_branch: SKIP, url: SKIP,
|
|
76
|
+
additional_properties: nil)
|
|
77
|
+
# Add additional model properties to the instance
|
|
78
|
+
additional_properties = {} if additional_properties.nil?
|
|
79
|
+
|
|
80
|
+
@created_at = created_at unless created_at == SKIP
|
|
81
|
+
@default_branch = default_branch unless default_branch == SKIP
|
|
82
|
+
@id = id
|
|
83
|
+
@latest_scan_at = latest_scan_at unless latest_scan_at == SKIP
|
|
84
|
+
@name = name
|
|
85
|
+
@primary_branch = primary_branch unless primary_branch == SKIP
|
|
86
|
+
@tags = tags
|
|
87
|
+
@url = url unless url == SKIP
|
|
88
|
+
@additional_properties = additional_properties
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Creates an instance of the object from a hash.
|
|
92
|
+
def self.from_hash(hash)
|
|
93
|
+
return nil unless hash
|
|
94
|
+
|
|
95
|
+
# Extract variables from the hash.
|
|
96
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
97
|
+
name = hash.key?('name') ? hash['name'] : nil
|
|
98
|
+
tags = hash.key?('tags') ? hash['tags'] : nil
|
|
99
|
+
created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
|
|
100
|
+
default_branch =
|
|
101
|
+
hash.key?('default_branch') ? hash['default_branch'] : SKIP
|
|
102
|
+
latest_scan_at =
|
|
103
|
+
hash.key?('latest_scan_at') ? hash['latest_scan_at'] : SKIP
|
|
104
|
+
primary_branch =
|
|
105
|
+
hash.key?('primary_branch') ? hash['primary_branch'] : SKIP
|
|
106
|
+
url = hash.key?('url') ? hash['url'] : SKIP
|
|
107
|
+
|
|
108
|
+
# Create a new hash for additional properties, removing known properties.
|
|
109
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
110
|
+
|
|
111
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
112
|
+
new_hash, proc { |value| value }
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Create object from extracted values.
|
|
116
|
+
ListProject.new(id: id,
|
|
117
|
+
name: name,
|
|
118
|
+
tags: tags,
|
|
119
|
+
created_at: created_at,
|
|
120
|
+
default_branch: default_branch,
|
|
121
|
+
latest_scan_at: latest_scan_at,
|
|
122
|
+
primary_branch: primary_branch,
|
|
123
|
+
url: url,
|
|
124
|
+
additional_properties: additional_properties)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Provides a human-readable string representation of the object.
|
|
128
|
+
def to_s
|
|
129
|
+
class_name = self.class.name.split('::').last
|
|
130
|
+
"<#{class_name} created_at: #{@created_at}, default_branch: #{@default_branch}, id: #{@id},"\
|
|
131
|
+
" latest_scan_at: #{@latest_scan_at}, name: #{@name}, primary_branch: #{@primary_branch},"\
|
|
132
|
+
" tags: #{@tags}, url: #{@url}, additional_properties: #{@additional_properties}>"
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
136
|
+
def inspect
|
|
137
|
+
class_name = self.class.name.split('::').last
|
|
138
|
+
"<#{class_name} created_at: #{@created_at.inspect}, default_branch:"\
|
|
139
|
+
" #{@default_branch.inspect}, id: #{@id.inspect}, latest_scan_at:"\
|
|
140
|
+
" #{@latest_scan_at.inspect}, name: #{@name.inspect}, primary_branch:"\
|
|
141
|
+
" #{@primary_branch.inspect}, tags: #{@tags.inspect}, url: #{@url.inspect},"\
|
|
142
|
+
" additional_properties: #{@additional_properties}>"
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|