text:
""" Syntax for a generalized algebraic theory (GAT).

Unlike instances of a theory, syntactic expressions don't necessarily satisfy
the equations of the theory. For example, the default syntax operations for the
`Category` theory don't form a category because they don't satisfy the category
laws, e.g.,
```
compose(f, id(A)) != compose(f)
```
Whether dependent types are enforced at runtime and whether expressions are
automatically brought to normal form depends on the particular syntax. In
general, a single theory may have many different syntaxes. The purpose of this
module to make the construction of syntax simple but flexible.
"""
module Syntax
export @syntax, GATExpr, SyntaxDomainError, head, args, type_args, first, last,
  invoke_term, functor, to_json_sexpr, parse_json_sexpr, show_sexpr,
  show_unicode, show_latex

import Base: first, last
import Base.Meta: ParseError, show_sexpr
using Compat
using Match

using ..GAT: Context, Signature, TypeConstructor, TermConstructor, Typeclass
import ..GAT
import ..GAT: invoke_term
using ..Meta

# Data types
############

""" Base type for expression in the syntax of a GAT.

We define Julia types for each *type constructor* in the theory, e.g., object,
morphism, and 2-morphism in the theory of 2-categories. Of course, Julia's
type system does not support dependent types, so the type parameters are
incorporated in the Julia types. (They are stored as extra data in the
expression instances.)

The concrete types are structurally similar to the core type `Expr` in Julia.
However, the *term constructor* is represented as a type parameter, rather than
as a `head` field. This makes dispatch using Julia's type system more
convenient.
"""
abstract type GATExpr{T} end

head(::GATExpr{T}) where T = T
args(expr::GATExpr) = expr.args
first(expr::GATExpr) = first(args(expr))
last(expr::GATExpr) = last(args(expr))
type_args(expr::GATExpr) = expr.type_args

function Base.:(==)(e1::GATExpr, e2::GATExpr)
  head(e1) == head(e2) && args(e1) == args(e2) && type_args(e1) == type_args(e2)
end
function Base.hash(e::GATExpr, h::UInt)
  hash(args(e), hash(head(e), h))
end

function Base.show(io::IO, expr::GATExpr)
  print(io, head(expr))
  print(io, "(")
  join(io, args(expr), ",")
  print(io, ")")
end
function Base.show(io::IO, expr::GATExpr{:generator})
  value = first(expr)
  if isnothing(value)
    show(io, value) # Value `nothing` cannot be printed
  else
    print(io, value)
  end
end

struct SyntaxDomainError <: Exception
  constructor::Symbol
  args::Vector
end

function Base.showerror(io::IO, exc::SyntaxDomainError)
  print(io, "Domain error in term constructor $(exc.constructor)(")
  join(io, exc.args, ",")
  print(io, ")")
end

# Syntax
########

""" Define a *syntax* system for a generalized algebraic theory (GAT).

A syntax system consists of Julia types (with top type `GATExpr`) for each type
constructor in the signature, plus Julia functions for

1. *Generators*: creating new generator terms, e.g., objects or morphisms
2. *Accessors*: accessing type parameters, e.g., domains and codomains
3. *Term constructors*: applying term constructors, e.g., composition and
   monoidal products

Julia code for all this is generated by the macro. Any of the methods can be
overriden with custom simplification logic.
"""
macro syntax(syntax_head, mod_name, body=Expr(:block))
  @assert body.head == :block
  syntax_name, base_types = @match syntax_head begin
    Expr(:call, [name::Symbol, args...]) => (name, args)
    name::Symbol => (name, [])
    _ => throw(ParseError("Ill-formed syntax signature $syntax_head"))
  end
  functions = map(parse_function, strip_lines(body).args)

  expr = Expr(:call, :syntax_code, Expr(:quote, syntax_name),
              esc(Expr(:ref, :Type, base_types...)),
              esc(mod_name), esc(nameof(__module__)), functions)
  Expr(:block,
    Expr(:call, esc(:eval), expr),
    :(Core.@__doc__ $(esc(syntax_name))))
end
function syntax_code(name::Symbol, base_types::Vector{Type},
                     signature_module::Module, outer_module::Module,
                     functions::Vector)
  class = signature_module.class()
  signature = class.signature
  signature_ref = GlobalRef(parentmodule(signature_module),
                            nameof(signature_module))

  # Generate module with syntax types and type/term generators.
  mod = Expr(:module, true, name,
    Expr(:block, [
      # Prevents error about export not being at toplevel.
      # https://github.com/JuliaLang/julia/issues/28991
      LineNumberNode(0);
      Expr(:export, [cons.name for cons in signature.types]...);
      Expr(:using, Expr(:., :., :., nameof(outer_module)));
      :(signature() = $signature_ref);
      gen_types(signature, base_types);
      gen_type_accessors(signature);
      gen_term_generators(signature, outer_module);
      gen_term_constructors(signature, outer_module);
    ]...))

  # Generate toplevel functions.
  toplevel = []
  bindings = Dict{Symbol,Any}(
    c.name => Expr(:(.), name, QuoteNode(c.name)) for c in signature.types)
  bindings[:Super] = name
  syntax_fns = Dict(parse_function_sig(f) => f for f in functions)
  for f in interface(class)
    sig = parse_function_sig(f)
    if haskey(syntax_fns, sig)
      # Case 1: The method is overriden in the syntax body.
      expr = generate_function(replace_symbols(bindings, syntax_fns[sig]))
    elseif !isnothing(f.impl)
      # Case 2: The method has a default implementation in the signature.
      expr = generate_function(replace_symbols(bindings, f))
    else
      # Case 3: Call the default syntax method.
      params = [ gensym("x$i") for i in eachindex(sig.types) ]
      call_expr = Expr(:call, sig.name,
        [ Expr(:(::), p, t) for (p,t) in zip(params, sig.types) ]...)
      body = Expr(:call, Expr(:(.), name, QuoteNode(sig.name)), params...)
      f_impl = JuliaFunction(call_expr, f.return_type, body)
      expr = generate_function(replace_symbols(bindings, f_impl))
    end
    push!(toplevel, expr)
  end
  Expr(:toplevel, mod, toplevel...)
end

""" Complete set of Julia functions for a syntax system.
"""
function interface(class::Typeclass)::Vector{JuliaFunction}
  sig = class.signature
  [ GAT.interface(class);
    [ GAT.constructor(constructor_for_generator(cons), sig)
      for cons in sig.types ]; ]
end

""" Generate syntax type definitions.
"""
function gen_type(cons::TypeConstructor, base_type::Type=Any)::Expr
  base_expr = GlobalRef(Syntax, :GATExpr)
  base_name = if base_type == Any
    base_expr
  else
    GlobalRef(parentmodule(base_type), nameof(base_type))
  end
  expr = :(struct $(cons.name){T} <: $base_name{T}
    args::Vector
    type_args::Vector{$base_expr}
  end)
  generate_docstring(strip_lines(expr, recurse=true), cons.doc)
end
function gen_types(sig::Signature, base_types::Vector{Type})::Vector{Expr}
  if isempty(base_types)
    map(gen_type, sig.types)
  else
    map(gen_type, sig.types, base_types)
  end
end

""" Generate accessor methods for type parameters.
"""
function gen_type_accessors(cons::TypeConstructor)::Vector{Expr}
  fns = []
  sym = gensym(:x)
  for (i, param) in enumerate(cons.params)
    call_expr = Expr(:call, param, Expr(:(::), sym, cons.name))
    return_type = GAT.strip_type(cons.context[param])
    body = Expr(:ref, Expr(:(.), sym, QuoteNode(:type_args)), i)
    push!(fns, generate_function(JuliaFunction(call_expr, return_type, body)))
  end
  fns
end
function gen_type_accessors(sig::Signature)::Vector{Expr}
  vcat(map(gen_type_accessors, sig.types)...)
end

""" Generate methods for syntax term constructors.
"""
function gen_term_constructor(cons::TermConstructor, sig::Signature,
                              mod::Module; dispatch_type::Symbol=Symbol())::Expr
  head = GAT.constructor(cons, sig)
  call_expr, return_type = head.call_expr, head.return_type
  if dispatch_type == Symbol()
    dispatch_type = cons.name
  end
  body = Expr(:block)

  # Create expression to check constructor domain.
  eqs = GAT.equations(cons, sig)
  if !isempty(eqs)
    clauses = [ Expr(:call,:(==),lhs,rhs) for (lhs,rhs) in eqs ]
    conj = foldr((x,y) -> Expr(:(&&),x,y), clauses)
    insert!(call_expr.args, 2,
      Expr(:parameters, Expr(:kw, :strict, false)))
    push!(body.args,
      Expr(:if,
        Expr(:(&&), :strict, Expr(:call, :(!), conj)),
        Expr(:call, :throw,
          Expr(:call, GlobalRef(Syntax, :SyntaxDomainError),
            Expr(:quote, cons.name),
            Expr(:vect, cons.params...)))))
  end

  # Create call to expression constructor.
  type_params = gen_term_constructor_params(cons, sig, mod)
  push!(body.args,
    Expr(:call,
      Expr(:curly, return_type, Expr(:quote, dispatch_type)),
      Expr(:vect, cons.params...),
      Expr(:vect, type_params...)))

  generate_function(JuliaFunction(call_expr, return_type, body))
