syntax = "proto3";

package io.apicurio.registry.utils.protobuf.schema.syntax3.customoptions;

import "metadata/metadata.proto";

message Address {

  string street = 1 [(metadata.metadata_key) = "description", (metadata.metadata_value) = "less than 40 characters"];

  int32 zip = 2 [(metadata.metadata_key) = "connect.schema", (metadata.metadata_value) = "int8"];

  string city = 3;

  enum Type {
    OFFICE = 0;
    APARTMENT = 1;
    HOUSE = 2;
  }

  map<int32, int32> rentPerYear = 4 [(metadata.metadata_key) = "description", (metadata.metadata_value) = "rent per year in USD"];

  map<string, Type> addressType = 9;

  message ContactPersons {
    string name = 1;
    int32 phone = 2 [(metadata.metadata_key) = "maximum number of characters", (metadata.metadata_value) = "20"];
  }

  map<string, ContactPersons> pastOwners = 12;

  oneof test_oneof {
    string state = 5;
    string country = 7 [(metadata.metadata_key) = "description", (metadata.metadata_value) = "country of residency"];
  }

  repeated int32 samples = 6 [packed=true];

  map<string, string> pastAddresses = 8;
}

message Customer {

  string name = 1;

  optional int32 balance = 3 [(metadata.metadata_key) = "decimal.scale", (metadata.metadata_value) = "10"];

  reserved 2, 15, 10 to 11, 800 to 899;

}

service OriginalService {
  rpc Foo(Customer) returns(Address);
}