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,393 @@
|
|
|
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
|
+
# BulkTriageRequest Model.
|
|
8
|
+
class BulkTriageRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The autotriage verdict to filter by
|
|
13
|
+
# @return [AutotriageVerdict]
|
|
14
|
+
attr_accessor :autotriage_verdict
|
|
15
|
+
|
|
16
|
+
# List of categories to filter by
|
|
17
|
+
# @return [Array[String]]
|
|
18
|
+
attr_accessor :categories
|
|
19
|
+
|
|
20
|
+
# List of component tags to filter by
|
|
21
|
+
# @return [Array[String]]
|
|
22
|
+
attr_accessor :component_tags
|
|
23
|
+
|
|
24
|
+
# List of confidence levels to filter by
|
|
25
|
+
# @return [Confidence3]
|
|
26
|
+
attr_accessor :confidence
|
|
27
|
+
|
|
28
|
+
# Filter by dependency name. Only applies for sca findings.
|
|
29
|
+
# @return [Array[String]]
|
|
30
|
+
attr_accessor :dependencies
|
|
31
|
+
|
|
32
|
+
# Filter by EPSS probability (likelihood of exploit). Only applies for sca
|
|
33
|
+
# findings.
|
|
34
|
+
# @return [EpssProbability]
|
|
35
|
+
attr_accessor :epss_probability
|
|
36
|
+
|
|
37
|
+
# Filter by exposure (reachability type). Only applies for sca findings.
|
|
38
|
+
# Reachability is the ability of an attacker to access a vulnerability in a
|
|
39
|
+
# system.
|
|
40
|
+
# @return [Exposures]
|
|
41
|
+
attr_accessor :exposures
|
|
42
|
+
|
|
43
|
+
# Whether to include historical findings. Only applies for secrets findings.
|
|
44
|
+
# Defaults to true.
|
|
45
|
+
# @return [TrueClass | FalseClass]
|
|
46
|
+
attr_accessor :include_historical
|
|
47
|
+
|
|
48
|
+
# An array of issue IDs to act on. If this is not provided, an issue filter
|
|
49
|
+
# should be provided.
|
|
50
|
+
# @return [Array[Integer]]
|
|
51
|
+
attr_accessor :issue_ids
|
|
52
|
+
|
|
53
|
+
# Type of findings to bulk triage.
|
|
54
|
+
# @return [IssueType]
|
|
55
|
+
attr_accessor :issue_type
|
|
56
|
+
|
|
57
|
+
# Max number of issues to triage. Must be an integer between 1 and 3000.
|
|
58
|
+
# Defaults to 3000. When selecting findings to triage, Semgrep will also
|
|
59
|
+
# triage findings with the same fingerprint on other branches. As a result,
|
|
60
|
+
# the list of triaged issue_ids returned in the response may be higher than
|
|
61
|
+
# the specified limit.
|
|
62
|
+
# @return [Integer]
|
|
63
|
+
attr_accessor :limit
|
|
64
|
+
|
|
65
|
+
# The note to attach to the bulk triaged findings. Maximum 3000 characters.
|
|
66
|
+
# @return [String]
|
|
67
|
+
attr_accessor :new_note
|
|
68
|
+
|
|
69
|
+
# The reason for triaging to a given triage state.
|
|
70
|
+
# @return [NewTriageReason]
|
|
71
|
+
attr_accessor :new_triage_reason
|
|
72
|
+
|
|
73
|
+
# The triage state you would like to bulk triage your findings to.
|
|
74
|
+
# @return [NewTriageState]
|
|
75
|
+
attr_accessor :new_triage_state
|
|
76
|
+
|
|
77
|
+
# List of policy modes to filter by
|
|
78
|
+
# @return [Array[String]]
|
|
79
|
+
attr_accessor :policies
|
|
80
|
+
|
|
81
|
+
# List of policy modes to filter by
|
|
82
|
+
# @return [PolicyMode1]
|
|
83
|
+
attr_accessor :policy_mode
|
|
84
|
+
|
|
85
|
+
# Filter by whether a finding is only available with Semgrep Pro features.
|
|
86
|
+
# @return [TrueClass | FalseClass]
|
|
87
|
+
attr_accessor :pro_only
|
|
88
|
+
|
|
89
|
+
# List of project tags to filter by
|
|
90
|
+
# @return [Array[String]]
|
|
91
|
+
attr_accessor :project_tags
|
|
92
|
+
|
|
93
|
+
# Branch reference to filter by
|
|
94
|
+
# @return [String]
|
|
95
|
+
attr_accessor :ref
|
|
96
|
+
|
|
97
|
+
# List of repository names to filter by
|
|
98
|
+
# @return [Array[String]]
|
|
99
|
+
attr_accessor :repos
|
|
100
|
+
|
|
101
|
+
# Filter by repository visibility. Only applies for secrets findings.
|
|
102
|
+
# @return [RepositoryVisibility]
|
|
103
|
+
attr_accessor :repository_visibility
|
|
104
|
+
|
|
105
|
+
# List of rule names to filter by
|
|
106
|
+
# @return [Array[String]]
|
|
107
|
+
attr_accessor :rules
|
|
108
|
+
|
|
109
|
+
# List of Semgrep Registry rulesets to filter by
|
|
110
|
+
# @return [Array[String]]
|
|
111
|
+
attr_accessor :ruleset
|
|
112
|
+
|
|
113
|
+
# Filter by type of secret (typically provider-related). Only applies for
|
|
114
|
+
# secrets findings.
|
|
115
|
+
# @return [Array[String]]
|
|
116
|
+
attr_accessor :secret_types
|
|
117
|
+
|
|
118
|
+
# List of severities to filter by
|
|
119
|
+
# @return [Severities]
|
|
120
|
+
attr_accessor :severities
|
|
121
|
+
|
|
122
|
+
# Epoch timestamp in seconds. Filters using the relevant_since field: the
|
|
123
|
+
# timestamp when this finding was detected by Semgrep (the first time, or
|
|
124
|
+
# when reintroduced).
|
|
125
|
+
# @return [String]
|
|
126
|
+
attr_accessor :since
|
|
127
|
+
|
|
128
|
+
# The status to filter by
|
|
129
|
+
# @return [Status1]
|
|
130
|
+
attr_accessor :status
|
|
131
|
+
|
|
132
|
+
# Filter by transitivity of a dependency. Only applies for sca findings.
|
|
133
|
+
# @return [Transitivities]
|
|
134
|
+
attr_accessor :transitivities
|
|
135
|
+
|
|
136
|
+
# List of triage reasons to filter by
|
|
137
|
+
# @return [TriageReasons]
|
|
138
|
+
attr_accessor :triage_reasons
|
|
139
|
+
|
|
140
|
+
# Filter by whether a secret could be validated. Only applies for secrets
|
|
141
|
+
# findings.
|
|
142
|
+
# @return [ValidationState]
|
|
143
|
+
attr_accessor :validation_state
|
|
144
|
+
|
|
145
|
+
# A mapping from model property names to API property names.
|
|
146
|
+
def self.names
|
|
147
|
+
@_hash = {} if @_hash.nil?
|
|
148
|
+
@_hash['autotriage_verdict'] = 'autotriage_verdict'
|
|
149
|
+
@_hash['categories'] = 'categories'
|
|
150
|
+
@_hash['component_tags'] = 'component_tags'
|
|
151
|
+
@_hash['confidence'] = 'confidence'
|
|
152
|
+
@_hash['dependencies'] = 'dependencies'
|
|
153
|
+
@_hash['epss_probability'] = 'epss_probability'
|
|
154
|
+
@_hash['exposures'] = 'exposures'
|
|
155
|
+
@_hash['include_historical'] = 'include_historical'
|
|
156
|
+
@_hash['issue_ids'] = 'issue_ids'
|
|
157
|
+
@_hash['issue_type'] = 'issue_type'
|
|
158
|
+
@_hash['limit'] = 'limit'
|
|
159
|
+
@_hash['new_note'] = 'new_note'
|
|
160
|
+
@_hash['new_triage_reason'] = 'new_triage_reason'
|
|
161
|
+
@_hash['new_triage_state'] = 'new_triage_state'
|
|
162
|
+
@_hash['policies'] = 'policies'
|
|
163
|
+
@_hash['policy_mode'] = 'policy_mode'
|
|
164
|
+
@_hash['pro_only'] = 'pro_only'
|
|
165
|
+
@_hash['project_tags'] = 'project_tags'
|
|
166
|
+
@_hash['ref'] = 'ref'
|
|
167
|
+
@_hash['repos'] = 'repos'
|
|
168
|
+
@_hash['repository_visibility'] = 'repository_visibility'
|
|
169
|
+
@_hash['rules'] = 'rules'
|
|
170
|
+
@_hash['ruleset'] = 'ruleset'
|
|
171
|
+
@_hash['secret_types'] = 'secret_types'
|
|
172
|
+
@_hash['severities'] = 'severities'
|
|
173
|
+
@_hash['since'] = 'since'
|
|
174
|
+
@_hash['status'] = 'status'
|
|
175
|
+
@_hash['transitivities'] = 'transitivities'
|
|
176
|
+
@_hash['triage_reasons'] = 'triage_reasons'
|
|
177
|
+
@_hash['validation_state'] = 'validation_state'
|
|
178
|
+
@_hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# An array for optional fields
|
|
182
|
+
def self.optionals
|
|
183
|
+
%w[
|
|
184
|
+
autotriage_verdict
|
|
185
|
+
categories
|
|
186
|
+
component_tags
|
|
187
|
+
confidence
|
|
188
|
+
dependencies
|
|
189
|
+
epss_probability
|
|
190
|
+
exposures
|
|
191
|
+
include_historical
|
|
192
|
+
issue_ids
|
|
193
|
+
limit
|
|
194
|
+
new_note
|
|
195
|
+
new_triage_reason
|
|
196
|
+
new_triage_state
|
|
197
|
+
policies
|
|
198
|
+
policy_mode
|
|
199
|
+
pro_only
|
|
200
|
+
project_tags
|
|
201
|
+
ref
|
|
202
|
+
repos
|
|
203
|
+
repository_visibility
|
|
204
|
+
rules
|
|
205
|
+
ruleset
|
|
206
|
+
secret_types
|
|
207
|
+
severities
|
|
208
|
+
since
|
|
209
|
+
status
|
|
210
|
+
transitivities
|
|
211
|
+
triage_reasons
|
|
212
|
+
validation_state
|
|
213
|
+
]
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# An array for nullable fields
|
|
217
|
+
def self.nullables
|
|
218
|
+
[]
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def initialize(issue_type:, autotriage_verdict: SKIP, categories: SKIP,
|
|
222
|
+
component_tags: SKIP, confidence: SKIP, dependencies: SKIP,
|
|
223
|
+
epss_probability: SKIP, exposures: SKIP,
|
|
224
|
+
include_historical: SKIP, issue_ids: SKIP, limit: 3000,
|
|
225
|
+
new_note: SKIP, new_triage_reason: SKIP,
|
|
226
|
+
new_triage_state: SKIP, policies: SKIP, policy_mode: SKIP,
|
|
227
|
+
pro_only: SKIP, project_tags: SKIP, ref: SKIP, repos: SKIP,
|
|
228
|
+
repository_visibility: SKIP, rules: SKIP, ruleset: SKIP,
|
|
229
|
+
secret_types: SKIP, severities: SKIP, since: SKIP,
|
|
230
|
+
status: SKIP, transitivities: SKIP, triage_reasons: SKIP,
|
|
231
|
+
validation_state: SKIP, additional_properties: nil)
|
|
232
|
+
# Add additional model properties to the instance
|
|
233
|
+
additional_properties = {} if additional_properties.nil?
|
|
234
|
+
|
|
235
|
+
@autotriage_verdict = autotriage_verdict unless autotriage_verdict == SKIP
|
|
236
|
+
@categories = categories unless categories == SKIP
|
|
237
|
+
@component_tags = component_tags unless component_tags == SKIP
|
|
238
|
+
@confidence = confidence unless confidence == SKIP
|
|
239
|
+
@dependencies = dependencies unless dependencies == SKIP
|
|
240
|
+
@epss_probability = epss_probability unless epss_probability == SKIP
|
|
241
|
+
@exposures = exposures unless exposures == SKIP
|
|
242
|
+
@include_historical = include_historical unless include_historical == SKIP
|
|
243
|
+
@issue_ids = issue_ids unless issue_ids == SKIP
|
|
244
|
+
@issue_type = issue_type
|
|
245
|
+
@limit = limit unless limit == SKIP
|
|
246
|
+
@new_note = new_note unless new_note == SKIP
|
|
247
|
+
@new_triage_reason = new_triage_reason unless new_triage_reason == SKIP
|
|
248
|
+
@new_triage_state = new_triage_state unless new_triage_state == SKIP
|
|
249
|
+
@policies = policies unless policies == SKIP
|
|
250
|
+
@policy_mode = policy_mode unless policy_mode == SKIP
|
|
251
|
+
@pro_only = pro_only unless pro_only == SKIP
|
|
252
|
+
@project_tags = project_tags unless project_tags == SKIP
|
|
253
|
+
@ref = ref unless ref == SKIP
|
|
254
|
+
@repos = repos unless repos == SKIP
|
|
255
|
+
@repository_visibility = repository_visibility unless repository_visibility == SKIP
|
|
256
|
+
@rules = rules unless rules == SKIP
|
|
257
|
+
@ruleset = ruleset unless ruleset == SKIP
|
|
258
|
+
@secret_types = secret_types unless secret_types == SKIP
|
|
259
|
+
@severities = severities unless severities == SKIP
|
|
260
|
+
@since = since unless since == SKIP
|
|
261
|
+
@status = status unless status == SKIP
|
|
262
|
+
@transitivities = transitivities unless transitivities == SKIP
|
|
263
|
+
@triage_reasons = triage_reasons unless triage_reasons == SKIP
|
|
264
|
+
@validation_state = validation_state unless validation_state == 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
|
+
issue_type = hash.key?('issue_type') ? hash['issue_type'] : nil
|
|
274
|
+
autotriage_verdict =
|
|
275
|
+
hash.key?('autotriage_verdict') ? hash['autotriage_verdict'] : SKIP
|
|
276
|
+
categories = hash.key?('categories') ? hash['categories'] : SKIP
|
|
277
|
+
component_tags =
|
|
278
|
+
hash.key?('component_tags') ? hash['component_tags'] : SKIP
|
|
279
|
+
confidence = hash.key?('confidence') ? hash['confidence'] : SKIP
|
|
280
|
+
dependencies = hash.key?('dependencies') ? hash['dependencies'] : SKIP
|
|
281
|
+
epss_probability =
|
|
282
|
+
hash.key?('epss_probability') ? hash['epss_probability'] : SKIP
|
|
283
|
+
exposures = hash.key?('exposures') ? hash['exposures'] : SKIP
|
|
284
|
+
include_historical =
|
|
285
|
+
hash.key?('include_historical') ? hash['include_historical'] : SKIP
|
|
286
|
+
issue_ids = hash.key?('issue_ids') ? hash['issue_ids'] : SKIP
|
|
287
|
+
limit = hash['limit'] ||= 3000
|
|
288
|
+
new_note = hash.key?('new_note') ? hash['new_note'] : SKIP
|
|
289
|
+
new_triage_reason =
|
|
290
|
+
hash.key?('new_triage_reason') ? hash['new_triage_reason'] : SKIP
|
|
291
|
+
new_triage_state =
|
|
292
|
+
hash.key?('new_triage_state') ? hash['new_triage_state'] : SKIP
|
|
293
|
+
policies = hash.key?('policies') ? hash['policies'] : SKIP
|
|
294
|
+
policy_mode = hash.key?('policy_mode') ? hash['policy_mode'] : SKIP
|
|
295
|
+
pro_only = hash.key?('pro_only') ? hash['pro_only'] : SKIP
|
|
296
|
+
project_tags = hash.key?('project_tags') ? hash['project_tags'] : SKIP
|
|
297
|
+
ref = hash.key?('ref') ? hash['ref'] : SKIP
|
|
298
|
+
repos = hash.key?('repos') ? hash['repos'] : SKIP
|
|
299
|
+
repository_visibility =
|
|
300
|
+
hash.key?('repository_visibility') ? hash['repository_visibility'] : SKIP
|
|
301
|
+
rules = hash.key?('rules') ? hash['rules'] : SKIP
|
|
302
|
+
ruleset = hash.key?('ruleset') ? hash['ruleset'] : SKIP
|
|
303
|
+
secret_types = hash.key?('secret_types') ? hash['secret_types'] : SKIP
|
|
304
|
+
severities = hash.key?('severities') ? hash['severities'] : SKIP
|
|
305
|
+
since = hash.key?('since') ? hash['since'] : SKIP
|
|
306
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
307
|
+
transitivities =
|
|
308
|
+
hash.key?('transitivities') ? hash['transitivities'] : SKIP
|
|
309
|
+
triage_reasons =
|
|
310
|
+
hash.key?('triage_reasons') ? hash['triage_reasons'] : SKIP
|
|
311
|
+
validation_state =
|
|
312
|
+
hash.key?('validation_state') ? hash['validation_state'] : SKIP
|
|
313
|
+
|
|
314
|
+
# Create a new hash for additional properties, removing known properties.
|
|
315
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
316
|
+
|
|
317
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
318
|
+
new_hash, proc { |value| value }
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
# Create object from extracted values.
|
|
322
|
+
BulkTriageRequest.new(issue_type: issue_type,
|
|
323
|
+
autotriage_verdict: autotriage_verdict,
|
|
324
|
+
categories: categories,
|
|
325
|
+
component_tags: component_tags,
|
|
326
|
+
confidence: confidence,
|
|
327
|
+
dependencies: dependencies,
|
|
328
|
+
epss_probability: epss_probability,
|
|
329
|
+
exposures: exposures,
|
|
330
|
+
include_historical: include_historical,
|
|
331
|
+
issue_ids: issue_ids,
|
|
332
|
+
limit: limit,
|
|
333
|
+
new_note: new_note,
|
|
334
|
+
new_triage_reason: new_triage_reason,
|
|
335
|
+
new_triage_state: new_triage_state,
|
|
336
|
+
policies: policies,
|
|
337
|
+
policy_mode: policy_mode,
|
|
338
|
+
pro_only: pro_only,
|
|
339
|
+
project_tags: project_tags,
|
|
340
|
+
ref: ref,
|
|
341
|
+
repos: repos,
|
|
342
|
+
repository_visibility: repository_visibility,
|
|
343
|
+
rules: rules,
|
|
344
|
+
ruleset: ruleset,
|
|
345
|
+
secret_types: secret_types,
|
|
346
|
+
severities: severities,
|
|
347
|
+
since: since,
|
|
348
|
+
status: status,
|
|
349
|
+
transitivities: transitivities,
|
|
350
|
+
triage_reasons: triage_reasons,
|
|
351
|
+
validation_state: validation_state,
|
|
352
|
+
additional_properties: additional_properties)
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# Provides a human-readable string representation of the object.
|
|
356
|
+
def to_s
|
|
357
|
+
class_name = self.class.name.split('::').last
|
|
358
|
+
"<#{class_name} autotriage_verdict: #{@autotriage_verdict}, categories: #{@categories},"\
|
|
359
|
+
" component_tags: #{@component_tags}, confidence: #{@confidence}, dependencies:"\
|
|
360
|
+
" #{@dependencies}, epss_probability: #{@epss_probability}, exposures: #{@exposures},"\
|
|
361
|
+
" include_historical: #{@include_historical}, issue_ids: #{@issue_ids}, issue_type:"\
|
|
362
|
+
" #{@issue_type}, limit: #{@limit}, new_note: #{@new_note}, new_triage_reason:"\
|
|
363
|
+
" #{@new_triage_reason}, new_triage_state: #{@new_triage_state}, policies: #{@policies},"\
|
|
364
|
+
" policy_mode: #{@policy_mode}, pro_only: #{@pro_only}, project_tags: #{@project_tags}, ref:"\
|
|
365
|
+
" #{@ref}, repos: #{@repos}, repository_visibility: #{@repository_visibility}, rules:"\
|
|
366
|
+
" #{@rules}, ruleset: #{@ruleset}, secret_types: #{@secret_types}, severities:"\
|
|
367
|
+
" #{@severities}, since: #{@since}, status: #{@status}, transitivities: #{@transitivities},"\
|
|
368
|
+
" triage_reasons: #{@triage_reasons}, validation_state: #{@validation_state},"\
|
|
369
|
+
" additional_properties: #{@additional_properties}>"
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
373
|
+
def inspect
|
|
374
|
+
class_name = self.class.name.split('::').last
|
|
375
|
+
"<#{class_name} autotriage_verdict: #{@autotriage_verdict.inspect}, categories:"\
|
|
376
|
+
" #{@categories.inspect}, component_tags: #{@component_tags.inspect}, confidence:"\
|
|
377
|
+
" #{@confidence.inspect}, dependencies: #{@dependencies.inspect}, epss_probability:"\
|
|
378
|
+
" #{@epss_probability.inspect}, exposures: #{@exposures.inspect}, include_historical:"\
|
|
379
|
+
" #{@include_historical.inspect}, issue_ids: #{@issue_ids.inspect}, issue_type:"\
|
|
380
|
+
" #{@issue_type.inspect}, limit: #{@limit.inspect}, new_note: #{@new_note.inspect},"\
|
|
381
|
+
" new_triage_reason: #{@new_triage_reason.inspect}, new_triage_state:"\
|
|
382
|
+
" #{@new_triage_state.inspect}, policies: #{@policies.inspect}, policy_mode:"\
|
|
383
|
+
" #{@policy_mode.inspect}, pro_only: #{@pro_only.inspect}, project_tags:"\
|
|
384
|
+
" #{@project_tags.inspect}, ref: #{@ref.inspect}, repos: #{@repos.inspect},"\
|
|
385
|
+
" repository_visibility: #{@repository_visibility.inspect}, rules: #{@rules.inspect},"\
|
|
386
|
+
" ruleset: #{@ruleset.inspect}, secret_types: #{@secret_types.inspect}, severities:"\
|
|
387
|
+
" #{@severities.inspect}, since: #{@since.inspect}, status: #{@status.inspect},"\
|
|
388
|
+
" transitivities: #{@transitivities.inspect}, triage_reasons: #{@triage_reasons.inspect},"\
|
|
389
|
+
" validation_state: #{@validation_state.inspect}, additional_properties:"\
|
|
390
|
+
" #{@additional_properties}>"
|
|
391
|
+
end
|
|
392
|
+
end
|
|
393
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
# BulkTriageResponse Model.
|
|
8
|
+
class BulkTriageResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Number of items updated
|
|
13
|
+
# @return [Integer]
|
|
14
|
+
attr_accessor :num_triaged
|
|
15
|
+
|
|
16
|
+
# List of triaged issue IDs
|
|
17
|
+
# @return [Array[Integer]]
|
|
18
|
+
attr_accessor :triaged_issues
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['num_triaged'] = 'num_triaged'
|
|
24
|
+
@_hash['triaged_issues'] = 'triaged_issues'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(num_triaged:, triaged_issues:, additional_properties: nil)
|
|
39
|
+
# Add additional model properties to the instance
|
|
40
|
+
additional_properties = {} if additional_properties.nil?
|
|
41
|
+
|
|
42
|
+
@num_triaged = num_triaged
|
|
43
|
+
@triaged_issues = triaged_issues
|
|
44
|
+
@additional_properties = additional_properties
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Creates an instance of the object from a hash.
|
|
48
|
+
def self.from_hash(hash)
|
|
49
|
+
return nil unless hash
|
|
50
|
+
|
|
51
|
+
# Extract variables from the hash.
|
|
52
|
+
num_triaged = hash.key?('num_triaged') ? hash['num_triaged'] : nil
|
|
53
|
+
triaged_issues =
|
|
54
|
+
hash.key?('triaged_issues') ? hash['triaged_issues'] : nil
|
|
55
|
+
|
|
56
|
+
# Create a new hash for additional properties, removing known properties.
|
|
57
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
58
|
+
|
|
59
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
60
|
+
new_hash, proc { |value| value }
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# Create object from extracted values.
|
|
64
|
+
BulkTriageResponse.new(num_triaged: num_triaged,
|
|
65
|
+
triaged_issues: triaged_issues,
|
|
66
|
+
additional_properties: additional_properties)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} num_triaged: #{@num_triaged}, triaged_issues: #{@triaged_issues},"\
|
|
73
|
+
" additional_properties: #{@additional_properties}>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
77
|
+
def inspect
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} num_triaged: #{@num_triaged.inspect}, triaged_issues:"\
|
|
80
|
+
" #{@triaged_issues.inspect}, additional_properties: #{@additional_properties}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
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
|
+
# A failed PR creation attempt by Semgrep's Click to Fix feature
|
|
8
|
+
class ClickToFixFailure < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# When this failure occurred
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :created_at
|
|
15
|
+
|
|
16
|
+
# Reason for the PR creation failure
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :reason
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['created_at'] = 'created_at'
|
|
24
|
+
@_hash['reason'] = 'reason'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
created_at
|
|
32
|
+
reason
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(created_at: SKIP, reason: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@created_at = created_at unless created_at == SKIP
|
|
46
|
+
@reason = reason unless reason == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
|
|
56
|
+
reason = hash.key?('reason') ? hash['reason'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
ClickToFixFailure.new(created_at: created_at,
|
|
67
|
+
reason: reason,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Validates an instance of the object from a given value.
|
|
72
|
+
# @param [ClickToFixFailure | Hash] The value against the validation is performed.
|
|
73
|
+
def self.validate(value)
|
|
74
|
+
return true if value.instance_of? self
|
|
75
|
+
|
|
76
|
+
return false unless value.instance_of? Hash
|
|
77
|
+
|
|
78
|
+
true
|
|
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} created_at: #{@created_at}, reason: #{@reason}, 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} created_at: #{@created_at.inspect}, reason: #{@reason.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
|
+
# A pull request created by Semgrep's Click to Fix feature
|
|
8
|
+
class ClickToFixPr < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# When this PR was created
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :created_at
|
|
15
|
+
|
|
16
|
+
# URL of the pull request
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :url
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['created_at'] = 'created_at'
|
|
24
|
+
@_hash['url'] = 'url'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
created_at
|
|
32
|
+
url
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(created_at: SKIP, url: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@created_at = created_at unless created_at == SKIP
|
|
46
|
+
@url = url unless url == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
|
|
56
|
+
url = hash.key?('url') ? hash['url'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
ClickToFixPr.new(created_at: created_at,
|
|
67
|
+
url: url,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Validates an instance of the object from a given value.
|
|
72
|
+
# @param [ClickToFixPr | Hash] The value against the validation is performed.
|
|
73
|
+
def self.validate(value)
|
|
74
|
+
return true if value.instance_of? self
|
|
75
|
+
|
|
76
|
+
return false unless value.instance_of? Hash
|
|
77
|
+
|
|
78
|
+
true
|
|
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} created_at: #{@created_at}, 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} created_at: #{@created_at.inspect}, url: #{@url.inspect},"\
|
|
92
|
+
" additional_properties: #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|