// Copyright 2018 The Kubeflow Authors
//
// 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";

option go_package = "github.com/kubeflow/pipelines/backend/api/v1beta1/go_client";
package api;

enum ResourceType {
  UNKNOWN_RESOURCE_TYPE = 0;
  EXPERIMENT = 1;
  JOB = 2;
  PIPELINE = 3;
  PIPELINE_VERSION = 4;
  NAMESPACE = 5;
}

enum Relationship {
  UNKNOWN_RELATIONSHIP = 0;
  OWNER = 1;
  CREATOR = 2;
}


message ResourceKey {
  // The type of the resource that referred to.
  ResourceType type = 1;

  // The ID of the resource that referred to.
  string id = 2;
}

message ResourceReference {
  ResourceKey key = 1;

  // The name of the resource that referred to.
  string name = 3;

  // Required field. The relationship from referred resource to the object.
  Relationship relationship = 2;
}
