aboutsummaryrefslogtreecommitdiff
path: root/google/cloud/automl/v1beta1/data_types.proto
blob: 19ab5a55304b164155bd22a8ee2bdb949ad3467d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// 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";
import "google/cloud/automl/v1beta1/text_extraction.proto";
import "google/protobuf/any.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";


// Indicated the type of data that can be stored in a structured data entity
// (e.g. a table).
message DataType {
  // Details of DataType-s that need additional specification.
  oneof details {
    // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [ARRAY][google.cloud.automl.v1beta1.TypeCode.ARRAY],
    // then `list_element_type` is the type of the elements.
    DataType list_element_type = 2;

    // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT], then `struct_type`
    // provides type information for the struct's fields.
    StructType struct_type = 3;

    // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [TIMESTAMP][google.cloud.automl.v1beta1.TypeCode.TIMESTAMP]
    // then `time_format` provides the format in which that time field is
    // expressed. The time_format must either be one of:
    // * `UNIX_SECONDS`
    // * `UNIX_MILLISECONDS`
    // * `UNIX_MICROSECONDS`
    // * `UNIX_NANOSECONDS`
    // (for respectively number of seconds, milliseconds, microseconds and
    // nanoseconds since start of the Unix epoch);
    // or be written in `strftime` syntax. If time_format is not set, then the
    // default format as described on the type_code is used.
    string time_format = 5;
  }

  // Required. The [TypeCode][google.cloud.automl.v1beta1.TypeCode] for this type.
  TypeCode type_code = 1;

  // If true, this DataType can also be `null`.
  bool nullable = 4;
}

// `StructType` defines the DataType-s of a [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT] type.
message StructType {
  // Unordered map of struct field names to their data types.
  // Fields cannot be added or removed via Update. Their names and
  // data types are still mutable.
  map<string, DataType> fields = 1;
}

// `TypeCode` is used as a part of
// [DataType][google.cloud.automl.v1beta1.DataType].
//
// Each legal value of a DataType can be encoded to or decoded from a JSON
// value, using the encodings listed below, and definitions of which can be
// found at
//
// https:
// //developers.google.com/protocol-buffers
// // /docs/reference/google.protobuf#value.
enum TypeCode {
  // Not specified. Should not be used.
  TYPE_CODE_UNSPECIFIED = 0;

  // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or
  // `"-Infinity"`.
  FLOAT64 = 3;

  // Must be between 0AD and 9999AD. Encoded as `string` according to
  // [time_format][google.cloud.automl.v1beta1.DataType.time_format], or, if
  // that format is not set, then in RFC 3339 `date-time` format, where
  // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z).
  TIMESTAMP = 4;

  // Encoded as `string`.
  STRING = 6;

  // Encoded as `list`, where the list elements are represented according to
  //
  // [list_element_type][google.cloud.automl.v1beta1.DataType.list_element_type].
  ARRAY = 8;

  // Encoded as `struct`, where field values are represented according to
  // [struct_type][google.cloud.automl.v1beta1.DataType.struct_type].
  STRUCT = 9;

  // Values of this type are not further understood by AutoML,
  // e.g. AutoML is unable to tell the order of values (as it could with
  // FLOAT64), or is unable to say if one value contains another (as it
  // could with STRING).
  // Encoded as `string` (bytes should be base64-encoded, as described in RFC
  // 4648, section 4).
  CATEGORY = 10;
}