# 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::QnamakerRuntime::V4_0
  module Models
    #
    # Q-A object.
    #
    class QnADTO

      include MsRestAzure

      # @return [Integer] Unique id for the Q-A.
      attr_accessor :id

      # @return [String] Answer text
      attr_accessor :answer

      # @return [String] Source from which Q-A was indexed. eg.
      # https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
      attr_accessor :source

      # @return [Array<String>] List of questions associated with the answer.
      attr_accessor :questions

      # @return [Array<MetadataDTO>] List of metadata associated with the
      # answer.
      attr_accessor :metadata

      # @return [QnADTOContext] Context of a QnA
      attr_accessor :context


      #
      # Mapper for QnADTO class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'QnADTO',
          type: {
            name: 'Composite',
            class_name: 'QnADTO',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'id',
                type: {
                  name: 'Number'
                }
              },
              answer: {
                client_side_validation: true,
                required: true,
                serialized_name: 'answer',
                constraints: {
                  MaxLength: 25000,
                  MinLength: 1
                },
                type: {
                  name: 'String'
                }
              },
              source: {
                client_side_validation: true,
                required: false,
                serialized_name: 'source',
                constraints: {
                  MaxLength: 300
                },
                type: {
                  name: 'String'
                }
              },
              questions: {
                client_side_validation: true,
                required: true,
                serialized_name: 'questions',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              },
              metadata: {
                client_side_validation: true,
                required: false,
                serialized_name: 'metadata',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'MetadataDTOElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'MetadataDTO'
                      }
                  }
                }
              },
              context: {
                client_side_validation: true,
                required: false,
                serialized_name: 'context',
                type: {
                  name: 'Composite',
                  class_name: 'QnADTOContext'
                }
              }
            }
          }
        }
      end
    end
  end
end
