# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::MachineLearningServices::Mgmt::V2018_11_19
  module Models
    #
    # Machine Learning compute object.
    #
    class Compute

      include MsRestAzure

      @@discriminatorMap = Hash.new
      @@discriminatorMap["AKS"] = "AKS"
      @@discriminatorMap["AmlCompute"] = "AmlCompute"
      @@discriminatorMap["VirtualMachine"] = "VirtualMachine"
      @@discriminatorMap["HDInsight"] = "HDInsight"
      @@discriminatorMap["DataFactory"] = "DataFactory"
      @@discriminatorMap["Databricks"] = "Databricks"
      @@discriminatorMap["DataLakeAnalytics"] = "DataLakeAnalytics"

      def initialize
        @computeType = "Compute"
      end

      attr_accessor :computeType

      # @return [String] Location for the underlying compute
      attr_accessor :compute_location

      # @return [ProvisioningState] The provision state of the cluster. Valid
      # values are Unknown, Updating, Provisioning, Succeeded, and Failed.
      # Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting',
      # 'Succeeded', 'Failed', 'Canceled'
      attr_accessor :provisioning_state

      # @return [String] The description of the Machine Learning compute.
      attr_accessor :description

      # @return [DateTime] The date and time when the compute was created.
      attr_accessor :created_on

      # @return [DateTime] The date and time when the compute was last
      # modified.
      attr_accessor :modified_on

      # @return [String] ARM resource id of the underlying compute
      attr_accessor :resource_id

      # @return [Array<MachineLearningServiceError>] Errors during provisioning
      attr_accessor :provisioning_errors

      # @return [Boolean] Indicating whether the compute was provisioned by
      # user and brought from outside if true, or machine learning service
      # provisioned it if false.
      attr_accessor :is_attached_compute


      #
      # Mapper for Compute class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Compute',
          type: {
            name: 'Composite',
            polymorphic_discriminator: 'computeType',
            uber_parent: 'Compute',
            class_name: 'Compute',
            model_properties: {
              compute_location: {
                client_side_validation: true,
                required: false,
                serialized_name: 'computeLocation',
                type: {
                  name: 'String'
                }
              },
              provisioning_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'provisioningState',
                type: {
                  name: 'String'
                }
              },
              description: {
                client_side_validation: true,
                required: false,
                serialized_name: 'description',
                type: {
                  name: 'String'
                }
              },
              created_on: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'createdOn',
                type: {
                  name: 'DateTime'
                }
              },
              modified_on: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'modifiedOn',
                type: {
                  name: 'DateTime'
                }
              },
              resource_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'resourceId',
                type: {
                  name: 'String'
                }
              },
              provisioning_errors: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'provisioningErrors',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'MachineLearningServiceErrorElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'MachineLearningServiceError'
                      }
                  }
                }
              },
              is_attached_compute: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'isAttachedCompute',
                type: {
                  name: 'Boolean'
                }
              }
            }
          }
        }
      end
    end
  end
end
