// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.automl.v1beta1;

import "google/api/annotations.proto";
import "google/cloud/automl/v1beta1/io.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl";
option java_multiple_files = true;
option java_package = "com.google.cloud.automl.v1beta1";
option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1";


// A representation of an image.
message Image {
  // Input only. The data representing the image.
  // For Predict calls [image_bytes][] must be set, as other options are not
  // currently supported by prediction API. You can read the contents of an
  // uploaded image by using the [content_uri][] field.
  oneof data {
    // Image content represented as a stream of bytes.
    // Note: As with all `bytes` fields, protobuffers use a pure binary
    // representation, whereas JSON representations use base64.
    bytes image_bytes = 1;

    // An input config specifying the content of the image.
    InputConfig input_config = 6;
  }

  // Output only. HTTP URI to the thumbnail image.
  string thumbnail_uri = 4;
}

// A representation of a text snippet.
message TextSnippet {
  // Required. The content of the text snippet as a string. Up to 250000
  // characters long.
  string content = 1;

  // The format of the source text. For example, "text/html" or
  // "text/plain". If left blank the format is automatically determined from
  // the type of the uploaded content. The default is "text/html". Up to 25000
  // characters long.
  string mime_type = 2;

  // Output only. HTTP URI where you can download the content.
  string content_uri = 4;
}

// Example data used for training or prediction.
message ExamplePayload {
  // Required. Input only. The example data.
  oneof payload {
    // An example image.
    Image image = 1;

    // Example text.
    TextSnippet text_snippet = 2;
  }
}