end
function gen_term_constructors(sig::Signature, mod::Module)::Vector{Expr}
  [ gen_term_constructor(cons, sig, mod) for cons in sig.terms ]
end

""" Generate expressions for type parameters of term constructor.

Besides expanding the implicit variables, we must handle two annoying issues:

1. Add types for method dispatch where necessary (see `GAT.add_type_dispatch`)
   FIXME: We are currently only handling the nullary case (e.g., `munit()`).
   To handle the general case, we need to do basic type inference.

2. Rebind the term constructors to ensure that user overrides are preferred over
   the default term constructors.
"""
function gen_term_constructor_params(cons, sig, mod)::Vector
  expr = GAT.expand_term_type(cons, sig)
  raw_params = @match expr begin
    Expr(:call, [name::Symbol, args...]) => args
    _::Symbol => []
  end

  bindings = Dict(c.name => GlobalRef(mod, c.name) for c in sig.terms)
  params = []
  for expr in raw_params
    expr = replace_nullary_constructors(expr, sig)
    expr = replace_symbols(bindings, expr)
    push!(params, expr)
  end
  params
end
function replace_nullary_constructors(expr, sig)
  @match expr begin
    Expr(:call, [name::Symbol]) => begin
      terms = sig.terms[findall(cons -> cons.name == name, sig.terms)]
      @assert length(terms) == 1
      Expr(:call, name, terms[1].typ)
    end
    Expr(:call, [name::Symbol, args...]) =>
      Expr(:call, name, [replace_nullary_constructors(a,sig) for a in args]...)
    _ => expr
  end
end

""" Generate methods for term generators.

Generators are extra term constructors created automatically for the syntax.
"""
function gen_term_generator(cons::TypeConstructor, sig::Signature, mod::Module)::Expr
  gen_term_constructor(constructor_for_generator(cons), sig, mod;
                       dispatch_type = :generator)
end
function gen_term_generators(sig::Signature, mod::Module)::Vector{Expr}
  [ gen_term_generator(cons, sig, mod) for cons in sig.types ]
end
function constructor_for_generator(cons::TypeConstructor)::TermConstructor
  value_param = :__value__
  params = [ value_param; cons.params ]
  typ = Expr(:call, cons.name, cons.params...)
  context = merge(Context(value_param => :Any), cons.context)
  TermConstructor(cons.name, params, typ, context)
end

# Reflection
############

""" Invoke a term constructor by name in a syntax system.

This method provides reflection for syntax systems. In everyday use the generic
method for the constructor should be called directly, not through this function.
"""
function invoke_term(syntax_module::Module, constructor_name::Symbol, args...)
  signature_module = syntax_module.signature()
  signature = signature_module.class().signature
  syntax_types = Tuple(getfield(syntax_module, cons.name) for cons in signature.types)
  invoke_term(signature_module, syntax_types, constructor_name, args...)
end

""" Name of constructor that created expression.
"""
function constructor_name(expr::GATExpr)::Symbol
  if head(expr) == :generator
    nameof(typeof(expr))
  else
    head(expr)
  end
end

""" Create generator of the same type as the given expression.
"""
function generator_like(expr::GATExpr, value)::GATExpr
  invoke_term(
    parentmodule(typeof(expr)),
    nameof(typeof(expr)),
    value,
    type_args(expr)...
  )
end

# Functors
##########

""" Functor from GAT expression to GAT instance.

Strictly speaking, we should call these "structure-preserving functors" or,
better, "model homomorphisms of GATs". But this is a category theory library,
so we'll go with the simpler "functor".

A functor is completely determined by its action on the generators. There are
several ways to specify this mapping:

  1. Simply specify a Julia instance type for each doctrine type, using the
     required `types` tuple. For this to work, the generator constructors
     must be defined for the instance types.

  2. Explicitly map each generator term to an instance value, using the
     `generators` dictionary.

  3. For each doctrine type (e.g., object and morphism), specify a function
     mapping generator terms of that type to an instance value, using the
     `terms` dictionary.

The `terms` dictionary can also be used for special handling of non-generator
expressions. One use case for this capability is defining forgetful functors,
which map non-generators to generators.
"""
function functor(types::Tuple, expr::GATExpr;
                 generators::AbstractDict=Dict(), terms::AbstractDict=Dict())
  # Special case: look up a specific generator.
  if head(expr) == :generator && haskey(generators, expr)
    return generators[expr]
  end

  # Special case: look up by type of term (usually a generator).
  name = constructor_name(expr)
  if haskey(terms, name)
    return terms[name](expr)
  end

  # Otherwise, we need to call a term constructor (possibly for a generator).
  # Recursively evalute the arguments.
  term_args = []
  for arg in args(expr)
    if isa(arg, GATExpr)
      arg = functor(types, arg; generators=generators, terms=terms)
    end
    push!(term_args, arg)
  end

  # Invoke the constructor in the codomain category!
  syntax_module = parentmodule(typeof(expr))
  signature_module = syntax_module.signature()
  invoke_term(signature_module, types, name, term_args...)
end

# Serialization
###############

""" Serialize expression as JSON-able S-expression.

The format is an S-expression encoded as JSON, e.g., "compose(f,g)" is
represented as ["compose", f, g].
"""
function to_json_sexpr(expr::GATExpr;
    by_reference::Function = default_to_json_by_reference
  )
  if head(expr) == :generator && by_reference(first(expr))
    to_json_sexpr(first(expr))
  else
    [ string(constructor_name(expr)); map(to_json_sexpr, args(expr)) ]
  end
end
to_json_sexpr(::Nothing) = nothing
to_json_sexpr(x::String) = x
to_json_sexpr(x::Real) = x
to_json_sexpr(x::Bool) = x
to_json_sexpr(x) = string(x)

default_to_json_by_reference(x) = false

""" Deserialize expression from JSON-able S-expression.

If `symbols` is true (the default), strings are converted to symbols.
"""
function parse_json_sexpr(syntax_module::Module, sexpr;
    parse_head::Function = identity,
    parse_reference::Function = disable_parse_json_reference,
    parse_value::Function = identity,
    symbols::Bool = true,
  )
  signature_module = syntax_module.signature()
  signature = signature_module.class().signature
  type_lens = Dict(cons.name => length(cons.params) for cons in signature.types)

  # The "value" type is
  # - false if the sexpr should be parsed as a term (GAT expression)
  # - true if the sexpr should be parsed as a value (Julia object)
  function parse_impl(sexpr::Vector, ::Type{Val{false}})
    name = Symbol(parse_head(symbols ? Symbol(sexpr[1]) : sexpr[1]))
    nargs = length(sexpr) - 1
    args = [
      parse_impl(arg, Val{
        (i == 1 && get(type_lens, name, nothing) == nargs-1) ||
        isa(arg, Bool) || isa(arg, Number) || isa(arg, Nothing)
      })
      for (i, arg) in enumerate(sexpr[2:end])
    ]
    invoke_term(syntax_module, name, args...)
  end
  parse_impl(x, ::Type{Val{true}}) = parse_value(x)
  parse_impl(x::String, ::Type{Val{false}}) = parse_reference(symbols ? Symbol(x) : x)
  parse_impl(x::String, ::Type{Val{true}}) = parse_value(symbols ? Symbol(x) : x)

  parse_impl(sexpr, Val{false})
end

disable_parse_json_reference(x) = error("Loading terms by name is not enabled")

# Pretty-print
##############

""" Show the syntax expression as an S-expression.

Cf. the standard library function `Meta.show_sexpr`.
"""
show_sexpr(expr::GATExpr) = show_sexpr(stdout, expr)

function show_sexpr(io::IO, expr::GATExpr)
  if head(expr) == :generator
    print(io, repr(first(expr)))
  else
    print(io, "(")
    join(io, [string(head(expr));
              [sprint(show_sexpr, arg) for arg in args(expr)]], " ")
    print(io, ")")
  end
end

""" Show the expression in infix notation using Unicode symbols.
"""
show_unicode(expr::GATExpr) = show_unicode(stdout, expr)
show_unicode(io::IO, x::Any; kw...) = show(io, x)

function show_unicode(io::IO, expr::GATExpr; kw...)
  # By default, show in prefix notation.
  print(io, head(expr))
  print(io, "[")
  join(io, [sprint(show_unicode, arg) for arg in args(expr)], ",")
  print(io, "]")
end

function show_unicode(io::IO, expr::GATExpr{:generator}; kw...)
  print(io, first(expr))
end

function show_unicode_infix(io::IO, expr::GATExpr, op::String;
                            paren::Bool=false)
  show_unicode_paren(io, expr) = show_unicode(io, expr; paren=true)
  if (paren) print(io, "(") end
  join(io, [sprint(show_unicode_paren, arg) for arg in args(expr)], op)
  if (paren) print(io, ")") end
end

""" Show the expression in infix notation using LaTeX math.

Does *not* include `\$` or `\\[begin|end]{equation}` delimiters.
"""
show_latex(expr::GATExpr) = show_latex(stdout, expr)
show_latex(io::IO, sym::Symbol; kw...) = print(io, sym)
show_latex(io::IO, x::Any; kw...) = show(io, x)

