// Copyright 2017 Google Inc. All Rights Reserved.
//
// 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.

// THIS FILE IS AUTOMATICALLY GENERATED.

syntax = "proto3";

package discovery.v1;

import "google/protobuf/any.proto";

// This option lets the proto compiler generate Java code inside the package
// name (see below) instead of inside an outer class. It creates a simpler
// developer experience by reducing one-level of name nesting and be
// consistent with most programming languages that don't support outer classes.
option java_multiple_files = true;

// The Java outer classname should be the filename in UpperCamelCase. This
// class is only used to hold proto descriptor, so developers don't need to
// work with it directly.
option java_outer_classname = "OpenAPIProto";

// The Java package name must be proto package name with proper prefix.
option java_package = "org.discovery_v1";

// A reasonable prefix for the Objective-C symbols generated from the package.
// It should at a minimum be 3 characters long, all uppercase, and convention
// is to use an abbreviation of the package name. Something short, but
// hopefully unique enough to not conflict with things that may come along in
// the future. 'GPB' is reserved for the protocol buffer implementation itself.
option objc_class_prefix = "OAS";

message Annotations {
  repeated string required = 1;
}

message Any {
  google.protobuf.Any value = 1;
  string yaml = 2;
}

message Auth {
  Oauth2 oauth2 = 1;
}

message Document {
  string kind = 1;
  string discovery_version = 2;
  string id = 3;
  string name = 4;
  string version = 5;
  string revision = 6;
  string title = 7;
  string description = 8;
  Icons icons = 9;
  string documentation_link = 10;
  repeated string labels = 11;
  string protocol = 12;
  string base_url = 13;
  string base_path = 14;
  string root_url = 15;
  string service_path = 16;
  string batch_path = 17;
  Parameters parameters = 18;
  Auth auth = 19;
  repeated string features = 20;
  Schemas schemas = 21;
  Methods methods = 22;
  Resources resources = 23;
  string etag = 24;
  string owner_domain = 25;
  string owner_name = 26;
  bool version_module = 27;
  string canonical_name = 28;
  bool fully_encode_reserved_expansion = 29;
  string package_path = 30;
}

// Icons that represent the API.
message Icons {
  string x16 = 1;
  string x32 = 2;
}

message MediaUpload {
  repeated string accept = 1;
  string max_size = 2;
  Protocols protocols = 3;
  bool supports_subscription = 4;
}

message Method {
  string id = 1;
  string path = 2;
  string http_method = 3;
  string description = 4;
  Parameters parameters = 5;
  repeated string parameter_order = 6;
  Request request = 7;
  Response response = 8;
  repeated string scopes = 9;
  bool supports_media_download = 10;
  bool supports_media_upload = 11;
  bool use_media_download_service = 12;
  MediaUpload media_upload = 13;
  bool supports_subscription = 14;
  string flat_path = 15;
  bool etag_required = 16;
}

message Methods {
  repeated NamedMethod additional_properties = 1;
}

// Automatically-generated message used to represent maps of Method as ordered (name,value) pairs.
message NamedMethod {
  // Map key
  string name = 1;
  // Mapped value
  Method value = 2;
}

// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs.
message NamedParameter {
  // Map key
  string name = 1;
  // Mapped value
  Parameter value = 2;
}

// Automatically-generated message used to represent maps of Resource as ordered (name,value) pairs.
message NamedResource {
  // Map key
  string name = 1;
  // Mapped value
  Resource value = 2;
}

// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs.
message NamedSchema {
  // Map key
  string name = 1;
  // Mapped value
  Schema value = 2;
}

// Automatically-generated message used to represent maps of Scope as ordered (name,value) pairs.
message NamedScope {
  // Map key
  string name = 1;
  // Mapped value
  Scope value = 2;
}

message Oauth2 {
  Scopes scopes = 1;
}

message Parameter {
  string id = 1;
  string type = 2;
  string _ref = 3;
  string description = 4;
  string default = 5;
  bool required = 6;
  string format = 7;
  string pattern = 8;
  string minimum = 9;
  string maximum = 10;
  repeated string enum = 11;
  repeated string enum_descriptions = 12;
  bool repeated = 13;
  string location = 14;
  Schemas properties = 15;
  Schema additional_properties = 16;
  Schema items = 17;
  Annotations annotations = 18;
}

message Parameters {
  repeated NamedParameter additional_properties = 1;
}

message Protocols {
  Simple simple = 1;
  Resumable resumable = 2;
}

message Request {
  string _ref = 1;
  string parameter_name = 2;
}

message Resource {
  Methods methods = 1;
  Resources resources = 2;
}

message Resources {
  repeated NamedResource additional_properties = 1;
}

message Response {
  string _ref = 1;
}

message Resumable {
  bool multipart = 1;
  string path = 2;
}

message Schema {
  string id = 1;
  string type = 2;
  string description = 3;
  string default = 4;
  bool required = 5;
  string format = 6;
  string pattern = 7;
  string minimum = 8;
  string maximum = 9;
  repeated string enum = 10;
  repeated string enum_descriptions = 11;
  bool repeated = 12;
  string location = 13;
  Schemas properties = 14;
  Schema additional_properties = 15;
  Schema items = 16;
  string _ref = 17;
  Annotations annotations = 18;
  bool read_only = 19;
}

message Schemas {
  repeated NamedSchema additional_properties = 1;
}

message Scope {
  string description = 1;
}

message Scopes {
  repeated NamedScope additional_properties = 1;
}

message Simple {
  bool multipart = 1;
  string path = 2;
}

message StringArray {
  repeated string value = 1;
}

