# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
#     ***     AUTO GENERATED CODE    ***    Type: MMv1     ***
#
# ----------------------------------------------------------------------------
#
#     This file is automatically generated by Magic Modules and manual
#     changes will be clobbered when the file is regenerated.
#
#     Please read more about how to change this file in README.md and
#     CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/compute/property/imagefamilyview_image_deprecated'
require 'google/compute/property/imagefamilyview_image_image_encryption_key'
require 'google/compute/property/imagefamilyview_image_raw_disk'
require 'google/compute/property/imagefamilyview_image_source_disk_encryption_key'
require 'google/compute/property/imagefamilyview_image_source_snapshot_encryption_key'
require 'google/compute/property/imagefamilyview_image_source_snapshot_encryption_key_dbs'
require 'google/compute/property/imagefamilyview_image_source_snapshot_encryption_key_dbxs'
require 'google/compute/property/imagefamilyview_image_source_snapshot_encryption_key_keks'
require 'google/compute/property/imagefamilyview_image_source_snapshot_encryption_key_pk'
module GoogleInSpec
  module Compute
    module Property
      class ImageFamilyViewImage
        attr_reader :creation_timestamp

        attr_reader :description

        attr_reader :id

        attr_reader :name

        attr_reader :source_type

        attr_reader :deprecated

        attr_reader :raw_disk

        attr_reader :status

        attr_reader :archive_size_bytes

        attr_reader :disk_size_gb

        attr_reader :source_disk

        attr_reader :source_disk_id

        attr_reader :licenses

        attr_reader :storage_locations

        attr_reader :family

        attr_reader :image_encryption_key

        attr_reader :source_disk_encryption_key

        attr_reader :source_snapshot_encryption_key

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @creation_timestamp = parse_time_string(args['creationTimestamp'])
          @description = args['description']
          @id = args['id']
          @name = args['name']
          @source_type = args['sourceType']
          @deprecated = GoogleInSpec::Compute::Property::ImageFamilyViewImageDeprecated.new(args['deprecated'], to_s)
          @raw_disk = GoogleInSpec::Compute::Property::ImageFamilyViewImageRawDisk.new(args['rawDisk'], to_s)
          @status = args['status']
          @archive_size_bytes = args['archiveSizeBytes']
          @disk_size_gb = args['diskSizeGb']
          @source_disk = args['sourceDisk']
          @source_disk_id = args['sourceDiskId']
          @licenses = args['licenses']
          @storage_locations = args['storageLocations']
          @family = args['family']
          @image_encryption_key = GoogleInSpec::Compute::Property::ImageFamilyViewImageImageEncryptionKey.new(args['imageEncryptionKey'], to_s)
          @source_disk_encryption_key = GoogleInSpec::Compute::Property::ImageFamilyViewImageSourceDiskEncryptionKey.new(args['sourceDiskEncryptionKey'], to_s)
          @source_snapshot_encryption_key = GoogleInSpec::Compute::Property::ImageFamilyViewImageSourceSnapshotEncryptionKey.new(args['sourceSnapshotEncryptionKey'], to_s)
        end

        def to_s
          "#{@parent_identifier} ImageFamilyViewImage"
        end

        # Handles parsing RFC3339 time string
        def parse_time_string(time_string)
          time_string ? Time.parse(time_string) : nil
        end
      end
    end
  end
end