function show_latex(io::IO, expr::GATExpr; kw...)
  # By default, show in prefix notation.
  print(io, "\\mathop{\\mathrm{$(head(expr))}}")
  print(io, "\\left[")
  join(io, [sprint(show_latex, arg) for arg in args(expr)], ",")
  print(io, "\\right]")
end

function show_latex(io::IO, expr::GATExpr{:generator}; kw...)
  # Try to be smart about using text or math mode.
  content = string(first(expr))
  if all(isletter, content) && length(content) > 1
    print(io, "\\mathrm{$content}")
  else
    print(io, content)
  end
end

function show_latex_infix(io::IO, expr::GATExpr, op::String;
                          paren::Bool=false, kw...)
  show_latex_paren(io, expr) = show_latex(io, expr; paren=true, kw...)
  sep = op == " " ? op : " $op "
  if (paren) print(io, "\\left(") end
  join(io, [sprint(show_latex_paren, arg) for arg in args(expr)], sep)
  if (paren) print(io, "\\right)") end
end

function show_latex_script(io::IO, expr::GATExpr, head::String;
                           super::Bool=false, kw...)
  print(io, head, super ? "^" : "_", "{")
  join(io, [sprint(show_latex, arg) for arg in args(expr)], ",")
  print(io, "}")
end

end


text:
# Use baremodule to shave off a few KB from the serialized `.ji` file
baremodule Graphite2_jll
using Base
using Base: UUID
import JLLWrappers

JLLWrappers.@generate_main_file_header("Graphite2")
JLLWrappers.@generate_main_file("Graphite2", UUID("3b182d85-2403-5c21-9c21-1e1f0cc25472"))
end  # module Graphite2_jll

ext: jl


text:
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: eks
using AWS.Compat
using AWS.UUIDs

