Class: SemgrepWebApp::ProtosSecretsV1SecretsFindingRepository
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SemgrepWebApp::ProtosSecretsV1SecretsFindingRepository
- Defined in:
- lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb
Overview
Repository where the finding was detected.
Instance Attribute Summary collapse
-
#name ⇒ String
Repository name.
-
#scm_type ⇒ ScmType
Provider for the finding (e.g. GitHub, GitLab, GHE, etc).
-
#url ⇒ String
URL to the repository where the finding was detected.
-
#visibility ⇒ Visibility
Repository visbility (e.g. public, private, unknown).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name: SKIP, scm_type: SKIP, url: SKIP, visibility: SKIP, additional_properties: nil) ⇒ ProtosSecretsV1SecretsFindingRepository
constructor
A new instance of ProtosSecretsV1SecretsFindingRepository.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(name: SKIP, scm_type: SKIP, url: SKIP, visibility: SKIP, additional_properties: nil) ⇒ ProtosSecretsV1SecretsFindingRepository
Returns a new instance of ProtosSecretsV1SecretsFindingRepository.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 69 def initialize(name: SKIP, scm_type: SKIP, url: SKIP, visibility: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name unless name == SKIP @scm_type = scm_type unless scm_type == SKIP @url = url unless url == SKIP @visibility = visibility unless visibility == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#name ⇒ String
Repository name
14 15 16 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 14 def name @name end |
#scm_type ⇒ ScmType
Provider for the finding (e.g. GitHub, GitLab, GHE, etc).
| value | description |
|---|---|
| SCM_TYPE_GITHUB | GitHub Cloud |
| SCM_TYPE_GITHUB_ENTERPRISE | GitHub Enterprise |
| SCM_TYPE_GITLAB | GitLab Cloud |
| SCM_TYPE_GITLAB_SELFMANAGED | GitLab Self-Managed |
| SCM_TYPE_BITBUCKET | Bitbucket Cloud |
| SCM_TYPE_BITBUCKET_DATACENTER | Bitbucket Data Center |
| SCM_TYPE_AZURE_DEVOPS | Azure DevOps |
| SCM_TYPE_UNKNOWN | |
| SCM_TYPE_HARNESS | Harness |
29 30 31 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 29 def scm_type @scm_type end |
#url ⇒ String
URL to the repository where the finding was detected.
33 34 35 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 33 def url @url end |
#visibility ⇒ Visibility
Repository visbility (e.g. public, private, unknown).
| value | description |
|---|---|
| REPOSITORY_VISIBILITY_PUBLIC | |
| REPOSITORY_VISIBILITY_PRIVATE | |
| REPOSITORY_VISIBILITY_UNKNOWN |
42 43 44 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 42 def visibility @visibility end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP scm_type = hash.key?('scmType') ? hash['scmType'] : SKIP url = hash.key?('url') ? hash['url'] : SKIP visibility = hash.key?('visibility') ? hash['visibility'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ProtosSecretsV1SecretsFindingRepository.new(name: name, scm_type: scm_type, url: url, visibility: visibility, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['scm_type'] = 'scmType' @_hash['url'] = 'url' @_hash['visibility'] = 'visibility' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 58 59 60 61 62 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 55 def self.optionals %w[ name scm_type url visibility ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, scm_type: #{@scm_type.inspect}, url:"\ " #{@url.inspect}, visibility: #{@visibility.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
107 108 109 110 111 |
# File 'lib/semgrep_web_app/models/protos_secrets_v1_secrets_finding_repository.rb', line 107 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, scm_type: #{@scm_type}, url: #{@url}, visibility:"\ " #{@visibility}, additional_properties: #{@additional_properties}>" end |