#
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch 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.
#

#
# Painless definition file. This defines the hierarchy of classes,
# what methods and fields they have, etc.
#

#### Classes

class DateTimeFormatter -> java.time.format.DateTimeFormatter {
  DateTimeFormatter BASIC_ISO_DATE
  DateTimeFormatter ISO_DATE
  DateTimeFormatter ISO_DATE_TIME
  DateTimeFormatter ISO_INSTANT
  DateTimeFormatter ISO_LOCAL_DATE
  DateTimeFormatter ISO_LOCAL_DATE_TIME
  DateTimeFormatter ISO_LOCAL_TIME
  DateTimeFormatter ISO_OFFSET_DATE
  DateTimeFormatter ISO_OFFSET_DATE_TIME
  DateTimeFormatter ISO_OFFSET_TIME
  DateTimeFormatter ISO_ORDINAL_DATE
  DateTimeFormatter ISO_TIME
  DateTimeFormatter ISO_WEEK_DATE
  DateTimeFormatter ISO_ZONED_DATE_TIME
  DateTimeFormatter RFC_1123_DATE_TIME
  String format(TemporalAccessor)
  void formatTo(TemporalAccessor,Appendable)
  Chronology getChronology()
  DecimalStyle getDecimalStyle()
  Locale getLocale()
  Set getResolverFields()
  ResolverStyle getResolverStyle()
  ZoneId getZone()
  DateTimeFormatter ofLocalizedDate(FormatStyle)
  DateTimeFormatter ofLocalizedDateTime(FormatStyle)
  DateTimeFormatter ofLocalizedDateTime(FormatStyle,FormatStyle)
  DateTimeFormatter ofLocalizedTime(FormatStyle)
  DateTimeFormatter ofPattern(String)
  DateTimeFormatter ofPattern(String,Locale)
  TemporalAccessor parse(CharSequence)
  def parse(CharSequence,TemporalQuery)
  TemporalAccessor parseBest(CharSequence,TemporalQuery[])
  TemporalQuery parsedExcessDays()
  TemporalQuery parsedLeapSecond()
  TemporalAccessor parseUnresolved(CharSequence,ParsePosition)
  Format toFormat()
  Format toFormat(TemporalQuery)
  DateTimeFormatter withChronology(Chronology)
  DateTimeFormatter withDecimalStyle(DecimalStyle)
  DateTimeFormatter withLocale(Locale)
  DateTimeFormatter withResolverFields(Set)
  DateTimeFormatter withResolverStyle(ResolverStyle)
  DateTimeFormatter withZone(ZoneId)
}

class DateTimeFormatterBuilder -> java.time.format.DateTimeFormatterBuilder {
  ()
  DateTimeFormatterBuilder append(DateTimeFormatter)
  DateTimeFormatterBuilder appendChronologyId()
  DateTimeFormatterBuilder appendChronologyText(TextStyle)
  DateTimeFormatterBuilder appendFraction(TemporalField,int,int,boolean)
  DateTimeFormatterBuilder appendInstant()
  DateTimeFormatterBuilder appendInstant(int)
  DateTimeFormatterBuilder appendLiteral(String)
  DateTimeFormatterBuilder appendLocalized(FormatStyle,FormatStyle)
  DateTimeFormatterBuilder appendLocalizedOffset(TextStyle)
  DateTimeFormatterBuilder appendOffset(String,String)
  DateTimeFormatterBuilder appendOffsetId()
  DateTimeFormatterBuilder appendOptional(DateTimeFormatter)
  DateTimeFormatterBuilder appendPattern(String)
  DateTimeFormatterBuilder appendText(TemporalField)
  DateTimeFormatterBuilder appendText(TemporalField,TextStyle)
  DateTimeFormatterBuilder appendValue(TemporalField)
  DateTimeFormatterBuilder appendValue(TemporalField,int)
  DateTimeFormatterBuilder appendValue(TemporalField,int,int,SignStyle)
  DateTimeFormatterBuilder appendValueReduced(TemporalField,int,int,int)
  DateTimeFormatterBuilder appendZoneId()
  DateTimeFormatterBuilder appendZoneOrOffsetId()
  DateTimeFormatterBuilder appendZoneRegionId()
  DateTimeFormatterBuilder appendZoneText(TextStyle)
  DateTimeFormatterBuilder appendZoneText(TextStyle,Set)
  String getLocalizedDateTimePattern(FormatStyle,FormatStyle,Chronology,Locale)
  DateTimeFormatterBuilder optionalEnd()
  DateTimeFormatterBuilder optionalStart()
  DateTimeFormatterBuilder padNext(int)
  DateTimeFormatterBuilder padNext(int,char)
  DateTimeFormatterBuilder parseCaseInsensitive()
  DateTimeFormatterBuilder parseCaseSensitive()
  DateTimeFormatterBuilder parseDefaulting(TemporalField,long)
  DateTimeFormatterBuilder parseLenient()
  DateTimeFormatterBuilder parseStrict()
  DateTimeFormatter toFormatter()
  DateTimeFormatter toFormatter(Locale)
}

class DecimalStyle -> java.time.format.DecimalStyle {
  DecimalStyle STANDARD
  Set getAvailableLocales()
  char getDecimalSeparator()
  char getNegativeSign()
  char getPositiveSign()
  char getZeroDigit()
  DecimalStyle of(Locale)
  DecimalStyle ofDefaultLocale()
  DecimalStyle withDecimalSeparator(char)
  DecimalStyle withNegativeSign(char)
  DecimalStyle withPositiveSign(char)
  DecimalStyle withZeroDigit(char)
}

#### Enums

class FormatStyle -> java.time.format.FormatStyle {
  FormatStyle FULL
  FormatStyle LONG
  FormatStyle MEDIUM
  FormatStyle SHORT
  FormatStyle valueOf(String)
  FormatStyle[] values()
}

class ResolverStyle -> java.time.format.ResolverStyle {
  ResolverStyle LENIENT
  ResolverStyle SMART
  ResolverStyle STRICT
  ResolverStyle valueOf(String)
  ResolverStyle[] values()
}

class SignStyle -> java.time.format.SignStyle {
  SignStyle ALWAYS
  SignStyle EXCEEDS_PAD
  SignStyle NEVER
  SignStyle NORMAL
  SignStyle NOT_NEGATIVE
  SignStyle valueOf(String)
  SignStyle[] values()
}

class TextStyle -> java.time.format.TextStyle {
  TextStyle FULL
  TextStyle FULL_STANDALONE
  TextStyle NARROW
  TextStyle NARROW_STANDALONE
  TextStyle SHORT
  TextStyle SHORT_STANDALONE
  TextStyle asNormal()
  TextStyle asStandalone()
  boolean isStandalone()
  TextStyle valueOf(String)
  TextStyle[] values()
}

#### Exceptions

class DateTimeParseException -> java.time.format.DateTimeParseException {
  (String,CharSequence,int)
  int getErrorIndex()
  String getParsedString()
}