"""
    associate_encryption_config(encryption_config, name)
    associate_encryption_config(encryption_config, name, params::Dict{String,<:Any})

Associate encryption configuration to an existing cluster. You can use this API to enable
encryption on existing clusters which do not have encryption already enabled. This allows
you to implement a defense-in-depth security strategy without migrating applications to new
Amazon EKS clusters.

# Arguments
- `encryption_config`: The configuration you are using for encryption.
- `name`: The name of the cluster that you are associating with encryption configuration.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: The client request token you are using with the encryption
  configuration.
"""
function associate_encryption_config(
    encryptionConfig, name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/encryption-config/associate",
        Dict{String,Any}(
            "encryptionConfig" => encryptionConfig, "clientRequestToken" => string(uuid4())
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function associate_encryption_config(
    encryptionConfig,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/encryption-config/associate",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "encryptionConfig" => encryptionConfig,
                    "clientRequestToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    associate_identity_provider_config(name, oidc)
    associate_identity_provider_config(name, oidc, params::Dict{String,<:Any})

Associate an identity provider configuration to a cluster. If you want to authenticate
identities using an identity provider, you can create an identity provider configuration
and associate it to your cluster. After configuring authentication to your cluster you can
create Kubernetes roles and clusterroles to assign permissions to the roles, and then bind
the roles to the identities using Kubernetes rolebindings and clusterrolebindings. For more
information see Using RBAC Authorization in the Kubernetes documentation.

# Arguments
- `name`: The name of the cluster to associate the configuration to.
- `oidc`: An object that represents an OpenID Connect (OIDC) identity provider
  configuration.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"tags"`: The metadata to apply to the configuration to assist with categorization and
  organization. Each tag consists of a key and an optional value, both of which you define.
"""
function associate_identity_provider_config(
    name, oidc; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/identity-provider-configs/associate",
        Dict{String,Any}("oidc" => oidc, "clientRequestToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function associate_identity_provider_config(
    name,
    oidc,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/identity-provider-configs/associate",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("oidc" => oidc, "clientRequestToken" => string(uuid4())),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_addon(addon_name, name)
    create_addon(addon_name, name, params::Dict{String,<:Any})

Creates an Amazon EKS add-on. Amazon EKS add-ons help to automate the provisioning and
lifecycle management of common operational software for Amazon EKS clusters. Amazon EKS
add-ons can only be used with Amazon EKS clusters running version 1.18 with platform
version eks.3 or later because add-ons rely on the Server-side Apply Kubernetes feature,
which is only available in Kubernetes 1.18 and later.

# Arguments
- `addon_name`: The name of the add-on. The name must match one of the names returned by
  DescribeAddonVersions .
- `name`: The name of the cluster to create the add-on for.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"addonVersion"`: The version of the add-on. The version must match one of the versions
  returned by  DescribeAddonVersions .
- `"clientRequestToken"`: A unique, case-sensitive identifier that you provide to ensure
  the idempotency of the request.
- `"resolveConflicts"`: How to resolve parameter value conflicts when migrating an existing
  add-on to an Amazon EKS add-on.
- `"serviceAccountRoleArn"`: The Amazon Resource Name (ARN) of an existing IAM role to bind
  to the add-on's service account. The role must be assigned the IAM permissions required by
  the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions
  assigned to the node IAM role. For more information, see Amazon EKS node IAM role in the
  Amazon EKS User Guide.  To specify an existing IAM role, you must have an IAM OpenID
  Connect (OIDC) provider created for your cluster. For more information, see Enabling IAM
  roles for service accounts on your cluster in the Amazon EKS User Guide.
- `"tags"`: The metadata to apply to the cluster to assist with categorization and
  organization. Each tag consists of a key and an optional value, both of which you define.
"""
function create_addon(addonName, name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "POST",
        "/clusters/$(name)/addons",
        Dict{String,Any}("addonName" => addonName, "clientRequestToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_addon(
    addonName,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/addons",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "addonName" => addonName, "clientRequestToken" => string(uuid4())
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_cluster(name, resources_vpc_config, role_arn)
    create_cluster(name, resources_vpc_config, role_arn, params::Dict{String,<:Any})

Creates an Amazon EKS control plane.  The Amazon EKS control plane consists of control
plane instances that run the Kubernetes software, such as etcd and the API server. The
control plane runs in an account managed by Amazon Web Services, and the Kubernetes API is
exposed via the Amazon EKS API server endpoint. Each Amazon EKS cluster control plane is
single-tenant and unique and runs on its own set of Amazon EC2 instances. The cluster
control plane is provisioned across multiple Availability Zones and fronted by an Elastic
Load Balancing Network Load Balancer. Amazon EKS also provisions elastic network interfaces
in your VPC subnets to provide connectivity from the control plane instances to the nodes
(for example, to support kubectl exec, logs, and proxy data flows). Amazon EKS nodes run in
your Amazon Web Services account and connect to your cluster's control plane via the
Kubernetes API server endpoint and a certificate file that is created for your cluster.
Cluster creation typically takes several minutes. After you create an Amazon EKS cluster,
you must configure your Kubernetes tooling to communicate with the API server and launch
nodes into your cluster. For more information, see Managing Cluster Authentication and
Launching Amazon EKS nodes in the Amazon EKS User Guide.

# Arguments
- `name`: The unique name to give to your cluster.
- `resources_vpc_config`: The VPC configuration used by the cluster control plane. Amazon
  EKS VPC resources have specific requirements to work properly with Kubernetes. For more
  information, see Cluster VPC Considerations and Cluster Security Group Considerations in
  the Amazon EKS User Guide. You must specify at least two subnets. You can specify up to
  five security groups, but we recommend that you use a dedicated security group for your
  cluster control plane.
- `role_arn`: The Amazon Resource Name (ARN) of the IAM role that provides permissions for
  the Kubernetes control plane to make calls to Amazon Web Services API operations on your
  behalf. For more information, see Amazon EKS Service IAM Role in the  Amazon EKS User Guide
  .

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"encryptionConfig"`: The encryption configuration for the cluster.
- `"kubernetesNetworkConfig"`: The Kubernetes network configuration for the cluster.
- `"logging"`: Enable or disable exporting the Kubernetes control plane logs for your
  cluster to CloudWatch Logs. By default, cluster control plane logs aren't exported to
  CloudWatch Logs. For more information, see Amazon EKS Cluster control plane logs in the
  Amazon EKS User Guide .  CloudWatch Logs ingestion, archive storage, and data scanning
  rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
- `"tags"`: The metadata to apply to the cluster to assist with categorization and
  organization. Each tag consists of a key and an optional value, both of which you define.
- `"version"`: The desired Kubernetes version for your cluster. If you don't specify a
  value here, the latest version available in Amazon EKS is used.
"""
function create_cluster(
    name, resourcesVpcConfig, roleArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters",
        Dict{String,Any}(
            "name" => name,
            "resourcesVpcConfig" => resourcesVpcConfig,
            "roleArn" => roleArn,
            "clientRequestToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_cluster(
    name,
    resourcesVpcConfig,
    roleArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "name" => name,
                    "resourcesVpcConfig" => resourcesVpcConfig,
                    "roleArn" => roleArn,
                    "clientRequestToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_fargate_profile(fargate_profile_name, name, pod_execution_role_arn)
    create_fargate_profile(fargate_profile_name, name, pod_execution_role_arn, params::Dict{String,<:Any})

Creates an Fargate profile for your Amazon EKS cluster. You must have at least one Fargate
profile in a cluster to be able to run pods on Fargate. The Fargate profile allows an
administrator to declare which pods run on Fargate and specify which pods run on which
Fargate profile. This declaration is done through the profile’s selectors. Each profile
can have up to five selectors that contain a namespace and labels. A namespace is required
for every selector. The label field consists of multiple optional key-value pairs. Pods
that match the selectors are scheduled on Fargate. If a to-be-scheduled pod matches any of
the selectors in the Fargate profile, then that pod is run on Fargate. When you create a
Fargate profile, you must specify a pod execution role to use with the pods that are
scheduled with the profile. This role is added to the cluster's Kubernetes Role Based
Access Control (RBAC) for authorization so that the kubelet that is running on the Fargate
infrastructure can register with your Amazon EKS cluster so that it can appear in your
cluster as a node. The pod execution role also provides IAM permissions to the Fargate
infrastructure to allow read access to Amazon ECR image repositories. For more information,
see Pod Execution Role in the Amazon EKS User Guide. Fargate profiles are immutable.
However, you can create a new updated profile to replace an existing profile and then
delete the original after the updated profile has finished creating. If any Fargate
profiles in a cluster are in the DELETING status, you must wait for that Fargate profile to
finish deleting before you can create any other profiles in that cluster. For more
information, see Fargate Profile in the Amazon EKS User Guide.

# Arguments
- `fargate_profile_name`: The name of the Fargate profile.
- `name`: The name of the Amazon EKS cluster to apply the Fargate profile to.
- `pod_execution_role_arn`: The Amazon Resource Name (ARN) of the pod execution role to use
  for pods that match the selectors in the Fargate profile. The pod execution role allows
  Fargate infrastructure to register with your cluster as a node, and it provides read access
  to Amazon ECR image repositories. For more information, see Pod Execution Role in the
  Amazon EKS User Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"selectors"`: The selectors to match for pods to use this Fargate profile. Each selector
  must have an associated namespace. Optionally, you can also specify labels for a namespace.
  You may specify up to five selectors in a Fargate profile.
- `"subnets"`: The IDs of subnets to launch your pods into. At this time, pods running on
  Fargate are not assigned public IP addresses, so only private subnets (with no direct route
  to an Internet Gateway) are accepted for this parameter.
- `"tags"`: The metadata to apply to the Fargate profile to assist with categorization and
  organization. Each tag consists of a key and an optional value, both of which you define.
  Fargate profile tags do not propagate to any other resources associated with the Fargate
  profile, such as the pods that are scheduled with it.
"""
function create_fargate_profile(
    fargateProfileName,
    name,
    podExecutionRoleArn;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/fargate-profiles",
        Dict{String,Any}(
            "fargateProfileName" => fargateProfileName,
            "podExecutionRoleArn" => podExecutionRoleArn,
            "clientRequestToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_fargate_profile(
    fargateProfileName,
    name,
    podExecutionRoleArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/fargate-profiles",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "fargateProfileName" => fargateProfileName,
                    "podExecutionRoleArn" => podExecutionRoleArn,
                    "clientRequestToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_nodegroup(name, node_role, nodegroup_name, subnets)
    create_nodegroup(name, node_role, nodegroup_name, subnets, params::Dict{String,<:Any})

Creates a managed node group for an Amazon EKS cluster. You can only create a node group
for your cluster that is equal to the current Kubernetes version for the cluster. All node
groups are created with the latest AMI release version for the respective minor Kubernetes
version of the cluster, unless you deploy a custom AMI using a launch template. For more
information about using launch templates, see Launch template support. An Amazon EKS
managed node group is an Amazon EC2 Auto Scaling group and associated Amazon EC2 instances
that are managed by Amazon Web Services for an Amazon EKS cluster. Each node group uses a
version of the Amazon EKS optimized Amazon Linux 2 AMI. For more information, see Managed
Node Groups in the Amazon EKS User Guide.

# Arguments
- `name`: The name of the cluster to create the node group in.
- `node_role`: The Amazon Resource Name (ARN) of the IAM role to associate with your node
  group. The Amazon EKS worker node kubelet daemon makes calls to Amazon Web Services APIs on
  your behalf. Nodes receive permissions for these API calls through an IAM instance profile
  and associated policies. Before you can launch nodes and register them into a cluster, you
  must create an IAM role for those nodes to use when they are launched. For more
  information, see Amazon EKS node IAM role in the  Amazon EKS User Guide . If you specify
  launchTemplate, then don't specify  IamInstanceProfile  in your launch template, or the
  node group deployment will fail. For more information about using launch templates with
  Amazon EKS, see Launch template support in the Amazon EKS User Guide.
- `nodegroup_name`: The unique name to give your node group.
- `subnets`: The subnets to use for the Auto Scaling group that is created for your node
  group. If you specify launchTemplate, then don't specify  SubnetId  in your launch
  template, or the node group deployment will fail. For more information about using launch
  templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"amiType"`: The AMI type for your node group. GPU instance types should use the
  AL2_x86_64_GPU AMI type. Non-GPU instances should use the AL2_x86_64 AMI type. Arm
  instances should use the AL2_ARM_64 AMI type. All types use the Amazon EKS optimized Amazon
  Linux 2 AMI. If you specify launchTemplate, and your launch template uses a custom AMI,
  then don't specify amiType, or the node group deployment will fail. For more information
  about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS
  User Guide.
- `"capacityType"`: The capacity type for your node group.
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"diskSize"`: The root device disk size (in GiB) for your node group instances. The
  default disk size is 20 GiB. If you specify launchTemplate, then don't specify diskSize, or
  the node group deployment will fail. For more information about using launch templates with
  Amazon EKS, see Launch template support in the Amazon EKS User Guide.
- `"instanceTypes"`: Specify the instance types for a node group. If you specify a GPU
  instance type, be sure to specify AL2_x86_64_GPU with the amiType parameter. If you specify
  launchTemplate, then you can specify zero or one instance type in your launch template or
  you can specify 0-20 instance types for instanceTypes. If however, you specify an instance
  type in your launch template and specify any instanceTypes, the node group deployment will
  fail. If you don't specify an instance type in a launch template or for instanceTypes, then
  t3.medium is used, by default. If you specify Spot for capacityType, then we recommend
  specifying multiple values for instanceTypes. For more information, see Managed node group
  capacity types and Launch template support in the Amazon EKS User Guide.
- `"labels"`: The Kubernetes labels to be applied to the nodes in the node group when they
  are created.
- `"launchTemplate"`: An object representing a node group's launch template specification.
  If specified, then do not specify instanceTypes, diskSize, or remoteAccess and make sure
  that the launch template meets the requirements in launchTemplateSpecification.
- `"releaseVersion"`: The AMI version of the Amazon EKS optimized AMI to use with your node
  group. By default, the latest available AMI version for the node group's current Kubernetes
  version is used. For more information, see Amazon EKS optimized Amazon Linux 2 AMI versions
  in the Amazon EKS User Guide. If you specify launchTemplate, and your launch template uses
  a custom AMI, then don't specify releaseVersion, or the node group deployment will fail.
  For more information about using launch templates with Amazon EKS, see Launch template
  support in the Amazon EKS User Guide.
- `"remoteAccess"`: The remote access (SSH) configuration to use with your node group. If
  you specify launchTemplate, then don't specify remoteAccess, or the node group deployment
  will fail. For more information about using launch templates with Amazon EKS, see Launch
  template support in the Amazon EKS User Guide.
- `"scalingConfig"`: The scaling configuration details for the Auto Scaling group that is
  created for your node group.
- `"tags"`: The metadata to apply to the node group to assist with categorization and
  organization. Each tag consists of a key and an optional value, both of which you define.
  Node group tags do not propagate to any other resources associated with the node group,
  such as the Amazon EC2 instances or subnets.
- `"taints"`: The Kubernetes taints to be applied to the nodes in the node group.
- `"updateConfig"`: The node group update configuration.
- `"version"`: The Kubernetes version to use for your managed nodes. By default, the
  Kubernetes version of the cluster is used, and this is the only accepted specified value.
  If you specify launchTemplate, and your launch template uses a custom AMI, then don't
  specify version, or the node group deployment will fail. For more information about using
  launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide.
"""
function create_nodegroup(
    name,
    nodeRole,
    nodegroupName,
    subnets;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/node-groups",
        Dict{String,Any}(
            "nodeRole" => nodeRole,
            "nodegroupName" => nodegroupName,
            "subnets" => subnets,
            "clientRequestToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_nodegroup(
    name,
    nodeRole,
    nodegroupName,
    subnets,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/node-groups",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "nodeRole" => nodeRole,
                    "nodegroupName" => nodegroupName,
                    "subnets" => subnets,
                    "clientRequestToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_addon(addon_name, name)
    delete_addon(addon_name, name, params::Dict{String,<:Any})

Delete an Amazon EKS add-on. When you remove the add-on, it will also be deleted from the
cluster. You can always manually start an add-on on the cluster using the Kubernetes API.

# Arguments
- `addon_name`: The name of the add-on. The name must match one of the names returned by
  ListAddons .
- `name`: The name of the cluster to delete the add-on from.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"preserve"`: Specifying this option preserves the add-on software on your cluster but
  Amazon EKS stops managing any settings for the add-on. If an IAM account is associated with
  the add-on, it is not removed.
"""
function delete_addon(addonName, name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "DELETE",
        "/clusters/$(name)/addons/$(addonName)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_addon(
    addonName,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "DELETE",
        "/clusters/$(name)/addons/$(addonName)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_cluster(name)
    delete_cluster(name, params::Dict{String,<:Any})

Deletes the Amazon EKS cluster control plane. If you have active services in your cluster
that are associated with a load balancer, you must delete those services before deleting
the cluster so that the load balancers are deleted properly. Otherwise, you can have
orphaned resources in your VPC that prevent you from being able to delete the VPC. For more
information, see Deleting a Cluster in the Amazon EKS User Guide. If you have managed node
groups or Fargate profiles attached to the cluster, you must delete them first. For more
information, see DeleteNodegroup and DeleteFargateProfile.

# Arguments
- `name`: The name of the cluster to delete.

"""
function delete_cluster(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "DELETE",
        "/clusters/$(name)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_cluster(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "DELETE",
        "/clusters/$(name)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_fargate_profile(fargate_profile_name, name)
    delete_fargate_profile(fargate_profile_name, name, params::Dict{String,<:Any})

Deletes an Fargate profile. When you delete a Fargate profile, any pods running on Fargate
that were created with the profile are deleted. If those pods match another Fargate
profile, then they are scheduled on Fargate with that profile. If they no longer match any
Fargate profiles, then they are not scheduled on Fargate and they may remain in a pending
state. Only one Fargate profile in a cluster can be in the DELETING status at a time. You
must wait for a Fargate profile to finish deleting before you can delete any other profiles
in that cluster.

# Arguments
- `fargate_profile_name`: The name of the Fargate profile to delete.
- `name`: The name of the Amazon EKS cluster associated with the Fargate profile to delete.

"""
function delete_fargate_profile(
    fargateProfileName, name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "DELETE",
        "/clusters/$(name)/fargate-profiles/$(fargateProfileName)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_fargate_profile(
    fargateProfileName,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "DELETE",
        "/clusters/$(name)/fargate-profiles/$(fargateProfileName)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_nodegroup(name, nodegroup_name)
    delete_nodegroup(name, nodegroup_name, params::Dict{String,<:Any})

Deletes an Amazon EKS node group for a cluster.

# Arguments
- `name`: The name of the Amazon EKS cluster that is associated with your node group.
- `nodegroup_name`: The name of the node group to delete.

"""
function delete_nodegroup(
    name, nodegroupName; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "DELETE",
        "/clusters/$(name)/node-groups/$(nodegroupName)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_nodegroup(
    name,
    nodegroupName,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "DELETE",
        "/clusters/$(name)/node-groups/$(nodegroupName)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    deregister_cluster(name)
    deregister_cluster(name, params::Dict{String,<:Any})

Deregisters a connected cluster to remove it from the Amazon EKS control plane.

# Arguments
- `name`: The name of the connected cluster to deregister.

"""
function deregister_cluster(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "DELETE",
        "/cluster-registrations/$(name)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function deregister_cluster(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "DELETE",
        "/cluster-registrations/$(name)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_addon(addon_name, name)
    describe_addon(addon_name, name, params::Dict{String,<:Any})

Describes an Amazon EKS add-on.

# Arguments
- `addon_name`: The name of the add-on. The name must match one of the names returned by
  ListAddons .
- `name`: The name of the cluster.

"""
function describe_addon(addonName, name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET",
        "/clusters/$(name)/addons/$(addonName)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_addon(
    addonName,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "GET",
        "/clusters/$(name)/addons/$(addonName)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_addon_versions()
    describe_addon_versions(params::Dict{String,<:Any})

Describes the Kubernetes versions that the add-on can be used with.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"addonName"`: The name of the add-on. The name must match one of the names returned by
  ListAddons .
- `"kubernetesVersion"`: The Kubernetes versions that the add-on can be used with.
- `"maxResults"`: The maximum number of results to return.
- `"nextToken"`: The nextToken value returned from a previous paginated
  DescribeAddonVersionsRequest where maxResults was used and the results exceeded the value
  of that parameter. Pagination continues from the end of the previous results that returned
  the nextToken value.  This token should be treated as an opaque identifier that is used
  only to retrieve the next items in a list and not for other programmatic purposes.
"""
function describe_addon_versions(; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET",
        "/addons/supported-versions";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_addon_versions(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/addons/supported-versions",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_cluster(name)
    describe_cluster(name, params::Dict{String,<:Any})

Returns descriptive information about an Amazon EKS cluster. The API server endpoint and
certificate authority data returned by this operation are required for kubelet and kubectl
to communicate with your Kubernetes API server. For more information, see Create a
kubeconfig for Amazon EKS.  The API server endpoint and certificate authority data aren't
available until the cluster reaches the ACTIVE state.

# Arguments
- `name`: The name of the cluster to describe.

"""
function describe_cluster(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET", "/clusters/$(name)"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function describe_cluster(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_fargate_profile(fargate_profile_name, name)
    describe_fargate_profile(fargate_profile_name, name, params::Dict{String,<:Any})

Returns descriptive information about an Fargate profile.

# Arguments
- `fargate_profile_name`: The name of the Fargate profile to describe.
- `name`: The name of the Amazon EKS cluster associated with the Fargate profile.

"""
function describe_fargate_profile(
    fargateProfileName, name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/fargate-profiles/$(fargateProfileName)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_fargate_profile(
    fargateProfileName,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "GET",
        "/clusters/$(name)/fargate-profiles/$(fargateProfileName)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_identity_provider_config(identity_provider_config, name)
    describe_identity_provider_config(identity_provider_config, name, params::Dict{String,<:Any})

Returns descriptive information about an identity provider configuration.

# Arguments
- `identity_provider_config`: An object that represents an identity provider configuration.
- `name`: The cluster name that the identity provider configuration is associated to.

"""
function describe_identity_provider_config(
    identityProviderConfig, name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/identity-provider-configs/describe",
        Dict{String,Any}("identityProviderConfig" => identityProviderConfig);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_identity_provider_config(
    identityProviderConfig,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/identity-provider-configs/describe",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("identityProviderConfig" => identityProviderConfig),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_nodegroup(name, nodegroup_name)
    describe_nodegroup(name, nodegroup_name, params::Dict{String,<:Any})

Returns descriptive information about an Amazon EKS node group.

# Arguments
- `name`: The name of the Amazon EKS cluster associated with the node group.
- `nodegroup_name`: The name of the node group to describe.

"""
function describe_nodegroup(
    name, nodegroupName; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/node-groups/$(nodegroupName)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_nodegroup(
    name,
    nodegroupName,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "GET",
        "/clusters/$(name)/node-groups/$(nodegroupName)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_update(name, update_id)
    describe_update(name, update_id, params::Dict{String,<:Any})

Returns descriptive information about an update against your Amazon EKS cluster or
associated managed node group. When the status of the update is Succeeded, the update is
complete. If an update fails, the status is Failed, and an error detail explains the reason
for the failure.

# Arguments
- `name`: The name of the Amazon EKS cluster associated with the update.
- `update_id`: The ID of the update to describe.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"addonName"`: The name of the add-on. The name must match one of the names returned by
  ListAddons .
- `"nodegroupName"`: The name of the Amazon EKS node group associated with the update.
"""
function describe_update(name, updateId; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET",
        "/clusters/$(name)/updates/$(updateId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_update(
    name,
    updateId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "GET",
        "/clusters/$(name)/updates/$(updateId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    disassociate_identity_provider_config(identity_provider_config, name)
    disassociate_identity_provider_config(identity_provider_config, name, params::Dict{String,<:Any})

Disassociates an identity provider configuration from a cluster. If you disassociate an
identity provider from your cluster, users included in the provider can no longer access
the cluster. However, you can still access the cluster with Amazon Web Services IAM users.

# Arguments
- `identity_provider_config`: An object that represents an identity provider configuration.
- `name`: The name of the cluster to disassociate an identity provider from.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: A unique, case-sensitive identifier that you provide to ensure
  the idempotency of the request.
"""
function disassociate_identity_provider_config(
    identityProviderConfig, name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/identity-provider-configs/disassociate",
        Dict{String,Any}(
            "identityProviderConfig" => identityProviderConfig,
            "clientRequestToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function disassociate_identity_provider_config(
    identityProviderConfig,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/identity-provider-configs/disassociate",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "identityProviderConfig" => identityProviderConfig,
                    "clientRequestToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_addons(name)
    list_addons(name, params::Dict{String,<:Any})

Lists the available add-ons.

# Arguments
- `name`: The name of the cluster.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of add-on results returned by ListAddonsRequest in
  paginated output. When you use this parameter, ListAddonsRequest returns only maxResults
  results in a single page along with a nextToken response element. You can see the remaining
  results of the initial request by sending another ListAddonsRequest request with the
  returned nextToken value. This value can be between 1 and 100. If you don't use this
  parameter, ListAddonsRequest returns up to 100 results and a nextToken value, if applicable.
- `"nextToken"`: The nextToken value returned from a previous paginated ListAddonsRequest
  where maxResults was used and the results exceeded the value of that parameter. Pagination
  continues from the end of the previous results that returned the nextToken value.  This
  token should be treated as an opaque identifier that is used only to retrieve the next
  items in a list and not for other programmatic purposes.
"""
function list_addons(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET",
        "/clusters/$(name)/addons";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_addons(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/addons",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_clusters()
    list_clusters(params::Dict{String,<:Any})

Lists the Amazon EKS clusters in your Amazon Web Services account in the specified Region.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"include"`: Indicates whether connected clusters are included in the returned list.
  Default value is 'ALL'.
- `"maxResults"`: The maximum number of cluster results returned by ListClusters in
  paginated output. When you use this parameter, ListClusters returns only maxResults results
  in a single page along with a nextToken response element. You can see the remaining results
  of the initial request by sending another ListClusters request with the returned nextToken
  value. This value can be between 1 and 100. If you don't use this parameter, ListClusters
  returns up to 100 results and a nextToken value if applicable.
- `"nextToken"`: The nextToken value returned from a previous paginated ListClusters
  request where maxResults was used and the results exceeded the value of that parameter.
  Pagination continues from the end of the previous results that returned the nextToken
  value.  This token should be treated as an opaque identifier that is used only to retrieve
  the next items in a list and not for other programmatic purposes.
"""
function list_clusters(; aws_config::AbstractAWSConfig=global_aws_config())
    return eks("GET", "/clusters"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET)
end
function list_clusters(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET", "/clusters", params; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end

"""
    list_fargate_profiles(name)
    list_fargate_profiles(name, params::Dict{String,<:Any})

Lists the Fargate profiles associated with the specified cluster in your Amazon Web
Services account in the specified Region.

# Arguments
- `name`: The name of the Amazon EKS cluster that you would like to list Fargate profiles
  in.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of Fargate profile results returned by
  ListFargateProfiles in paginated output. When you use this parameter, ListFargateProfiles
  returns only maxResults results in a single page along with a nextToken response element.
  You can see the remaining results of the initial request by sending another
  ListFargateProfiles request with the returned nextToken value. This value can be between 1
  and 100. If you don't use this parameter, ListFargateProfiles returns up to 100 results and
  a nextToken value if applicable.
- `"nextToken"`: The nextToken value returned from a previous paginated ListFargateProfiles
  request where maxResults was used and the results exceeded the value of that parameter.
  Pagination continues from the end of the previous results that returned the nextToken value.
"""
function list_fargate_profiles(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET",
        "/clusters/$(name)/fargate-profiles";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_fargate_profiles(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/fargate-profiles",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_identity_provider_configs(name)
    list_identity_provider_configs(name, params::Dict{String,<:Any})

A list of identity provider configurations.

# Arguments
- `name`: The cluster name that you want to list identity provider configurations for.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of identity provider configurations returned by
  ListIdentityProviderConfigs in paginated output. When you use this parameter,
  ListIdentityProviderConfigs returns only maxResults results in a single page along with a
  nextToken response element. You can see the remaining results of the initial request by
  sending another ListIdentityProviderConfigs request with the returned nextToken value. This
  value can be between 1 and 100. If you don't use this parameter,
  ListIdentityProviderConfigs returns up to 100 results and a nextToken value, if applicable.
- `"nextToken"`: The nextToken value returned from a previous paginated
  IdentityProviderConfigsRequest where maxResults was used and the results exceeded the value
  of that parameter. Pagination continues from the end of the previous results that returned
  the nextToken value.
"""
function list_identity_provider_configs(
    name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/identity-provider-configs";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_identity_provider_configs(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/identity-provider-configs",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_nodegroups(name)
    list_nodegroups(name, params::Dict{String,<:Any})

Lists the Amazon EKS managed node groups associated with the specified cluster in your
Amazon Web Services account in the specified Region. Self-managed node groups are not
listed.

# Arguments
- `name`: The name of the Amazon EKS cluster that you would like to list node groups in.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of node group results returned by ListNodegroups in
  paginated output. When you use this parameter, ListNodegroups returns only maxResults
  results in a single page along with a nextToken response element. You can see the remaining
  results of the initial request by sending another ListNodegroups request with the returned
  nextToken value. This value can be between 1 and 100. If you don't use this parameter,
  ListNodegroups returns up to 100 results and a nextToken value if applicable.
- `"nextToken"`: The nextToken value returned from a previous paginated ListNodegroups
  request where maxResults was used and the results exceeded the value of that parameter.
  Pagination continues from the end of the previous results that returned the nextToken value.
"""
function list_nodegroups(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET",
        "/clusters/$(name)/node-groups";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_nodegroups(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/node-groups",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_tags_for_resource(resource_arn)
    list_tags_for_resource(resource_arn, params::Dict{String,<:Any})

List the tags for an Amazon EKS resource.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) that identifies the resource for which to
  list the tags. Currently, the supported resources are Amazon EKS clusters and managed node
  groups.

"""
function list_tags_for_resource(
    resourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/tags/$(resourceArn)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_tags_for_resource(
    resourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "GET",
        "/tags/$(resourceArn)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_updates(name)
    list_updates(name, params::Dict{String,<:Any})

Lists the updates associated with an Amazon EKS cluster or managed node group in your
Amazon Web Services account, in the specified Region.

# Arguments
- `name`: The name of the Amazon EKS cluster to list updates for.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"addonName"`: The names of the installed add-ons that have available updates.
- `"maxResults"`: The maximum number of update results returned by ListUpdates in paginated
  output. When you use this parameter, ListUpdates returns only maxResults results in a
  single page along with a nextToken response element. You can see the remaining results of
  the initial request by sending another ListUpdates request with the returned nextToken
  value. This value can be between 1 and 100. If you don't use this parameter, ListUpdates
  returns up to 100 results and a nextToken value if applicable.
- `"nextToken"`: The nextToken value returned from a previous paginated ListUpdates request
  where maxResults was used and the results exceeded the value of that parameter. Pagination
  continues from the end of the previous results that returned the nextToken value.
- `"nodegroupName"`: The name of the Amazon EKS managed node group to list updates for.
"""
function list_updates(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "GET",
        "/clusters/$(name)/updates";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_updates(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "GET",
        "/clusters/$(name)/updates",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    register_cluster(connector_config, name)
    register_cluster(connector_config, name, params::Dict{String,<:Any})

Connects a Kubernetes cluster to the Amazon EKS control plane.  Any Kubernetes cluster can
be connected to the Amazon EKS control plane to view current information about the cluster
and its nodes.  Cluster connection requires two steps. First, send a
RegisterClusterRequest  to add it to the Amazon EKS control plane. Second, a Manifest
containing the activationID and activationCode must be applied to the Kubernetes cluster
through it's native provider to provide visibility. After the Manifest is updated and
applied, then the connected cluster is visible to the Amazon EKS control plane. If the
Manifest is not applied within a set amount of time, then the connected cluster will no
longer be visible and must be deregistered. See DeregisterCluster.

# Arguments
- `connector_config`: The configuration settings required to connect the Kubernetes cluster
  to the Amazon EKS control plane.
- `name`: Define a unique name for this cluster within your AWS account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
"""
function register_cluster(
    connectorConfig, name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/cluster-registrations",
        Dict{String,Any}(
            "connectorConfig" => connectorConfig,
            "name" => name,
            "clientRequestToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function register_cluster(
    connectorConfig,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/cluster-registrations",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "connectorConfig" => connectorConfig,
                    "name" => name,
                    "clientRequestToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    tag_resource(resource_arn, tags)
    tag_resource(resource_arn, tags, params::Dict{String,<:Any})

Associates the specified tags to a resource with the specified resourceArn. If existing
tags on a resource are not specified in the request parameters, they are not changed. When
a resource is deleted, the tags associated with that resource are deleted as well. Tags
that you create for Amazon EKS resources do not propagate to any other resources associated
with the cluster. For example, if you tag a cluster with this operation, that tag does not
automatically propagate to the subnets and nodes associated with the cluster.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the resource to which to add tags.
  Currently, the supported resources are Amazon EKS clusters and managed node groups.
- `tags`: The tags to add to the resource. A tag is an array of key-value pairs.

"""
function tag_resource(resourceArn, tags; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "POST",
        "/tags/$(resourceArn)",
        Dict{String,Any}("tags" => tags);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function tag_resource(
    resourceArn,
    tags,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/tags/$(resourceArn)",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("tags" => tags), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    untag_resource(resource_arn, tag_keys)
    untag_resource(resource_arn, tag_keys, params::Dict{String,<:Any})

Deletes specified tags from a resource.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the resource from which to delete tags.
  Currently, the supported resources are Amazon EKS clusters and managed node groups.
- `tag_keys`: The keys of the tags to be removed.

"""
function untag_resource(
    resourceArn, tagKeys; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "DELETE",
        "/tags/$(resourceArn)",
        Dict{String,Any}("tagKeys" => tagKeys);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function untag_resource(
    resourceArn,
    tagKeys,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "DELETE",
        "/tags/$(resourceArn)",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("tagKeys" => tagKeys), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_addon(addon_name, name)
    update_addon(addon_name, name, params::Dict{String,<:Any})

Updates an Amazon EKS add-on.

# Arguments
- `addon_name`: The name of the add-on. The name must match one of the names returned by
  ListAddons .
- `name`: The name of the cluster.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"addonVersion"`: The version of the add-on. The version must match one of the versions
  returned by  DescribeAddonVersions .
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"resolveConflicts"`: How to resolve parameter value conflicts when applying the new
  version of the add-on to the cluster.
- `"serviceAccountRoleArn"`: The Amazon Resource Name (ARN) of an existing IAM role to bind
  to the add-on's service account. The role must be assigned the IAM permissions required by
  the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions
  assigned to the node IAM role. For more information, see Amazon EKS node IAM role in the
  Amazon EKS User Guide.  To specify an existing IAM role, you must have an IAM OpenID
  Connect (OIDC) provider created for your cluster. For more information, see Enabling IAM
  roles for service accounts on your cluster in the Amazon EKS User Guide.
"""
function update_addon(addonName, name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "POST",
        "/clusters/$(name)/addons/$(addonName)/update",
        Dict{String,Any}("clientRequestToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_addon(
    addonName,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/addons/$(addonName)/update",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("clientRequestToken" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_cluster_config(name)
    update_cluster_config(name, params::Dict{String,<:Any})

Updates an Amazon EKS cluster configuration. Your cluster continues to function during the
update. The response output includes an update ID that you can use to track the status of
your cluster update with the DescribeUpdate API operation. You can use this API operation
to enable or disable exporting the Kubernetes control plane logs for your cluster to
CloudWatch Logs. By default, cluster control plane logs aren't exported to CloudWatch Logs.
For more information, see Amazon EKS Cluster Control Plane Logs in the  Amazon EKS User
Guide .  CloudWatch Logs ingestion, archive storage, and data scanning rates apply to
exported control plane logs. For more information, see CloudWatch Pricing.  You can also
use this API operation to enable or disable public and private access to your cluster's
Kubernetes API server endpoint. By default, public access is enabled, and private access is
disabled. For more information, see Amazon EKS cluster endpoint access control in the
Amazon EKS User Guide .   You can't update the subnets or security group IDs for an
existing cluster.  Cluster updates are asynchronous, and they should finish within a few
minutes. During an update, the cluster status moves to UPDATING (this status transition is
eventually consistent). When the update is complete (either Failed or Successful), the
cluster status moves to Active.

# Arguments
- `name`: The name of the Amazon EKS cluster to update.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"logging"`: Enable or disable exporting the Kubernetes control plane logs for your
  cluster to CloudWatch Logs. By default, cluster control plane logs aren't exported to
  CloudWatch Logs. For more information, see Amazon EKS cluster control plane logs in the
  Amazon EKS User Guide .  CloudWatch Logs ingestion, archive storage, and data scanning
  rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
- `"resourcesVpcConfig"`:
"""
function update_cluster_config(name; aws_config::AbstractAWSConfig=global_aws_config())
    return eks(
        "POST",
        "/clusters/$(name)/update-config",
        Dict{String,Any}("clientRequestToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_cluster_config(
    name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/update-config",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("clientRequestToken" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_cluster_version(name, version)
    update_cluster_version(name, version, params::Dict{String,<:Any})

Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster continues
to function during the update. The response output includes an update ID that you can use
to track the status of your cluster update with the DescribeUpdate API operation. Cluster
updates are asynchronous, and they should finish within a few minutes. During an update,
the cluster status moves to UPDATING (this status transition is eventually consistent).
When the update is complete (either Failed or Successful), the cluster status moves to
Active. If your cluster has managed node groups attached to it, all of your node groups’
Kubernetes versions must match the cluster’s Kubernetes version in order to update the
cluster to a new Kubernetes version.

# Arguments
- `name`: The name of the Amazon EKS cluster to update.
- `version`: The desired Kubernetes version following a successful update.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
"""
function update_cluster_version(
    name, version; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/updates",
        Dict{String,Any}("version" => version, "clientRequestToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_cluster_version(
    name,
    version,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/updates",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "version" => version, "clientRequestToken" => string(uuid4())
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_nodegroup_config(name, nodegroup_name)
    update_nodegroup_config(name, nodegroup_name, params::Dict{String,<:Any})

Updates an Amazon EKS managed node group configuration. Your node group continues to
function during the update. The response output includes an update ID that you can use to
track the status of your node group update with the DescribeUpdate API operation. Currently
you can update the Kubernetes labels for a node group or the scaling configuration.

# Arguments
- `name`: The name of the Amazon EKS cluster that the managed node group resides in.
- `nodegroup_name`: The name of the managed node group to update.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"labels"`: The Kubernetes labels to be applied to the nodes in the node group after the
  update.
- `"scalingConfig"`: The scaling configuration details for the Auto Scaling group after the
  update.
- `"taints"`: The Kubernetes taints to be applied to the nodes in the node group after the
  update.
- `"updateConfig"`: The node group update configuration.
"""
function update_nodegroup_config(
    name, nodegroupName; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/node-groups/$(nodegroupName)/update-config",
        Dict{String,Any}("clientRequestToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_nodegroup_config(
    name,
    nodegroupName,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/node-groups/$(nodegroupName)/update-config",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("clientRequestToken" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_nodegroup_version(name, nodegroup_name)
    update_nodegroup_version(name, nodegroup_name, params::Dict{String,<:Any})

Updates the Kubernetes version or AMI version of an Amazon EKS managed node group. You can
update a node group using a launch template only if the node group was originally deployed
with a launch template. If you need to update a custom AMI in a node group that was
deployed with a launch template, then update your custom AMI, specify the new ID in a new
version of the launch template, and then update the node group to the new version of the
launch template. If you update without a launch template, then you can update to the latest
available AMI version of a node group's current Kubernetes version by not specifying a
Kubernetes version in the request. You can update to the latest AMI version of your
cluster's current Kubernetes version by specifying your cluster's Kubernetes version in the
request. For more information, see Amazon EKS optimized Amazon Linux 2 AMI versions in the
Amazon EKS User Guide. You cannot roll back a node group to an earlier Kubernetes version
or AMI version. When a node in a managed node group is terminated due to a scaling action
or update, the pods in that node are drained first. Amazon EKS attempts to drain the nodes
gracefully and will fail if it is unable to do so. You can force the update if Amazon EKS
is unable to drain the nodes as a result of a pod disruption budget issue.

# Arguments
- `name`: The name of the Amazon EKS cluster that is associated with the managed node group
  to update.
- `nodegroup_name`: The name of the managed node group to update.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientRequestToken"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request.
- `"force"`: Force the update if the existing node group's pods are unable to be drained
  due to a pod disruption budget issue. If an update fails because pods could not be drained,
  you can force the update after it fails to terminate the old node whether or not any pods
  are running on the node.
- `"launchTemplate"`: An object representing a node group's launch template specification.
  You can only update a node group using a launch template if the node group was originally
  deployed with a launch template.
- `"releaseVersion"`: The AMI version of the Amazon EKS optimized AMI to use for the
  update. By default, the latest available AMI version for the node group's Kubernetes
  version is used. For more information, see Amazon EKS optimized Amazon Linux 2 AMI versions
   in the Amazon EKS User Guide. If you specify launchTemplate, and your launch template uses
  a custom AMI, then don't specify releaseVersion, or the node group update will fail. For
  more information about using launch templates with Amazon EKS, see Launch template support
  in the Amazon EKS User Guide.
- `"version"`: The Kubernetes version to update to. If no version is specified, then the
  Kubernetes version of the node group does not change. You can specify the Kubernetes
  version of the cluster to update the node group to the latest AMI version of the cluster's
  Kubernetes version. If you specify launchTemplate, and your launch template uses a custom
  AMI, then don't specify version, or the node group update will fail. For more information
  about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS
  User Guide.
"""
function update_nodegroup_version(
    name, nodegroupName; aws_config::AbstractAWSConfig=global_aws_config()
)
    return eks(
        "POST",
        "/clusters/$(name)/node-groups/$(nodegroupName)/update-version",
        Dict{String,Any}("clientRequestToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_nodegroup_version(
    name,
    nodegroupName,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return eks(
        "POST",
        "/clusters/$(name)/node-groups/$(nodegroupName)/update-version",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("clientRequestToken" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end


text:
#!/usr/bin/env julia

println("Hello world!")
println("For full tutorial, visit: https://github.com/sylabs/examples/lang/julia")


text:
import ImageMorphology: isboundary_thick, isboundary_dilate_erode

@testset "isboundary" begin
    A = zeros(Int, 16, 16)
    A[4:8, 4:8] .= 5
    A[4:8, 9:12] .= 6
    A[10:12, 13:15] .= 3
    A[10:12, 3:6] .= 9
    OA = OffsetArray(A, -1, -1)
    FA = Float32.(A ./ 2)
    B = A .!= 0
    OB = OffsetArray(B, -1, -1)
    GB = Gray{Bool}.(B)
    normA = A ./ maximum(A)
    C = copy(A)
    C[A .== 0] .= 1
    normC = C ./ maximum(C)
    FC = Float32.(C ./ 2)
    @test sum(isboundary(A)) == 48
    @test sum(isboundary(OA)) == 48
    @test sum(isboundary(FA)) === 48.0f0
    @test sum(isboundary(Gray{Float32}.(normA))) == 48
    @test sum(isboundary(RGB{N0f8}.(normA))) .== RGB{Float64}(48, 48, 48)
    @test sum(isboundary(A; dims=1)) == 32
    @test sum(isboundary(A; dims=2)) == 32
    @test sum(isboundary(GB)) == 42
    @test sum(isboundary(B)) == 42
    @test sum(isboundary(OB)) == 42
    @test sum(isboundary(B; dims=1)) == 32
    @test sum(isboundary(B; dims=2)) == 22
    @test sum(isboundary(C)) == 107
    @test sum(isboundary(C; background=1)) == 48
    @test sum(isboundary(FC)) === 107.0f0
    @test sum(isboundary(FC; background=1 / 2)) === 48.0f0
    @test sum(isboundary(Gray{Float32}.(normC); background=0)) == 107
    @test sum(isboundary(Gray{Float32}.(normC); background=Gray{Float32}(1 / 9))) == 48
    @test sum(isboundary(RGB{N0f8}.(normC); background=RGB{N0f8}(1 / 9))) .==
        RGB{Float64}(48, 48, 48)

    # Tests from pull request #32
    # Normal Case 20x20 binary image
    img = [
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    ]
    check_img = zeros(Int, size(img))
    check_img[3, 4:15] .= 1
    check_img[8, 4:15] .= 1
    check_img[3:8, 4] .= 1
    check_img[3:8, 15] .= 1
    @test check_img == isboundary(img)

    # background = 1
    check_img = zeros(Int, size(img))
    check_img[2, 3:16] .= 1
    check_img[9, 3:16] .= 1
    check_img[2:9, 3] .= 1
    check_img[2:9, 16] .= 1
    @test check_img == isboundary(img; background=1)
end

@testset "isboundary_thick" begin
    A = zeros(Int, 16, 16)
    A[4:8, 4:8] .= 5
    A[4:8, 9:12] .= 6
    A[10:12, 13:15] .= 3
    A[10:12, 3:6] .= 9
    OA = OffsetArray(A, -1, -1)
    FA = Float32.(A ./ 2)
    B = A .!= 0
    OB = OffsetArray(B, -1, -1)
    GB = Gray{Bool}.(B)
    normA = A ./ maximum(A)
    C = copy(A)
    C[A .== 0] .= 1
    FC = Float32.(C ./ 2)
    @test sum(isboundary_thick(A)) == 107
    @test sum(isboundary_thick(OA)) == 107
    @test sum(isboundary_thick(FA)) == 107
    @test sum(isboundary_thick(Gray{Float32}.(normA))) == 107
    # MethodError: no method matching isless(::RGB{N0f8}, ::RGB{N0f8})
    @test_broken sum(isboundary_broken(RGB{N0f8}.(normA))) .== RGB{Float64}(107, 107, 107)
    @test sum(isboundary_thick(A; dims=1)) == 61
    @test sum(isboundary_thick(A; dims=2)) == 54
    @test sum(isboundary_thick(GB)) == 101
    @test sum(isboundary_thick(B)) == 101
    @test sum(isboundary_thick(OB)) == 101
    @test sum(isboundary_thick(B; dims=1)) == 61
    @test sum(isboundary_thick(B; dims=2)) == 44
    @test sum(isboundary_thick(C)) == 107
    @test sum(isboundary_thick(FC)) == 107
    img = [
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    ]
    check_img = [
         0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
        0  0  1  1  1  1  1  1  1  1  1  1  1  1  1  1  0  0  0  0
        0  0  1  1  1  1  1  1  1  1  1  1  1  1  1  1  0  0  0  0
        0  0  1  1  0  0  0  0  0  0  0  0  0  0  1  1  0  0  0  0
        0  0  1  1  0  0  0  0  0  0  0  0  0  0  1  1  0  0  0  0
        0  0  1  1  0  0  0  0  0  0  0  0  0  0  1  1  0  0  0  0
        0  0  1  1  0  0  0  0  0  0  0  0  0  0  1  1  0  0  0  0
        0  0  1  1  1  1  1  1  1  1  1  1  1  1  1  1  0  0  0  0
        0  0  1  1  1  1  1  1  1  1  1  1  1  1  1  1  0  0  0  0
        0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
    ]
    @test isboundary_thick(img) == check_img
end

@testset "isboundary == isboundary_thick .& image" begin
    A = zeros(Int, 16, 16)
    A[4:8, 4:8] .= 5
    A[4:8, 9:12] .= 6
    A[10:12, 13:15] .= 3
    A[10:12, 3:6] .= 9
    B = A .!= 0
    C = copy(A)
    C[A .== 0] .= 1
    @test isboundary(A) == isboundary_thick(A) .& (A .!= 0)
    @test isboundary(B) == isboundary_thick(B) .& B
    @test isboundary(B; background=false) == isboundary_thick(B) .& B
    @test isboundary(B; background=true) == isboundary_thick(B) .& .!B
    @test isboundary(B; background=-1) == isboundary_thick(B)
    @test isboundary(C) == isboundary_thick(C)
    @test isboundary(C; background=1) == isboundary_thick(C) .& (C .!= 1)
    @test isboundary(A) == isboundary_dilate_erode(A)
end


text:
@testset "Test 32 9-Bus Machine Only System" begin
    path = (joinpath(pwd(), "test-9Bus-system"))
    !isdir(path) && mkdir(path)
    try
        sys = System(joinpath(TEST_FILES_DIR, "data_tests/9BusSystem.json"))
        for l in get_components(PSY.PowerLoad, sys)
            PSY.set_model!(l, PSY.LoadModels.ConstantImpedance)
        end

        gen_static = get_component(ThermalStandard, sys, "generator-2-1")
        gen_dynamic = get_dynamic_injector(gen_static)
        sim = Simulation(
            ResidualModel,
            sys,
            path,
            (0.0, 2.0),
            ControlReferenceChange(1.0, gen_dynamic, :P_ref, 0.78),
        )
        small_sig = small_signal_analysis(sim)
        @test execute!(sim, IDA()) == PSID.SIMULATION_FINALIZED

        sim = Simulation(
            MassMatrixModel,
            sys,
            path,
            (0.0, 2.0),
            ControlReferenceChange(1.0, gen_dynamic, :P_ref, 0.78),
        )
        small_sig = small_signal_analysis(sim)
        @test execute!(sim, Rodas4()) == PSID.SIMULATION_FINALIZED

    finally
        @info("removing test files")
        rm(path, force = true, recursive = true)
    end
end


text:
module Criterion

include("stats.jl")
include("analysis.jl")
include("types.jl")
include("measurement.jl")
include("environment.jl")
include("run.jl")
include("report.jl")
end


text:
#using Revise
using Caesar
using JSON

addOdo2DPayload = "{\n  \"covariance\": [\n    [\n      0.1,\n      0.0,\n      0.1\n    ],\n    [\n      0.1,\n      0.0,\n      0.1\n    ],\n    [\n      0.1,\n      0.0,\n      0.1\n    ]\n  ],\n  \"measurement\": [\n    10.0,\n    0.0,\n    1.0471975511965976\n  ],\n  \"robot_id\": \"Hexagonal\",\n  \"session_id\": \"cjz002\",\n  \"type\": \"AddOdometry2D\"\n}"
addLandmark2DPayload = "{\n  \"landmark_id\": \"l1\",\n  \"robot_id\": \"Hexagonal\",\n  \"session_id\": \"cjz002\",\n  \"type\": \"addLandmark2D\"\n}"

addOdometry2D()


text:
# ---
# title: 877. Stone Game
# id: problem877
# author: Indigo
# date: 2021-06-16
# difficulty: Medium
# categories: Math, Dynamic Programming, Minimax
# link: <https://leetcode.com/problems/stone-game/description/>
# hidden: true
# ---
#
# Alex and Lee play a game with piles of stones.  There are an even number of
# piles **arranged in a row** , and each pile has a positive integer number of
# stones `piles[i]`.
#
# The objective of the game is to end with the most stones.  The total number of
# stones is odd, so there are no ties.
#
# Alex and Lee take turns, with Alex starting first.  Each turn, a player takes
# the entire pile of stones from either the beginning or the end of the row.
# This continues until there are no more piles left, at which point the person
# with the most stones wins.
#
# Assuming Alex and Lee play optimally, return `True` if and only if Alex wins
# the game.
#
#
#
# **Example 1:**
#
#
#
#     Input: piles = [5,3,4,5]
#     Output: true
#     Explanation:
#     Alex starts first, and can only take the first 5 or the last 5.
#     Say he takes the first 5, so that the row becomes [3, 4, 5].
#     If Lee takes 3, then the board is [4, 5], and Alex takes 5 to win with 10 points.
#     If Lee takes the last 5, then the board is [3, 4], and Alex takes 4 to win with 9 points.
#     This demonstrated that taking the first 5 was a winning move for Alex, so we return true.
#
#
#
#
# **Constraints:**
#
#   * `2 <= piles.length <= 500`
#   * `piles.length` is even.
#   * `1 <= piles[i] <= 500`
#   * `sum(piles)` is odd.
#
#
## @lc code=start
using LeetCode
"""
function stone_game(piles::Vector{Int})
    len = length(piles)
    dp = Matrix{Int}(undef, len, len)
    for i in 1:len
        dp[i, i] = piles[i]
    end
    for i in (len - 1):-1:1, j in (i + 1):len
        dp[i, j] = max(piles[i] - dp[i + 1, j], piles[j] - dp[i, j - 1])
    end
    return dp[1, end] > 0
end
"""
stone_game(::Vector{Int}) = true
## @lc code=end