Class: Google::Apis::SecuritycenterV1::File

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/securitycenter_v1/classes.rb,
lib/google/apis/securitycenter_v1/representations.rb,
lib/google/apis/securitycenter_v1/representations.rb

Overview

File information about the related binary/library used by an executable, or the script used by a script interpreter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ File

Returns a new instance of File.



813
814
815
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 813

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#contentsString

Prefix of the file contents as a JSON encoded string. (Currently only populated for Malicious Script Executed findings.) Corresponds to the JSON property contents

Returns:

  • (String)


783
784
785
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 783

def contents
  @contents
end

#hashed_sizeFixnum

The length in bytes of the file prefix that was hashed. If hashed_size == size, any hashes reported represent the entire file. Corresponds to the JSON property hashedSize

Returns:

  • (Fixnum)


789
790
791
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 789

def hashed_size
  @hashed_size
end

#partially_hashedBoolean Also known as: partially_hashed?

True when the hash covers only a prefix of the file. Corresponds to the JSON property partiallyHashed

Returns:

  • (Boolean)


794
795
796
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 794

def partially_hashed
  @partially_hashed
end

#pathString

Absolute path of the file as a JSON encoded string. Corresponds to the JSON property path

Returns:

  • (String)


800
801
802
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 800

def path
  @path
end

#sha256String

SHA256 hash of the first hashed_size bytes of the file encoded as a hex string. If hashed_size == size, sha256 represents the SHA256 hash of the entire file. Corresponds to the JSON property sha256

Returns:

  • (String)


806
807
808
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 806

def sha256
  @sha256
end

#sizeFixnum

Size of the file in bytes. Corresponds to the JSON property size

Returns:

  • (Fixnum)


811
812
813
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 811

def size
  @size
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



818
819
820
821
822
823
824
825
# File 'lib/google/apis/securitycenter_v1/classes.rb', line 818

def update!(**args)
  @contents = args[:contents] if args.key?(:contents)
  @hashed_size = args[:hashed_size] if args.key?(:hashed_size)
  @partially_hashed = args[:partially_hashed] if args.key?(:partially_hashed)
  @path = args[:path] if args.key?(:path)
  @sha256 = args[:sha256] if args.key?(:sha256)
  @size = args[:size] if args.key?(:size)
end