# 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/vertexai/property/nasjob_nas_job_output_multi_trial_job_output_search_trials_final_measurement'
require 'google/vertexai/property/nasjob_nas_job_output_multi_trial_job_output_search_trials_final_measurement_metrics'
module GoogleInSpec
  module VertexAI
    module Property
      class NasJobNasJobOutputMultiTrialJobOutputSearchTrials
        attr_reader :id

        attr_reader :state

        attr_reader :final_measurement

        attr_reader :start_time

        attr_reader :end_time

        def initialize(args = nil, parent_identifier = nil)
          return if args.nil?
          @parent_identifier = parent_identifier
          @id = args['id']
          @state = args['state']
          @final_measurement = GoogleInSpec::VertexAI::Property::NasJobNasJobOutputMultiTrialJobOutputSearchTrialsFinalMeasurement.new(args['finalMeasurement'], to_s)
          @start_time = args['startTime']
          @end_time = args['endTime']
        end

        def to_s
          "#{@parent_identifier} NasJobNasJobOutputMultiTrialJobOutputSearchTrials"
        end
      end

      class NasJobNasJobOutputMultiTrialJobOutputSearchTrialsArray
        def self.parse(value, parent_identifier)
          return if value.nil?
          return NasJobNasJobOutputMultiTrialJobOutputSearchTrials.new(value, parent_identifier) unless value.is_a?(::Array)
          value.map { |v| NasJobNasJobOutputMultiTrialJobOutputSearchTrials.new(v, parent_identifier) }
        end
      end
    end
  end
end
