package com.justeat.mickeydb.generator;

import com.justeat.mickeydb.ContentUriInfo;
import com.justeat.mickeydb.MickeyDatabaseModel;
import com.justeat.mickeydb.mickeyLang.ContentNotificationUri;
import com.justeat.mickeydb.mickeyLang.ContentUriQueryParam;
import com.justeat.mickeydb.mickeyLang.NotifyContentUri;
import com.justeat.mickeydb.mickeyLang.NotifyContentUriParamSegment;
import com.justeat.mickeydb.mickeyLang.NotifyContentUriSegment;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xtend2.lib.StringConcatenation;

@SuppressWarnings("all")
public class CustomActionsGenerator {
  public CharSequence generate(final MickeyDatabaseModel model, final ContentUriInfo content) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method getSnapshot() from the type MickeyDatabaseModel refers to the missing type SqliteDatabaseSnapshot"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\n!= cannot be resolved"
      + "\n&& cannot be resolved"
      + "\nuri cannot be resolved"
      + "\nsegments cannot be resolved"
      + "\nfilter cannot be resolved"
      + "\nempty cannot be resolved"
      + "\n! cannot be resolved"
      + "\n!= cannot be resolved"
      + "\n&& cannot be resolved"
      + "\nparams cannot be resolved"
      + "\nempty cannot be resolved"
      + "\n! cannot be resolved"
      + "\n|| cannot be resolved"
      + "\n|| cannot be resolved"
      + "\nnotifications cannot be resolved"
      + "\nsize cannot be resolved"
      + "\n> cannot be resolved"
      + "\nnotifications cannot be resolved"
      + "\n!= cannot be resolved"
      + "\nuri cannot be resolved"
      + "\nsegments cannot be resolved"
      + "\ntype cannot be resolved"
      + "\nname cannot be resolved"
      + "\npascalize cannot be resolved");
  }
  
  public CharSequence createNotifyStatement(final MickeyDatabaseModel model, final ContentUriInfo info, final ContentNotificationUri uri) {
    StringConcatenation _builder = new StringConcatenation();
    String _databaseName = model.getDatabaseName();
    _builder.append(_databaseName, "");
    _builder.append("Contract.BASE_CONTENT_URI");
    _builder.newLineIfNotEmpty();
    _builder.append("\t");
    _builder.append(".buildUpon()");
    _builder.newLine();
    {
      NotifyContentUri _uri = uri.getUri();
      EList<NotifyContentUriSegment> _segments = _uri.getSegments();
      for(final NotifyContentUriSegment seg : _segments) {
        {
          if ((seg instanceof NotifyContentUriParamSegment)) {
            _builder.append("\t");
            _builder.append(".appendPath(");
            String _slugVariableForNotifyUriSegment = this.getSlugVariableForNotifyUriSegment(((NotifyContentUriSegment) seg), info);
            _builder.append(_slugVariableForNotifyUriSegment, "\t");
            _builder.append(")");
            _builder.newLineIfNotEmpty();
          } else {
            _builder.append("\t");
            _builder.append(".appendPath(\"");
            String _name = seg.getName();
            _builder.append(_name, "\t");
            _builder.append("\")");
            _builder.newLineIfNotEmpty();
          }
        }
      }
    }
    _builder.append("\t");
    _builder.append(".build()");
    _builder.newLine();
    return _builder;
  }
  
  public String getSlugVariableForNotifyUriSegment(final NotifyContentUriSegment segment, final ContentUriInfo info) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nuri cannot be resolved"
      + "\nsegments cannot be resolved"
      + "\nexists cannot be resolved");
  }
  
  public CharSequence createQueryStatements(final ContentUriInfo content) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method or field inferredColumnType is undefined for the type ColumnSource"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nuri cannot be resolved"
      + "\nsegments cannot be resolved"
      + "\nindexed cannot be resolved"
      + "\nvalue cannot be resolved"
      + "\nvalue cannot be resolved"
      + "\n!= cannot be resolved"
      + "\nparams cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\nunderscore cannot be resolved"
      + "\ntoUpperCase cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\nunderscore cannot be resolved"
      + "\ntoUpperCase cannot be resolved"
      + "\ngenerateOperator cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\ncamelize cannot be resolved");
  }
  
  public CharSequence createQueryParamVariables(final ContentUriInfo content) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nparams cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\ninferredColumnType cannot be resolved"
      + "\n== cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\ninferredColumnType cannot be resolved"
      + "\ntoJavaTypeName cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\ncamelize cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\nunderscore cannot be resolved"
      + "\ntoUpperCase cannot be resolved"
      + "\n== cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\ninferredColumnType cannot be resolved"
      + "\ntoJavaTypeName cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\ncamelize cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\nunderscore cannot be resolved"
      + "\ntoUpperCase cannot be resolved"
      + "\n== cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\ninferredColumnType cannot be resolved"
      + "\ntoJavaTypeName cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\ncamelize cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\nunderscore cannot be resolved"
      + "\ntoUpperCase cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\ninferredColumnType cannot be resolved"
      + "\ntoJavaTypeName cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\ncamelize cannot be resolved"
      + "\ncolumn cannot be resolved"
      + "\nname cannot be resolved"
      + "\nunderscore cannot be resolved"
      + "\ntoUpperCase cannot be resolved");
  }
  
  public CharSequence createSlugVariables(final ContentUriInfo content) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method or field inferredColumnType is undefined for the type ColumnSource"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nuri cannot be resolved"
      + "\nsegments cannot be resolved"
      + "\nindexed cannot be resolved"
      + "\nvalue cannot be resolved"
      + "\nvalue cannot be resolved"
      + "\n!= cannot be resolved"
      + "\nkey cannot be resolved"
      + "\nkey cannot be resolved");
  }
  
  public CharSequence createStringSlugVariables(final ContentUriInfo content) {
    throw new Error("Unresolved compilation problems:"
      + "\nThe method getAction() from the type ContentUriInfo refers to the missing type ActionStatement"
      + "\nuri cannot be resolved"
      + "\nsegments cannot be resolved"
      + "\nindexed cannot be resolved"
      + "\nvalue cannot be resolved"
      + "\nvalue cannot be resolved"
      + "\nkey cannot be resolved");
  }
  
  public CharSequence generateOperator(final ContentUriQueryParam param) {
    boolean _isLike = param.isLike();
    if (_isLike) {
      return "Query.Op.LIKE";
    } else {
      return "Query.Op.EQ";
    }
  }
}
