// DO NOT EDIT: This file is autogenerated via the builtin command.

package tasks

import (
	ast "github.com/influxdata/flux/ast"
	runtime "github.com/influxdata/flux/runtime"
)

func init() {
	runtime.RegisterPackage(pkgAST)
}

var pkgAST = &ast.Package{
	BaseNode: ast.BaseNode{
		Comments: nil,
		Errors:   nil,
		Loc:      nil,
	},
	Files: []*ast.File{&ast.File{
		BaseNode: ast.BaseNode{
			Comments: nil,
			Errors:   nil,
			Loc: &ast.SourceLocation{
				End: ast.Position{
					Column: 64,
					Line:   48,
				},
				File:   "tasks.flux",
				Source: "package tasks\n\n\n// _zeroTime is a sentinel value for the zero time.\n// This is used to mark that the lastSuccessTime has not been set.\nbuiltin _zeroTime : time\n\n// lastSuccessTime is the last time this task had run successfully.\noption lastSuccessTime = _zeroTime\n\n// _lastSuccess will return the time set on the option lastSuccessTime\n// or it will return the orTime.\nbuiltin _lastSuccess : (orTime: T, lastSuccessTime: time) => time where T: Timeable\n\n// lastSuccess is a function that returns the time of the last successful run\n//  of the InfluxDb task or the value of the orTime parameter if the task\n//  has never successfully run.\n//\n// ## Parameters\n// - `orTime` is the defualt time value returned if the task has never\n//   successfully run.\n//\n// ## Example\n//\n// ```\n// import \"influxdata/influxdb/tasks\"\n//\n// tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z)\n// ```\n//\n// ## Query data since the last successful task run\n//\n// ```\n// import \"influxdata/influxdb/tasks\"\n//\n// option task = {\n//   name: \"Example task\",\n//   every: 30m\n// }\n//\n// from(bucket: \"example-bucket\")\n//   |> range(start: tasks.lastSuccess(orTime: -task.every))\n//   // ...\n// ```\nlastSuccess = (orTime) => _lastSuccess(orTime, lastSuccessTime)",
				Start: ast.Position{
					Column: 1,
					Line:   4,
				},
			},
		},
		Body: []ast.Statement{&ast.BuiltinStatement{
			BaseNode: ast.BaseNode{
				Comments: []ast.Comment{ast.Comment{Text: "// _zeroTime is a sentinel value for the zero time.\n"}, ast.Comment{Text: "// This is used to mark that the lastSuccessTime has not been set.\n"}},
				Errors:   nil,
				Loc: &ast.SourceLocation{
					End: ast.Position{
						Column: 18,
						Line:   9,
					},
					File:   "tasks.flux",
					Source: "builtin _zeroTime",
					Start: ast.Position{
						Column: 1,
						Line:   9,
					},
				},
			},
			Colon: nil,
			ID: &ast.Identifier{
				BaseNode: ast.BaseNode{
					Comments: nil,
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 18,
							Line:   9,
						},
						File:   "tasks.flux",
						Source: "_zeroTime",
						Start: ast.Position{
							Column: 9,
							Line:   9,
						},
					},
				},
				Name: "_zeroTime",
			},
			Ty: ast.TypeExpression{
				BaseNode: ast.BaseNode{
					Comments: nil,
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 25,
							Line:   9,
						},
						File:   "tasks.flux",
						Source: "time",
						Start: ast.Position{
							Column: 21,
							Line:   9,
						},
					},
				},
				Constraints: []*ast.TypeConstraint{},
				Ty: &ast.NamedType{
					BaseNode: ast.BaseNode{
						Comments: nil,
						Errors:   nil,
						Loc: &ast.SourceLocation{
							End: ast.Position{
								Column: 25,
								Line:   9,
							},
							File:   "tasks.flux",
							Source: "time",
							Start: ast.Position{
								Column: 21,
								Line:   9,
							},
						},
					},
					ID: &ast.Identifier{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 25,
									Line:   9,
								},
								File:   "tasks.flux",
								Source: "time",
								Start: ast.Position{
									Column: 21,
									Line:   9,
								},
							},
						},
						Name: "time",
					},
				},
			},
		}, &ast.OptionStatement{
			Assignment: &ast.VariableAssignment{
				BaseNode: ast.BaseNode{
					Comments: nil,
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 35,
							Line:   12,
						},
						File:   "tasks.flux",
						Source: "lastSuccessTime = _zeroTime",
						Start: ast.Position{
							Column: 8,
							Line:   12,
						},
					},
				},
				ID: &ast.Identifier{
					BaseNode: ast.BaseNode{
						Comments: nil,
						Errors:   nil,
						Loc: &ast.SourceLocation{
							End: ast.Position{
								Column: 23,
								Line:   12,
							},
							File:   "tasks.flux",
							Source: "lastSuccessTime",
							Start: ast.Position{
								Column: 8,
								Line:   12,
							},
						},
					},
					Name: "lastSuccessTime",
				},
				Init: &ast.Identifier{
					BaseNode: ast.BaseNode{
						Comments: nil,
						Errors:   nil,
						Loc: &ast.SourceLocation{
							End: ast.Position{
								Column: 35,
								Line:   12,
							},
							File:   "tasks.flux",
							Source: "_zeroTime",
							Start: ast.Position{
								Column: 26,
								Line:   12,
							},
						},
					},
					Name: "_zeroTime",
				},
			},
			BaseNode: ast.BaseNode{
				Comments: []ast.Comment{ast.Comment{Text: "// lastSuccessTime is the last time this task had run successfully.\n"}},
				Errors:   nil,
				Loc: &ast.SourceLocation{
					End: ast.Position{
						Column: 35,
						Line:   12,
					},
					File:   "tasks.flux",
					Source: "option lastSuccessTime = _zeroTime",
					Start: ast.Position{
						Column: 1,
						Line:   12,
					},
				},
			},
		}, &ast.BuiltinStatement{
			BaseNode: ast.BaseNode{
				Comments: []ast.Comment{ast.Comment{Text: "// _lastSuccess will return the time set on the option lastSuccessTime\n"}, ast.Comment{Text: "// or it will return the orTime.\n"}},
				Errors:   nil,
				Loc: &ast.SourceLocation{
					End: ast.Position{
						Column: 21,
						Line:   16,
					},
					File:   "tasks.flux",
					Source: "builtin _lastSuccess",
					Start: ast.Position{
						Column: 1,
						Line:   16,
					},
				},
			},
			Colon: nil,
			ID: &ast.Identifier{
				BaseNode: ast.BaseNode{
					Comments: nil,
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 21,
							Line:   16,
						},
						File:   "tasks.flux",
						Source: "_lastSuccess",
						Start: ast.Position{
							Column: 9,
							Line:   16,
						},
					},
				},
				Name: "_lastSuccess",
			},
			Ty: ast.TypeExpression{
				BaseNode: ast.BaseNode{
					Comments: nil,
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 84,
							Line:   16,
						},
						File:   "tasks.flux",
						Source: "(orTime: T, lastSuccessTime: time) => time where T: Timeable",
						Start: ast.Position{
							Column: 24,
							Line:   16,
						},
					},
				},
				Constraints: []*ast.TypeConstraint{&ast.TypeConstraint{
					BaseNode: ast.BaseNode{
						Comments: nil,
						Errors:   nil,
						Loc: &ast.SourceLocation{
							End: ast.Position{
								Column: 84,
								Line:   16,
							},
							File:   "tasks.flux",
							Source: "T: Timeable",
							Start: ast.Position{
								Column: 73,
								Line:   16,
							},
						},
					},
					Kinds: []*ast.Identifier{&ast.Identifier{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 84,
									Line:   16,
								},
								File:   "tasks.flux",
								Source: "Timeable",
								Start: ast.Position{
									Column: 76,
									Line:   16,
								},
							},
						},
						Name: "Timeable",
					}},
					Tvar: &ast.Identifier{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 74,
									Line:   16,
								},
								File:   "tasks.flux",
								Source: "T",
								Start: ast.Position{
									Column: 73,
									Line:   16,
								},
							},
						},
						Name: "T",
					},
				}},
				Ty: &ast.FunctionType{
					BaseNode: ast.BaseNode{
						Comments: nil,
						Errors:   nil,
						Loc: &ast.SourceLocation{
							End: ast.Position{
								Column: 66,
								Line:   16,
							},
							File:   "tasks.flux",
							Source: "(orTime: T, lastSuccessTime: time) => time",
							Start: ast.Position{
								Column: 24,
								Line:   16,
							},
						},
					},
					Parameters: []*ast.ParameterType{&ast.ParameterType{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 34,
									Line:   16,
								},
								File:   "tasks.flux",
								Source: "orTime: T",
								Start: ast.Position{
									Column: 25,
									Line:   16,
								},
							},
						},
						Kind: "Required",
						Name: &ast.Identifier{
							BaseNode: ast.BaseNode{
								Comments: nil,
								Errors:   nil,
								Loc: &ast.SourceLocation{
									End: ast.Position{
										Column: 31,
										Line:   16,
									},
									File:   "tasks.flux",
									Source: "orTime",
									Start: ast.Position{
										Column: 25,
										Line:   16,
									},
								},
							},
							Name: "orTime",
						},
						Ty: &ast.TvarType{
							BaseNode: ast.BaseNode{
								Comments: nil,
								Errors:   nil,
								Loc: &ast.SourceLocation{
									End: ast.Position{
										Column: 34,
										Line:   16,
									},
									File:   "tasks.flux",
									Source: "T",
									Start: ast.Position{
										Column: 33,
										Line:   16,
									},
								},
							},
							ID: &ast.Identifier{
								BaseNode: ast.BaseNode{
									Comments: nil,
									Errors:   nil,
									Loc: &ast.SourceLocation{
										End: ast.Position{
											Column: 34,
											Line:   16,
										},
										File:   "tasks.flux",
										Source: "T",
										Start: ast.Position{
											Column: 33,
											Line:   16,
										},
									},
								},
								Name: "T",
							},
						},
					}, &ast.ParameterType{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 57,
									Line:   16,
								},
								File:   "tasks.flux",
								Source: "lastSuccessTime: time",
								Start: ast.Position{
									Column: 36,
									Line:   16,
								},
							},
						},
						Kind: "Required",
						Name: &ast.Identifier{
							BaseNode: ast.BaseNode{
								Comments: nil,
								Errors:   nil,
								Loc: &ast.SourceLocation{
									End: ast.Position{
										Column: 51,
										Line:   16,
									},
									File:   "tasks.flux",
									Source: "lastSuccessTime",
									Start: ast.Position{
										Column: 36,
										Line:   16,
									},
								},
							},
							Name: "lastSuccessTime",
						},
						Ty: &ast.NamedType{
							BaseNode: ast.BaseNode{
								Comments: nil,
								Errors:   nil,
								Loc: &ast.SourceLocation{
									End: ast.Position{
										Column: 57,
										Line:   16,
									},
									File:   "tasks.flux",
									Source: "time",
									Start: ast.Position{
										Column: 53,
										Line:   16,
									},
								},
							},
							ID: &ast.Identifier{
								BaseNode: ast.BaseNode{
									Comments: nil,
									Errors:   nil,
									Loc: &ast.SourceLocation{
										End: ast.Position{
											Column: 57,
											Line:   16,
										},
										File:   "tasks.flux",
										Source: "time",
										Start: ast.Position{
											Column: 53,
											Line:   16,
										},
									},
								},
								Name: "time",
							},
						},
					}},
					Return: &ast.NamedType{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 66,
									Line:   16,
								},
								File:   "tasks.flux",
								Source: "time",
								Start: ast.Position{
									Column: 62,
									Line:   16,
								},
							},
						},
						ID: &ast.Identifier{
							BaseNode: ast.BaseNode{
								Comments: nil,
								Errors:   nil,
								Loc: &ast.SourceLocation{
									End: ast.Position{
										Column: 66,
										Line:   16,
									},
									File:   "tasks.flux",
									Source: "time",
									Start: ast.Position{
										Column: 62,
										Line:   16,
									},
								},
							},
							Name: "time",
						},
					},
				},
			},
		}, &ast.VariableAssignment{
			BaseNode: ast.BaseNode{
				Comments: nil,
				Errors:   nil,
				Loc: &ast.SourceLocation{
					End: ast.Position{
						Column: 64,
						Line:   48,
					},
					File:   "tasks.flux",
					Source: "lastSuccess = (orTime) => _lastSuccess(orTime, lastSuccessTime)",
					Start: ast.Position{
						Column: 1,
						Line:   48,
					},
				},
			},
			ID: &ast.Identifier{
				BaseNode: ast.BaseNode{
					Comments: []ast.Comment{ast.Comment{Text: "// lastSuccess is a function that returns the time of the last successful run\n"}, ast.Comment{Text: "//  of the InfluxDb task or the value of the orTime parameter if the task\n"}, ast.Comment{Text: "//  has never successfully run.\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// ## Parameters\n"}, ast.Comment{Text: "// - `orTime` is the defualt time value returned if the task has never\n"}, ast.Comment{Text: "//   successfully run.\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// ## Example\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// ```\n"}, ast.Comment{Text: "// import \"influxdata/influxdb/tasks\"\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z)\n"}, ast.Comment{Text: "// ```\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// ## Query data since the last successful task run\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// ```\n"}, ast.Comment{Text: "// import \"influxdata/influxdb/tasks\"\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// option task = {\n"}, ast.Comment{Text: "//   name: \"Example task\",\n"}, ast.Comment{Text: "//   every: 30m\n"}, ast.Comment{Text: "// }\n"}, ast.Comment{Text: "//\n"}, ast.Comment{Text: "// from(bucket: \"example-bucket\")\n"}, ast.Comment{Text: "//   |> range(start: tasks.lastSuccess(orTime: -task.every))\n"}, ast.Comment{Text: "//   // ...\n"}, ast.Comment{Text: "// ```\n"}},
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 12,
							Line:   48,
						},
						File:   "tasks.flux",
						Source: "lastSuccess",
						Start: ast.Position{
							Column: 1,
							Line:   48,
						},
					},
				},
				Name: "lastSuccess",
			},
			Init: &ast.FunctionExpression{
				Arrow: nil,
				BaseNode: ast.BaseNode{
					Comments: nil,
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 64,
							Line:   48,
						},
						File:   "tasks.flux",
						Source: "(orTime) => _lastSuccess(orTime, lastSuccessTime)",
						Start: ast.Position{
							Column: 15,
							Line:   48,
						},
					},
				},
				Body: &ast.CallExpression{
					Arguments: []ast.Expression{&ast.ObjectExpression{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 63,
									Line:   48,
								},
								File:   "tasks.flux",
								Source: "orTime, lastSuccessTime",
								Start: ast.Position{
									Column: 40,
									Line:   48,
								},
							},
						},
						Lbrace: nil,
						Properties: []*ast.Property{&ast.Property{
							BaseNode: ast.BaseNode{
								Comments: nil,
								Errors:   nil,
								Loc: &ast.SourceLocation{
									End: ast.Position{
										Column: 46,
										Line:   48,
									},
									File:   "tasks.flux",
									Source: "orTime",
									Start: ast.Position{
										Column: 40,
										Line:   48,
									},
								},
							},
							Comma: nil,
							Key: &ast.Identifier{
								BaseNode: ast.BaseNode{
									Comments: nil,
									Errors:   nil,
									Loc: &ast.SourceLocation{
										End: ast.Position{
											Column: 46,
											Line:   48,
										},
										File:   "tasks.flux",
										Source: "orTime",
										Start: ast.Position{
											Column: 40,
											Line:   48,
										},
									},
								},
								Name: "orTime",
							},
							Separator: nil,
							Value:     nil,
						}, &ast.Property{
							BaseNode: ast.BaseNode{
								Comments: nil,
								Errors:   nil,
								Loc: &ast.SourceLocation{
									End: ast.Position{
										Column: 63,
										Line:   48,
									},
									File:   "tasks.flux",
									Source: "lastSuccessTime",
									Start: ast.Position{
										Column: 48,
										Line:   48,
									},
								},
							},
							Comma: nil,
							Key: &ast.Identifier{
								BaseNode: ast.BaseNode{
									Comments: nil,
									Errors:   nil,
									Loc: &ast.SourceLocation{
										End: ast.Position{
											Column: 63,
											Line:   48,
										},
										File:   "tasks.flux",
										Source: "lastSuccessTime",
										Start: ast.Position{
											Column: 48,
											Line:   48,
										},
									},
								},
								Name: "lastSuccessTime",
							},
							Separator: nil,
							Value:     nil,
						}},
						Rbrace: nil,
						With:   nil,
					}},
					BaseNode: ast.BaseNode{
						Comments: nil,
						Errors:   nil,
						Loc: &ast.SourceLocation{
							End: ast.Position{
								Column: 64,
								Line:   48,
							},
							File:   "tasks.flux",
							Source: "_lastSuccess(orTime, lastSuccessTime)",
							Start: ast.Position{
								Column: 27,
								Line:   48,
							},
						},
					},
					Callee: &ast.Identifier{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 39,
									Line:   48,
								},
								File:   "tasks.flux",
								Source: "_lastSuccess",
								Start: ast.Position{
									Column: 27,
									Line:   48,
								},
							},
						},
						Name: "_lastSuccess",
					},
					Lparen: nil,
					Rparen: nil,
				},
				Lparen: nil,
				Params: []*ast.Property{&ast.Property{
					BaseNode: ast.BaseNode{
						Comments: nil,
						Errors:   nil,
						Loc: &ast.SourceLocation{
							End: ast.Position{
								Column: 22,
								Line:   48,
							},
							File:   "tasks.flux",
							Source: "orTime",
							Start: ast.Position{
								Column: 16,
								Line:   48,
							},
						},
					},
					Comma: nil,
					Key: &ast.Identifier{
						BaseNode: ast.BaseNode{
							Comments: nil,
							Errors:   nil,
							Loc: &ast.SourceLocation{
								End: ast.Position{
									Column: 22,
									Line:   48,
								},
								File:   "tasks.flux",
								Source: "orTime",
								Start: ast.Position{
									Column: 16,
									Line:   48,
								},
							},
						},
						Name: "orTime",
					},
					Separator: nil,
					Value:     nil,
				}},
				Rparan: nil,
			},
		}},
		Eof:      nil,
		Imports:  nil,
		Metadata: "parser-type=rust",
		Name:     "tasks.flux",
		Package: &ast.PackageClause{
			BaseNode: ast.BaseNode{
				Comments: []ast.Comment{ast.Comment{Text: "// Package tasks is an experimental package.\n"}, ast.Comment{Text: "// The API for this package is not stable and should not\n"}, ast.Comment{Text: "// be counted on for production code.\n"}},
				Errors:   nil,
				Loc: &ast.SourceLocation{
					End: ast.Position{
						Column: 14,
						Line:   4,
					},
					File:   "tasks.flux",
					Source: "package tasks",
					Start: ast.Position{
						Column: 1,
						Line:   4,
					},
				},
			},
			Name: &ast.Identifier{
				BaseNode: ast.BaseNode{
					Comments: nil,
					Errors:   nil,
					Loc: &ast.SourceLocation{
						End: ast.Position{
							Column: 14,
							Line:   4,
						},
						File:   "tasks.flux",
						Source: "tasks",
						Start: ast.Position{
							Column: 9,
							Line:   4,
						},
					},
				},
				Name: "tasks",
			},
		},
	}},
	Package: "tasks",
	Path:    "influxdata/influxdb/tasks",
}
