# 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::VisualSearch::V1_0
  module Models
    #
    # A JSON object that identities the image to get insights of . It also
    # includes the optional crop area that you use to identify the region of
    # interest in the image.
    #
    class ImageInfo

      include MsRestAzure

      # @return [String] An image insights token. To get the insights token,
      # call one of the Image Search APIs (for example, /images/search). In the
      # search results, the
      # [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image)
      # object's
      # [imageInsightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image-imageinsightstoken)
      # field contains the token. The imageInsightsToken and url fields
      # mutually exclusive; do not specify both. Do not specify an insights
      # token if the request includes the image form data.
      attr_accessor :image_insights_token

      # @return [String] The URL of the input image. The imageInsightsToken and
      # url fields are mutually exclusive; do not specify both. Do not specify
      # the URL if the request includes the image form data.
      attr_accessor :url

      # @return [CropArea] A JSON object consisting of coordinates specifying
      # the four corners of a cropped rectangle within the input image. Use the
      # crop area to identify the region of interest in the image. You can
      # apply the crop area to the images specified using the
      # imageInsightsToken or url fields, or an image binary specified in an
      # image form data.
      attr_accessor :crop_area


      #
      # Mapper for ImageInfo class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ImageInfo',
          type: {
            name: 'Composite',
            class_name: 'ImageInfo',
            model_properties: {
              image_insights_token: {
                client_side_validation: true,
                required: false,
                serialized_name: 'imageInsightsToken',
                type: {
                  name: 'String'
                }
              },
              url: {
                client_side_validation: true,
                required: false,
                serialized_name: 'url',
                type: {
                  name: 'String'
                }
              },
              crop_area: {
                client_side_validation: true,
                required: false,
                serialized_name: 'cropArea',
                type: {
                  name: 'Composite',
                  class_name: 'CropArea'
                }
              }
            }
          }
        }
      end
    end
  end
end
