using System.Collections;
using System.Collections.Generic;
namespace Amazon.Lambda.Annotations.SourceGenerator.Writers
{
///
/// This interface contains utility methods to manipulate a YAML or JSON blob
///
public interface ITemplateWriter
{
///
/// Checks if the dot(.) seperated path exists in the blob
///
/// dot(.) seperated path. Example "Person.Name.FirstName"
/// true if the path exist, else false
bool Exists(string path);
///
/// Gets the object stored at the dot(.) seperated path. If the path does not exist then return the defaultToken.
///
/// dot(.) seperated path. Example "Person.Name.FirstName"
/// The object that is returned if path does not exist.
object GetToken(string path, object defaultToken = null);
///
/// Gets the object stored at the dot(.) seperated path. If the path does not exist then return the defaultToken.
///
/// dot(.) seperated path. Example "Person.Name.FirstName"
/// The object that is returned if path does not exist.
T GetToken(string path, object defaultToken = null);
///
/// Sets the token at the dot(.) seperated path.
///
/// dot(.) seperated path. Example "Person.Name.FirstName"
/// The object to set at the specified path
///
void SetToken(string path, object token, TokenType tokenType = TokenType.Other);
///
/// Deletes the token found at the dot(.) separated path.
///
/// dot(.) seperated path. Example "Person.Name.FirstName"
void RemoveToken(string path);
///
/// Returns the template as a string
///
string GetContent();
///
/// Converts the content into an in-memory representation of JSON or YAML node
///
///
void Parse(string content);
///
/// If the string does not start with '@', return it as is.
/// If a string value starts with '@' then a reference node is created and returned.
///
object GetValueOrRef(string value);
///
/// Retrieves a list of keys for a specified template path.
///
/// dot(.) seperated path. Example "Person.Name.FirstName"
IList GetKeys(string path);
}
}