// Copyright (C) 2022  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.fragment;

import "google/api/client.proto";
import "google/api/annotations.proto";
import "google/longrunning/operations.proto";

service MyService {
  option (google.api.default_host) = "my.example.com";

  rpc CreateChannel(CreateChannelRequest) returns (CreateChannelResponse) {
        option (google.api.http) = {
          body: "*"
          post: "/channels/v1/channel/{channel}"
        };
  };

  rpc Import(CreateImportRequest) returns (CreateImportResponse) {
        option (google.api.http) = {
          body: "*"
          post: "/import/v1"
        };
  };

  rpc GrpcChannel(GrpcChannelRequest) returns (GrpcChannelResponse) {
        option (google.api.http) = {
          body: "*"
          post: "/channels/v1/grpc_channel/{grpc_channel}"
        };
  };

  rpc OperationsClient(OperationsClientRequest) returns (google.longrunning.Operation) {
        option (google.api.http) = {
          body: "*"
          post: "/clients/v1/operations_clients/{operations_client}"
        };
        option (google.longrunning.operation_info) = {
          response_type: "google.fragment.OperationsClientResponse"
          metadata_type: "google.fragment.OperationsMetadata"
        };
  };

}

message CreateChannelRequest {
  string channel = 1;
  string info = 2;
}

message CreateChannelResponse {
  string info = 1;
}

message CreateImportRequest {
  string info = 1;
}

message CreateImportResponse {
  string info = 1;
}

message GrpcChannelRequest {
  string grpc_channel = 1;
  string info = 2;
}

message GrpcChannelResponse {
  string info = 1;
}

message OperationsClientRequest {
  string operations_client = 1;
  string info = 2;
}

message OperationsClientResponse {
  string info = 1;
}

message OperationsMetadata {
  string data = 1;
}