// Copyright (c) 2018 Anki, Inc.
//
// 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 in the file LICENSE.txt or 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.

// Alexa messages

syntax = "proto3";

package Anki.Vector.external_interface;

import "response_status.proto";  // App only

// *** App only proto below ***

enum AlexaAuthState {
  // Invalid/error/versioning issue
  ALEXA_AUTH_INVALID          = 0;

  // Not opted in, or opt-in attempted but failed
  ALEXA_AUTH_UNINITIALIZED    = 1;
  // Opted in, and attempting to authorize
  ALEXA_AUTH_REQUESTING_AUTH  = 2;
  // Opted in, and waiting on the user to enter a code
  ALEXA_AUTH_WAITING_FOR_CODE = 3;
  // Opted in, and authorized / in use
  ALEXA_AUTH_AUTHORIZED       = 4;
}

message AlexaAuthStateRequest {
}

message AlexaAuthStateResponse { 
  ResponseStatus   status       = 1;
  AlexaAuthState   auth_state   = 2;
  string           extra        = 3;
}

message AlexaOptInRequest { 
  bool opt_in = 1;
}

message AlexaOptInResponse{
  ResponseStatus   status       = 1;
}

message AlexaAuthEvent {
  AlexaAuthState   auth_state   = 1;
  string           extra        = 2;
}
