/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 spark.connect;

import "spark/connect/expressions.proto";

option java_multiple_files = true;
option java_package = "org.apache.spark.connect.proto";
option go_package = "internal/generated";

// MlParams stores param settings for ML Estimator / Transformer / Evaluator
message MlParams {
  // User-supplied params
  map<string, Expression.Literal> params = 1;
}

// MLOperator represents the ML operators like (Estimator, Transformer or Evaluator)
message MlOperator {
  // (Required) The qualified name of the ML operator.
  string name = 1;

  // (Required) Unique id of the ML operator
  string uid = 2;

  // (Required) Represents what the ML operator is
  OperatorType type = 3;

  enum OperatorType {
    OPERATOR_TYPE_UNSPECIFIED = 0;
    // ML estimator
    OPERATOR_TYPE_ESTIMATOR = 1;
    // ML transformer (non-model)
    OPERATOR_TYPE_TRANSFORMER = 2;
    // ML evaluator
    OPERATOR_TYPE_EVALUATOR = 3;
    // ML model
    OPERATOR_TYPE_MODEL = 4;
  }
}

// Represents a reference to the cached object which could be a model
// or summary evaluated by a model
message ObjectRef {
  // (Required) The ID is used to lookup the object on the server side.
  // Note it is different from the 'uid' of a ML object.
  string id = 1;
}
