# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2File do
  @moduledoc """
  File information about the related binary/library used by an executable, or the script used by a script interpreter

  ## Attributes

  *   `contents` (*type:* `String.t`, *default:* `nil`) - Prefix of the file contents as a JSON-encoded string.
  *   `diskPath` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2DiskPath.t`, *default:* `nil`) - Path of the file in terms of underlying disk/partition identifiers.
  *   `hashedSize` (*type:* `String.t`, *default:* `nil`) - The length in bytes of the file prefix that was hashed. If hashed_size == size, any hashes reported represent the entire file.
  *   `partiallyHashed` (*type:* `boolean()`, *default:* `nil`) - True when the hash covers only a prefix of the file.
  *   `path` (*type:* `String.t`, *default:* `nil`) - Absolute path of the file as a JSON encoded string.
  *   `sha256` (*type:* `String.t`, *default:* `nil`) - 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.
  *   `size` (*type:* `String.t`, *default:* `nil`) - Size of the file in bytes.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :contents => String.t() | nil,
          :diskPath =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2DiskPath.t() | nil,
          :hashedSize => String.t() | nil,
          :partiallyHashed => boolean() | nil,
          :path => String.t() | nil,
          :sha256 => String.t() | nil,
          :size => String.t() | nil
        }

  field(:contents)
  field(:diskPath, as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2DiskPath)
  field(:hashedSize)
  field(:partiallyHashed)
  field(:path)
  field(:sha256)
  field(:size)
end

defimpl Poison.Decoder, for: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2File do
  def decode(value, options) do
    GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2File.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2File do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
