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,256 @@
|
|
|
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
|
+
# ProtosOpenapiV1GetScanResponseScanMeta Model.
|
|
8
|
+
class ProtosOpenapiV1GetScanResponseScanMeta < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# What triggered this scan, if applicable.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :mtrue
|
|
15
|
+
|
|
16
|
+
# The branch that was scanned, if applicable.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :branch
|
|
19
|
+
|
|
20
|
+
# The commit SHA associated with the scan, if applicable.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :commit
|
|
23
|
+
|
|
24
|
+
# The path of the configuration file used for this scan, if applicable.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :config
|
|
27
|
+
|
|
28
|
+
# The URL of the scanned repository, if applicable.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :repo_url
|
|
31
|
+
|
|
32
|
+
# The URL of the CI job that ran the scan, if applicable.
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :ci_job_url
|
|
35
|
+
|
|
36
|
+
# The name and organization of the scanned repository, if applicable.
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :repository
|
|
39
|
+
|
|
40
|
+
# The commit message associated with the scan, if applicable.
|
|
41
|
+
# @return [String]
|
|
42
|
+
attr_accessor :commit_title
|
|
43
|
+
|
|
44
|
+
# The ID of the pull request associated with the scan, if applicable.
|
|
45
|
+
# @return [String]
|
|
46
|
+
attr_accessor :pull_request_id
|
|
47
|
+
|
|
48
|
+
# The title of the pull request associated with the scan if applicable.
|
|
49
|
+
# @return [String]
|
|
50
|
+
attr_accessor :pull_request_title
|
|
51
|
+
|
|
52
|
+
# The name of the author of the commit associated with the scan, if
|
|
53
|
+
# applicable.
|
|
54
|
+
# @return [String]
|
|
55
|
+
attr_accessor :commit_author_name
|
|
56
|
+
|
|
57
|
+
# The avatar image url of the author of the commit associated with the scan,
|
|
58
|
+
# if applicable.
|
|
59
|
+
# @return [String]
|
|
60
|
+
attr_accessor :commit_author_image_url
|
|
61
|
+
|
|
62
|
+
# The email of the author of the commit associated with the scan, if
|
|
63
|
+
# applicable.
|
|
64
|
+
# @return [String]
|
|
65
|
+
attr_accessor :commit_author_email
|
|
66
|
+
|
|
67
|
+
# The username of the author of the commit associated with the scan, if
|
|
68
|
+
# applicable.
|
|
69
|
+
# @return [String]
|
|
70
|
+
attr_accessor :commit_author_username
|
|
71
|
+
|
|
72
|
+
# The username of the author of the pull request associated with the scan,
|
|
73
|
+
# if applicable.
|
|
74
|
+
# @return [String]
|
|
75
|
+
attr_accessor :pull_request_author_username
|
|
76
|
+
|
|
77
|
+
# The avatar image url of the author of the pull request associated with the
|
|
78
|
+
# scan, if applicable.
|
|
79
|
+
# @return [String]
|
|
80
|
+
attr_accessor :pull_request_author_image_url
|
|
81
|
+
|
|
82
|
+
# A mapping from model property names to API property names.
|
|
83
|
+
def self.names
|
|
84
|
+
@_hash = {} if @_hash.nil?
|
|
85
|
+
@_hash['mtrue'] = 'true'
|
|
86
|
+
@_hash['branch'] = 'branch'
|
|
87
|
+
@_hash['commit'] = 'commit'
|
|
88
|
+
@_hash['config'] = 'config'
|
|
89
|
+
@_hash['repo_url'] = 'repo_url'
|
|
90
|
+
@_hash['ci_job_url'] = 'ci_job_url'
|
|
91
|
+
@_hash['repository'] = 'repository'
|
|
92
|
+
@_hash['commit_title'] = 'commit_title'
|
|
93
|
+
@_hash['pull_request_id'] = 'pull_request_id'
|
|
94
|
+
@_hash['pull_request_title'] = 'pull_request_title'
|
|
95
|
+
@_hash['commit_author_name'] = 'commit_author_name'
|
|
96
|
+
@_hash['commit_author_image_url'] = 'commit_author_image_url'
|
|
97
|
+
@_hash['commit_author_email'] = 'commit_author_email'
|
|
98
|
+
@_hash['commit_author_username'] = 'commit_author_username'
|
|
99
|
+
@_hash['pull_request_author_username'] = 'pull_request_author_username'
|
|
100
|
+
@_hash['pull_request_author_image_url'] =
|
|
101
|
+
'pull_request_author_image_url'
|
|
102
|
+
@_hash
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# An array for optional fields
|
|
106
|
+
def self.optionals
|
|
107
|
+
%w[
|
|
108
|
+
mtrue
|
|
109
|
+
branch
|
|
110
|
+
commit
|
|
111
|
+
config
|
|
112
|
+
repo_url
|
|
113
|
+
ci_job_url
|
|
114
|
+
repository
|
|
115
|
+
commit_title
|
|
116
|
+
pull_request_id
|
|
117
|
+
pull_request_title
|
|
118
|
+
commit_author_name
|
|
119
|
+
commit_author_image_url
|
|
120
|
+
commit_author_email
|
|
121
|
+
commit_author_username
|
|
122
|
+
pull_request_author_username
|
|
123
|
+
pull_request_author_image_url
|
|
124
|
+
]
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# An array for nullable fields
|
|
128
|
+
def self.nullables
|
|
129
|
+
[]
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def initialize(mtrue: SKIP, branch: SKIP, commit: SKIP, config: SKIP,
|
|
133
|
+
repo_url: SKIP, ci_job_url: SKIP, repository: SKIP,
|
|
134
|
+
commit_title: SKIP, pull_request_id: SKIP,
|
|
135
|
+
pull_request_title: SKIP, commit_author_name: SKIP,
|
|
136
|
+
commit_author_image_url: SKIP, commit_author_email: SKIP,
|
|
137
|
+
commit_author_username: SKIP,
|
|
138
|
+
pull_request_author_username: SKIP,
|
|
139
|
+
pull_request_author_image_url: SKIP,
|
|
140
|
+
additional_properties: nil)
|
|
141
|
+
# Add additional model properties to the instance
|
|
142
|
+
additional_properties = {} if additional_properties.nil?
|
|
143
|
+
|
|
144
|
+
@mtrue = mtrue unless mtrue == SKIP
|
|
145
|
+
@branch = branch unless branch == SKIP
|
|
146
|
+
@commit = commit unless commit == SKIP
|
|
147
|
+
@config = config unless config == SKIP
|
|
148
|
+
@repo_url = repo_url unless repo_url == SKIP
|
|
149
|
+
@ci_job_url = ci_job_url unless ci_job_url == SKIP
|
|
150
|
+
@repository = repository unless repository == SKIP
|
|
151
|
+
@commit_title = commit_title unless commit_title == SKIP
|
|
152
|
+
@pull_request_id = pull_request_id unless pull_request_id == SKIP
|
|
153
|
+
@pull_request_title = pull_request_title unless pull_request_title == SKIP
|
|
154
|
+
@commit_author_name = commit_author_name unless commit_author_name == SKIP
|
|
155
|
+
@commit_author_image_url = commit_author_image_url unless commit_author_image_url == SKIP
|
|
156
|
+
@commit_author_email = commit_author_email unless commit_author_email == SKIP
|
|
157
|
+
@commit_author_username = commit_author_username unless commit_author_username == SKIP
|
|
158
|
+
unless pull_request_author_username == SKIP
|
|
159
|
+
@pull_request_author_username =
|
|
160
|
+
pull_request_author_username
|
|
161
|
+
end
|
|
162
|
+
unless pull_request_author_image_url == SKIP
|
|
163
|
+
@pull_request_author_image_url =
|
|
164
|
+
pull_request_author_image_url
|
|
165
|
+
end
|
|
166
|
+
@additional_properties = additional_properties
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Creates an instance of the object from a hash.
|
|
170
|
+
def self.from_hash(hash)
|
|
171
|
+
return nil unless hash
|
|
172
|
+
|
|
173
|
+
# Extract variables from the hash.
|
|
174
|
+
mtrue = hash.key?('true') ? hash['true'] : SKIP
|
|
175
|
+
branch = hash.key?('branch') ? hash['branch'] : SKIP
|
|
176
|
+
commit = hash.key?('commit') ? hash['commit'] : SKIP
|
|
177
|
+
config = hash.key?('config') ? hash['config'] : SKIP
|
|
178
|
+
repo_url = hash.key?('repo_url') ? hash['repo_url'] : SKIP
|
|
179
|
+
ci_job_url = hash.key?('ci_job_url') ? hash['ci_job_url'] : SKIP
|
|
180
|
+
repository = hash.key?('repository') ? hash['repository'] : SKIP
|
|
181
|
+
commit_title = hash.key?('commit_title') ? hash['commit_title'] : SKIP
|
|
182
|
+
pull_request_id =
|
|
183
|
+
hash.key?('pull_request_id') ? hash['pull_request_id'] : SKIP
|
|
184
|
+
pull_request_title =
|
|
185
|
+
hash.key?('pull_request_title') ? hash['pull_request_title'] : SKIP
|
|
186
|
+
commit_author_name =
|
|
187
|
+
hash.key?('commit_author_name') ? hash['commit_author_name'] : SKIP
|
|
188
|
+
commit_author_image_url =
|
|
189
|
+
hash.key?('commit_author_image_url') ? hash['commit_author_image_url'] : SKIP
|
|
190
|
+
commit_author_email =
|
|
191
|
+
hash.key?('commit_author_email') ? hash['commit_author_email'] : SKIP
|
|
192
|
+
commit_author_username =
|
|
193
|
+
hash.key?('commit_author_username') ? hash['commit_author_username'] : SKIP
|
|
194
|
+
pull_request_author_username =
|
|
195
|
+
hash.key?('pull_request_author_username') ? hash['pull_request_author_username'] : SKIP
|
|
196
|
+
pull_request_author_image_url =
|
|
197
|
+
hash.key?('pull_request_author_image_url') ? hash['pull_request_author_image_url'] : SKIP
|
|
198
|
+
|
|
199
|
+
# Create a new hash for additional properties, removing known properties.
|
|
200
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
201
|
+
|
|
202
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
203
|
+
new_hash, proc { |value| value }
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
# Create object from extracted values.
|
|
207
|
+
ProtosOpenapiV1GetScanResponseScanMeta.new(mtrue: mtrue,
|
|
208
|
+
branch: branch,
|
|
209
|
+
commit: commit,
|
|
210
|
+
config: config,
|
|
211
|
+
repo_url: repo_url,
|
|
212
|
+
ci_job_url: ci_job_url,
|
|
213
|
+
repository: repository,
|
|
214
|
+
commit_title: commit_title,
|
|
215
|
+
pull_request_id: pull_request_id,
|
|
216
|
+
pull_request_title: pull_request_title,
|
|
217
|
+
commit_author_name: commit_author_name,
|
|
218
|
+
commit_author_image_url: commit_author_image_url,
|
|
219
|
+
commit_author_email: commit_author_email,
|
|
220
|
+
commit_author_username: commit_author_username,
|
|
221
|
+
pull_request_author_username: pull_request_author_username,
|
|
222
|
+
pull_request_author_image_url: pull_request_author_image_url,
|
|
223
|
+
additional_properties: additional_properties)
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Provides a human-readable string representation of the object.
|
|
227
|
+
def to_s
|
|
228
|
+
class_name = self.class.name.split('::').last
|
|
229
|
+
"<#{class_name} mtrue: #{@mtrue}, branch: #{@branch}, commit: #{@commit}, config:"\
|
|
230
|
+
" #{@config}, repo_url: #{@repo_url}, ci_job_url: #{@ci_job_url}, repository:"\
|
|
231
|
+
" #{@repository}, commit_title: #{@commit_title}, pull_request_id: #{@pull_request_id},"\
|
|
232
|
+
" pull_request_title: #{@pull_request_title}, commit_author_name: #{@commit_author_name},"\
|
|
233
|
+
" commit_author_image_url: #{@commit_author_image_url}, commit_author_email:"\
|
|
234
|
+
" #{@commit_author_email}, commit_author_username: #{@commit_author_username},"\
|
|
235
|
+
" pull_request_author_username: #{@pull_request_author_username},"\
|
|
236
|
+
" pull_request_author_image_url: #{@pull_request_author_image_url}, additional_properties:"\
|
|
237
|
+
" #{@additional_properties}>"
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
241
|
+
def inspect
|
|
242
|
+
class_name = self.class.name.split('::').last
|
|
243
|
+
"<#{class_name} mtrue: #{@mtrue.inspect}, branch: #{@branch.inspect}, commit:"\
|
|
244
|
+
" #{@commit.inspect}, config: #{@config.inspect}, repo_url: #{@repo_url.inspect},"\
|
|
245
|
+
" ci_job_url: #{@ci_job_url.inspect}, repository: #{@repository.inspect}, commit_title:"\
|
|
246
|
+
" #{@commit_title.inspect}, pull_request_id: #{@pull_request_id.inspect},"\
|
|
247
|
+
" pull_request_title: #{@pull_request_title.inspect}, commit_author_name:"\
|
|
248
|
+
" #{@commit_author_name.inspect}, commit_author_image_url:"\
|
|
249
|
+
" #{@commit_author_image_url.inspect}, commit_author_email: #{@commit_author_email.inspect},"\
|
|
250
|
+
" commit_author_username: #{@commit_author_username.inspect}, pull_request_author_username:"\
|
|
251
|
+
" #{@pull_request_author_username.inspect}, pull_request_author_image_url:"\
|
|
252
|
+
" #{@pull_request_author_image_url.inspect}, additional_properties:"\
|
|
253
|
+
" #{@additional_properties}>"
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
# ProtosOpenapiV1LinkTicketResponse Model.
|
|
8
|
+
class ProtosOpenapiV1LinkTicketResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The external slug identifier for the ticket (e.g. SEC-123)
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :external_slug
|
|
15
|
+
|
|
16
|
+
# List of finding IDs that were successfully linked to the ticket
|
|
17
|
+
# @return [Array[String]]
|
|
18
|
+
attr_accessor :linked_issue_ids
|
|
19
|
+
|
|
20
|
+
# List of finding IDs where an existing ticket link was replaced
|
|
21
|
+
# @return [Array[String]]
|
|
22
|
+
attr_accessor :replaced_issue_ids
|
|
23
|
+
|
|
24
|
+
# The internal ID of the linked ticket record
|
|
25
|
+
# @return [Integer]
|
|
26
|
+
attr_accessor :ticket_id
|
|
27
|
+
|
|
28
|
+
# The URL of the linked ticket
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :ticket_url
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['external_slug'] = 'external_slug'
|
|
36
|
+
@_hash['linked_issue_ids'] = 'linked_issue_ids'
|
|
37
|
+
@_hash['replaced_issue_ids'] = 'replaced_issue_ids'
|
|
38
|
+
@_hash['ticket_id'] = 'ticket_id'
|
|
39
|
+
@_hash['ticket_url'] = 'ticket_url'
|
|
40
|
+
@_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for optional fields
|
|
44
|
+
def self.optionals
|
|
45
|
+
%w[
|
|
46
|
+
external_slug
|
|
47
|
+
linked_issue_ids
|
|
48
|
+
replaced_issue_ids
|
|
49
|
+
ticket_id
|
|
50
|
+
ticket_url
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for nullable fields
|
|
55
|
+
def self.nullables
|
|
56
|
+
[]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def initialize(external_slug: SKIP, linked_issue_ids: SKIP,
|
|
60
|
+
replaced_issue_ids: SKIP, ticket_id: SKIP, ticket_url: SKIP,
|
|
61
|
+
additional_properties: nil)
|
|
62
|
+
# Add additional model properties to the instance
|
|
63
|
+
additional_properties = {} if additional_properties.nil?
|
|
64
|
+
|
|
65
|
+
@external_slug = external_slug unless external_slug == SKIP
|
|
66
|
+
@linked_issue_ids = linked_issue_ids unless linked_issue_ids == SKIP
|
|
67
|
+
@replaced_issue_ids = replaced_issue_ids unless replaced_issue_ids == SKIP
|
|
68
|
+
@ticket_id = ticket_id unless ticket_id == SKIP
|
|
69
|
+
@ticket_url = ticket_url unless ticket_url == SKIP
|
|
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
|
+
external_slug = hash.key?('external_slug') ? hash['external_slug'] : SKIP
|
|
79
|
+
linked_issue_ids =
|
|
80
|
+
hash.key?('linked_issue_ids') ? hash['linked_issue_ids'] : SKIP
|
|
81
|
+
replaced_issue_ids =
|
|
82
|
+
hash.key?('replaced_issue_ids') ? hash['replaced_issue_ids'] : SKIP
|
|
83
|
+
ticket_id = hash.key?('ticket_id') ? hash['ticket_id'] : SKIP
|
|
84
|
+
ticket_url = hash.key?('ticket_url') ? hash['ticket_url'] : SKIP
|
|
85
|
+
|
|
86
|
+
# Create a new hash for additional properties, removing known properties.
|
|
87
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
88
|
+
|
|
89
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
90
|
+
new_hash, proc { |value| value }
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Create object from extracted values.
|
|
94
|
+
ProtosOpenapiV1LinkTicketResponse.new(external_slug: external_slug,
|
|
95
|
+
linked_issue_ids: linked_issue_ids,
|
|
96
|
+
replaced_issue_ids: replaced_issue_ids,
|
|
97
|
+
ticket_id: ticket_id,
|
|
98
|
+
ticket_url: ticket_url,
|
|
99
|
+
additional_properties: additional_properties)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Provides a human-readable string representation of the object.
|
|
103
|
+
def to_s
|
|
104
|
+
class_name = self.class.name.split('::').last
|
|
105
|
+
"<#{class_name} external_slug: #{@external_slug}, linked_issue_ids: #{@linked_issue_ids},"\
|
|
106
|
+
" replaced_issue_ids: #{@replaced_issue_ids}, ticket_id: #{@ticket_id}, ticket_url:"\
|
|
107
|
+
" #{@ticket_url}, additional_properties: #{@additional_properties}>"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
111
|
+
def inspect
|
|
112
|
+
class_name = self.class.name.split('::').last
|
|
113
|
+
"<#{class_name} external_slug: #{@external_slug.inspect}, linked_issue_ids:"\
|
|
114
|
+
" #{@linked_issue_ids.inspect}, replaced_issue_ids: #{@replaced_issue_ids.inspect},"\
|
|
115
|
+
" ticket_id: #{@ticket_id.inspect}, ticket_url: #{@ticket_url.inspect},"\
|
|
116
|
+
" additional_properties: #{@additional_properties}>"
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
# ProtosOpenapiV1ListDeploymentsResponse Model.
|
|
8
|
+
class ProtosOpenapiV1ListDeploymentsResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Return the deployment the supplied token can access.
|
|
13
|
+
# @return [Array[Deployment]]
|
|
14
|
+
attr_accessor :deployments
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['deployments'] = 'deployments'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
deployments
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(deployments: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@deployments = deployments unless deployments == SKIP
|
|
40
|
+
@additional_properties = additional_properties
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
# Parameter is an array, so we need to iterate through it
|
|
49
|
+
deployments = nil
|
|
50
|
+
unless hash['deployments'].nil?
|
|
51
|
+
deployments = []
|
|
52
|
+
hash['deployments'].each do |structure|
|
|
53
|
+
deployments << (Deployment.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
deployments = SKIP unless hash.key?('deployments')
|
|
58
|
+
|
|
59
|
+
# Create a new hash for additional properties, removing known properties.
|
|
60
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
61
|
+
|
|
62
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
63
|
+
new_hash, proc { |value| value }
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Create object from extracted values.
|
|
67
|
+
ProtosOpenapiV1ListDeploymentsResponse.new(deployments: deployments,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} deployments: #{@deployments}, additional_properties:"\
|
|
75
|
+
" #{@additional_properties}>"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
79
|
+
def inspect
|
|
80
|
+
class_name = self.class.name.split('::').last
|
|
81
|
+
"<#{class_name} deployments: #{@deployments.inspect}, additional_properties:"\
|
|
82
|
+
" #{@additional_properties}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# semgrep_web_app
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SemgrepWebApp
|
|
7
|
+
# ProtosOpenapiV1ListPoliciesResponse Model.
|
|
8
|
+
class ProtosOpenapiV1ListPoliciesResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# List of Policies associated with the given Deployment.
|
|
13
|
+
# @return [Array[Policy]]
|
|
14
|
+
attr_accessor :policies
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['policies'] = 'policies'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
policies
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(policies: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@policies = policies unless policies == SKIP
|
|
40
|
+
@additional_properties = additional_properties
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
# Parameter is an array, so we need to iterate through it
|
|
49
|
+
policies = nil
|
|
50
|
+
unless hash['policies'].nil?
|
|
51
|
+
policies = []
|
|
52
|
+
hash['policies'].each do |structure|
|
|
53
|
+
policies << (Policy.from_hash(structure) if structure)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
policies = SKIP unless hash.key?('policies')
|
|
58
|
+
|
|
59
|
+
# Create a new hash for additional properties, removing known properties.
|
|
60
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
61
|
+
|
|
62
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
63
|
+
new_hash, proc { |value| value }
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Create object from extracted values.
|
|
67
|
+
ProtosOpenapiV1ListPoliciesResponse.new(policies: policies,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Provides a human-readable string representation of the object.
|
|
72
|
+
def to_s
|
|
73
|
+
class_name = self.class.name.split('::').last
|
|
74
|
+
"<#{class_name} policies: #{@policies}, additional_properties: #{@additional_properties}>"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
78
|
+
def inspect
|
|
79
|
+
class_name = self.class.name.split('::').last
|
|
80
|
+
"<#{class_name} policies: #{@policies.inspect}, additional_properties:"\
|
|
81
|
+
" #{@additional_properties}>"
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
# ProtosOpenapiV1ListPolicyRulesResponse Model.
|
|
8
|
+
class ProtosOpenapiV1ListPolicyRulesResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Cursor to paginate through the rules.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :cursor
|
|
15
|
+
|
|
16
|
+
# Cursor to paginate through the rules.
|
|
17
|
+
# @return [Policy]
|
|
18
|
+
attr_accessor :policy
|
|
19
|
+
|
|
20
|
+
# List of Rules for the given Policy.
|
|
21
|
+
# @return [Array[Rule]]
|
|
22
|
+
attr_accessor :rules
|
|
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['policy'] = 'policy'
|
|
29
|
+
@_hash['rules'] = 'rules'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
cursor
|
|
37
|
+
policy
|
|
38
|
+
rules
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(cursor: SKIP, policy: SKIP, rules: SKIP,
|
|
48
|
+
additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@cursor = cursor unless cursor == SKIP
|
|
53
|
+
@policy = policy unless policy == SKIP
|
|
54
|
+
@rules = rules unless rules == 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
|
+
cursor = hash.key?('cursor') ? hash['cursor'] : SKIP
|
|
64
|
+
policy = Policy.from_hash(hash['policy']) if hash['policy']
|
|
65
|
+
# Parameter is an array, so we need to iterate through it
|
|
66
|
+
rules = nil
|
|
67
|
+
unless hash['rules'].nil?
|
|
68
|
+
rules = []
|
|
69
|
+
hash['rules'].each do |structure|
|
|
70
|
+
rules << (Rule.from_hash(structure) if structure)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
rules = SKIP unless hash.key?('rules')
|
|
75
|
+
|
|
76
|
+
# Create a new hash for additional properties, removing known properties.
|
|
77
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
new_hash, proc { |value| value }
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Create object from extracted values.
|
|
84
|
+
ProtosOpenapiV1ListPolicyRulesResponse.new(cursor: cursor,
|
|
85
|
+
policy: policy,
|
|
86
|
+
rules: rules,
|
|
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} cursor: #{@cursor}, policy: #{@policy}, rules: #{@rules},"\
|
|
94
|
+
" 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} cursor: #{@cursor.inspect}, policy: #{@policy.inspect}, rules:"\
|
|
101
|
+
" #{@rules.inspect}, additional_properties: #{@additional_properties}>"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|