# 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::WebSearch::V1_0
  module Models
    #
    # Defines an expression and its answer
    #
    class Computation < Answer

      include MsRestAzure


      def initialize
        @_type = "Computation"
      end

      attr_accessor :_type

      # @return [String] The math or conversion expression. If the query
      # contains a request to convert units of measure (for example, meters to
      # feet), this field contains the from units and value contains the to
      # units. If the query contains a mathematical expression such as 2+2,
      # this field contains the expression and value contains the answer. Note
      # that mathematical expressions may be normalized. For example, if the
      # query was sqrt(4^2+8^2), the normalized expression may be
      # sqrt((4^2)+(8^2)). If the user's query is a math question and the
      # textDecorations query parameter is set to true, the expression string
      # may include formatting markers. For example, if the user's query is
      # log(2), the normalized expression includes the subscript markers. For
      # more information, see Hit Highlighting.
      attr_accessor :expression

      # @return [String] The expression's answer.
      attr_accessor :value


      #
      # Mapper for Computation class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'Computation',
          type: {
            name: 'Composite',
            class_name: 'Computation',
            model_properties: {
              _type: {
                client_side_validation: true,
                required: true,
                serialized_name: '_type',
                type: {
                  name: 'String'
                }
              },
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              web_search_url: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'webSearchUrl',
                type: {
                  name: 'String'
                }
              },
              follow_up_queries: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'followUpQueries',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'QueryElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'Query'
                      }
                  }
                }
              },
              expression: {
                client_side_validation: true,
                required: true,
                serialized_name: 'expression',
                type: {
                  name: 'String'
                }
              },
              value: {
                client_side_validation: true,
                required: true,
                serialized_name: 'value',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
