# 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::CognitiveServices::FormRecognizer::V1_0_preview
  module Models
    #
    # Base class representing a recognized field value.
    #
    class FieldValue

      include MsRestAzure

      @@discriminatorMap = Hash.new
      @@discriminatorMap["stringValue"] = "StringValue"
      @@discriminatorMap["numberValue"] = "NumberValue"

      def initialize
        @valueType = "fieldValue"
      end

      attr_accessor :valueType

      # @return [String] OCR text content of the recognized field.
      attr_accessor :text

      # @return [Array<ElementReference>] List of references to OCR words
      # comprising the recognized field value.
      attr_accessor :elements


      #
      # Mapper for FieldValue class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'fieldValue',
          type: {
            name: 'Composite',
            polymorphic_discriminator: 'valueType',
            uber_parent: 'FieldValue',
            class_name: 'FieldValue',
            model_properties: {
              text: {
                client_side_validation: true,
                required: false,
                serialized_name: 'text',
                type: {
                  name: 'String'
                }
              },
              elements: {
                client_side_validation: true,
                required: false,
                serialized_name: 'elements',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ElementReferenceElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ElementReference'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
