Class: SemgrepWebApp::ListDependenciesResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SemgrepWebApp::ListDependenciesResponse
- Defined in:
- lib/semgrep_web_app/models/list_dependencies_response.rb
Overview
ListDependenciesResponse Model.
Instance Attribute Summary collapse
-
#cursor ⇒ String
Pass to next request to get next page of results.
-
#dependencies ⇒ Array[ProtosScaV1FoundDependency]
List of dependencies.
-
#has_more ⇒ TrueClass | FalseClass
True if there are more dependencies to get.
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(dependencies:, has_more:, cursor: SKIP, additional_properties: nil) ⇒ ListDependenciesResponse
constructor
A new instance of ListDependenciesResponse.
-
#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(dependencies:, has_more:, cursor: SKIP, additional_properties: nil) ⇒ ListDependenciesResponse
Returns a new instance of ListDependenciesResponse.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 45 def initialize(dependencies:, has_more:, cursor: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @cursor = cursor unless cursor == SKIP @dependencies = dependencies @has_more = has_more @additional_properties = additional_properties end |
Instance Attribute Details
#cursor ⇒ String
Pass to next request to get next page of results.
14 15 16 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 14 def cursor @cursor end |
#dependencies ⇒ Array[ProtosScaV1FoundDependency]
List of dependencies.
18 19 20 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 18 def dependencies @dependencies end |
#has_more ⇒ TrueClass | FalseClass
True if there are more dependencies to get.
22 23 24 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 22 def has_more @has_more end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it dependencies = nil unless hash['dependencies'].nil? dependencies = [] hash['dependencies'].each do |structure| dependencies << (ProtosScaV1FoundDependency.from_hash(structure) if structure) end end dependencies = nil unless hash.key?('dependencies') has_more = hash.key?('hasMore') ? hash['hasMore'] : nil cursor = hash.key?('cursor') ? hash['cursor'] : 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. ListDependenciesResponse.new(dependencies: dependencies, has_more: has_more, cursor: cursor, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['cursor'] = 'cursor' @_hash['dependencies'] = 'dependencies' @_hash['has_more'] = 'hasMore' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 34 def self.optionals %w[ cursor ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
96 97 98 99 100 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 96 def inspect class_name = self.class.name.split('::').last "<#{class_name} cursor: #{@cursor.inspect}, dependencies: #{@dependencies.inspect},"\ " has_more: #{@has_more.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
89 90 91 92 93 |
# File 'lib/semgrep_web_app/models/list_dependencies_response.rb', line 89 def to_s class_name = self.class.name.split('::').last "<#{class_name} cursor: #{@cursor}, dependencies: #{@dependencies}, has_more: #{@has_more},"\ " additional_properties: #{@additional_properties}>" end |