text:
using ECOS, SCS, MathProgBase
import JuMP
using ConicBenchmarkUtilities

using Test
using SparseArrays
using LinearAlgebra

@testset "ConicBenchmarkUtilities Tests" begin

@testset "example4.cbf" begin

    dat = readcbfdata("example4.cbf")

    c, A, b, con_cones, var_cones, vartypes, dat.sense, dat.objoffset = cbftompb(dat)

    @test c ≈ [1.0, 0.64]
    @test A ≈ [-50.0 -31; -3.0 2.0]
    @test b ≈ [-250.0, 4.0]
    @test vartypes == [:Cont, :Cont]
    @test dat.sense == :Max
    @test dat.objoffset == 0.0
    @test con_cones == [(:NonPos,[1]),(:NonNeg,[2])]

    m = MathProgBase.ConicModel(ECOSSolver(verbose=0))
    MathProgBase.loadproblem!(m, -c, A, b, con_cones, var_cones)
    MathProgBase.optimize!(m)

    x_sol = MathProgBase.getsolution(m)
    objval = MathProgBase.getobjval(m)

    # test CBF writer
    newdat = mpbtocbf("example", c, A, b, con_cones, var_cones, vartypes, dat.sense)
    writecbfdata("example_out.cbf",newdat,"# Example C.4 from the CBF documentation version 2")
    @test strip(read("example4.cbf", String)) == strip(read("example_out.cbf", String))
    rm("example_out.cbf")

end

# test transformation utilities

@testset "dualize" begin
    # max  y + z
    # st   x <= 1
    #     (x,y,z) in SOC
    #      x in {0,1}
    c = [0.0, -1.0, -1.0]
    A = [1.0  0.0  0.0;
        -1.0  0.0  0.0;
         0.0 -1.0  0.0;
         0.0  0.0 -1.0]
    b = [1.0, 0.0, 0.0, 0.0]
    con_cones = [(:NonNeg,1:1), (:SOC,2:4)]
    var_cones = [(:Free,1:3)]

    (c, A, b, con_cones, var_cones) = dualize(c, A, b, con_cones, var_cones)

    @test c == [1.0, 0.0, 0.0, 0.0]
    @test A == [-1.0  1.0  0.0  0.0;
                 0.0  0.0  1.0  0.0;
                 0.0  0.0  0.0  1.0]
    @test b == [0.0, -1.0, -1.0]
    @test con_cones == [(:Zero,1:3)]
    @test var_cones == [(:NonNeg,1:1), (:SOC,2:4)]

end

@testset "socrotated_to_soc" begin
    # SOCRotated1 from MathProgBase conic tests
    c = [ 0.0, 0.0, -1.0, -1.0]
    A = [ 1.0  0.0   0.0   0.0
          0.0  1.0   0.0   0.0]
    b = [ 0.5, 1.0]
    con_cones = [(:Zero,1:2)]
    var_cones = [(:SOCRotated,1:4)]
    vartypes = fill(:Cont,4)

    (c, A, b, con_cones, var_cones, vartypes) = socrotated_to_soc(c, A, b, con_cones, var_cones, vartypes)

    @test c == [0.0,0.0,-1.0,-1.0]
    @test b == [0.5,1.0,0.0,0.0,0.0,0.0]
    @test A ≈ [1.0 0.0 0.0 0.0
                       0.0 1.0 0.0 0.0
                      -1.0 -1.0 0.0 0.0
                      -1.0 1.0 0.0 0.0
                       0.0 0.0 -1.4142135623730951 0.0
                       0.0 0.0 0.0 -1.4142135623730951]
    @test var_cones == [(:Free,1:4)]
    @test con_cones == [(:Zero,1:2),(:SOC,3:6)]

    c = [-1.0,-1.0]
    A = [0.0 0.0; 0.0 0.0; -1.0 0.0; 0.0 -1.0]
    b = [0.5, 1.0, 0.0, 0.0]
    con_cones = [(:SOCRotated,1:4)]
    var_cones = [(:Free,1:2)]
    vartypes = fill(:Cont,2)

    (c, A, b, con_cones, var_cones, vartypes) = socrotated_to_soc(c, A, b, con_cones, var_cones, vartypes)

    @test c == [-1.0,-1.0,0.0,0.0,0.0,0.0]
    @test b == [0.5,1.0,0.0,0.0,0.0,0.0,0.0,0.0]
    @test A == [0.0 0.0 1.0 0.0 0.0 0.0
     0.0 0.0 0.0 1.0 0.0 0.0
     -1.0 0.0 0.0 0.0 1.0 0.0
     0.0 -1.0 0.0 0.0 0.0 1.0
     0.0 0.0 -1.0 -1.0 0.0 0.0
     0.0 0.0 -1.0 1.0 0.0 0.0
     0.0 0.0 0.0 0.0 -1.4142135623730951 0.0
     0.0 0.0 0.0 0.0 0.0 -1.4142135623730951]
    @test var_cones == [(:Free,1:2),(:Free,3:6)]
    @test con_cones == [(:Zero,1:4),(:SOC,5:8)]
end

@testset "remove_ints_in_nonlinear_cones" begin
    # SOCINT1
    c = [ 0.0, -2.0, -1.0]
    A = sparse([ 1.0   0.0   0.0])
    b = [ 1.0]
    con_cones = [(:Zero,1)]
    var_cones = [(:SOC,1:3)]
    vartypes = [:Cont,:Bin,:Bin]

    (c, A, b, con_cones, var_cones, vartypes) = remove_ints_in_nonlinear_cones(c, A, b, con_cones, var_cones, vartypes)

    @test c == [0.0,-2.0,-1.0,0.0,0.0]
    @test b == [1.0,0.0,0.0]
    @test A == [1.0 0.0 0.0 0.0 0.0
     0.0 1.0 0.0 -1.0 0.0
     0.0 0.0 1.0 0.0 -1.0]
    @test var_cones == [(:SOC,[1,4,5]),(:Free,[2,3])]
    @test con_cones == [(:Zero,[1]),(:Zero,[2,3])]
end

# SDP tests

@testset "roundtrip read/write" begin
    dat = readcbfdata("example1.cbf")
    @test dat.sense == :Min
    @test dat.objoffset == 0.0
    @test isempty(dat.intlist)
    writecbfdata("example_out.cbf",dat,"# Example C.1 from the CBF documentation version 2")
    @test strip(read("example1.cbf", String)) == strip(read("example_out.cbf", String))
    rm("example_out.cbf")
end

@testset "roundtrip through MPB format" begin
    dat = readcbfdata("example1.cbf")
    (c, A, b, con_cones, var_cones, vartypes, dat.sense, dat.objoffset) = cbftompb(dat)
    newdat = mpbtocbf("example", c, A, b, con_cones, var_cones, vartypes, dat.sense)
    writecbfdata("example_out.cbf",newdat,"# Example C.1 from the CBF documentation version 2")
    output = """
    # Example C.1 from the CBF documentation version 2
    VER
    2

    OBJSENSE
    MIN

    PSDVAR
    1
    3

    VAR
    3 1
    F 3

    CON
    5 2
    L= 2
    Q 3

    OBJFCOORD
    5
    0 0 0 2.0
    0 0 1 1.0
    0 1 1 2.0
    0 1 2 1.0
    0 2 2 2.0

    OBJACOORD
    1
    1 1.0

    FCOORD
    9
    0 0 0 0 1.0
    1 0 0 0 1.0
    1 0 0 1 1.0
    1 0 0 2 1.0
    0 0 1 1 1.0
    1 0 1 1 1.0
    1 0 1 2 1.0
    0 0 2 2 1.0
    1 0 2 2 1.0

    ACOORD
    6
    1 0 1.0
    3 0 1.0
    0 1 1.0
    2 1 1.0
    1 2 1.0
    4 2 1.0

    BCOORD
    2
    0 -1.0
    1 -0.5

    """
    @test read("example_out.cbf", String) == output
    rm("example_out.cbf")
end

@testset "Instance with only PSD variables" begin
    dat = readcbfdata("psd_var_only.cbf")
    (c, A, b, con_cones, var_cones, vartypes, dat.sense, dat.objoffset) = cbftompb(dat)
    @test var_cones == [(:SDP, [1, 2, 3])]
end

SCSSOLVER = SCSSolver(eps=1e-6, verbose=0)

@testset "roundtrip through MPB solver" begin
    dat = readcbfdata("example1.cbf")
    (c, A, b, con_cones, var_cones, vartypes, dat.sense, dat.objoffset) = cbftompb(dat)
    m = MathProgBase.ConicModel(SCSSOLVER)
    MathProgBase.loadproblem!(m, c, A, b, con_cones, var_cones)
    MathProgBase.optimize!(m)
    @test MathProgBase.status(m) == :Optimal

    (scalar_solution, psdvar_solution) = ConicBenchmarkUtilities.mpb_sol_to_cbf(dat,MathProgBase.getsolution(m))

    jm = JuMP.Model(solver=SCSSOLVER)
    @JuMP.variable(jm, x[1:3])
    @JuMP.variable(jm, X[1:3,1:3], SDP)

    @JuMP.objective(jm, Min, dot([2 1 0; 1 2 1; 0 1 2],X) + x[2])
    @JuMP.constraint(jm, X[1,1]+X[2,2]+X[3,3]+x[2] == 1.0)
    @JuMP.constraint(jm, dot(ones(3,3),X) + x[1] + x[3] == 0.5)
    @JuMP.constraint(jm, norm([x[1],x[3]]) <= x[2])
    @test JuMP.solve(jm) == :Optimal
    @test JuMP.getobjectivevalue(jm) ≈ MathProgBase.getobjval(m) atol=1e-4
    for i in 1:3
        @test JuMP.getvalue(x[i]) ≈ scalar_solution[i] atol=1e-4
    end
    for i in 1:3, j in 1:3
        @test JuMP.getvalue(X[i,j]) ≈ psdvar_solution[1][i,j] atol=1e-4
    end
end

@testset "example3.cbf" begin
    dat = readcbfdata("example3.cbf")
    (c, A, b, con_cones, var_cones, vartypes, dat.sense, dat.objoffset) = cbftompb(dat)

    @test dat.sense == :Min
    @test dat.objoffset == 1.0
    @test all(vartypes .== :Cont)

    m = MathProgBase.ConicModel(SCSSOLVER)
    MathProgBase.loadproblem!(m, c, A, b, con_cones, var_cones)
    MathProgBase.optimize!(m)
    @test MathProgBase.status(m) == :Optimal

    scalar_solution, psdvar_solution = ConicBenchmarkUtilities.mpb_sol_to_cbf(dat,MathProgBase.getsolution(m))

    jm = JuMP.Model(solver=SCSSOLVER)
    @JuMP.variable(jm, x[1:2])
    @JuMP.variable(jm, X[1:2,1:2], SDP)

    @JuMP.objective(jm, Min, X[1,1] + X[2,2] + x[1] + x[2] + 1)
    @JuMP.constraint(jm, X[1,2] + X[2,1] - x[1] - x[2] ≥ 0.0)
    @JuMP.SDconstraint(jm, [0 1; 1 3]*x[1] + [3 1; 1 0]*x[2] - [1 0; 0 1] >= 0)

    @test JuMP.solve(jm) == :Optimal
    @test JuMP.getobjectivevalue(jm) ≈ MathProgBase.getobjval(m)+dat.objoffset atol=1e-4
    for i in 1:2
        @test JuMP.getvalue(x[i]) ≈ scalar_solution[i] atol=1e-4
    end
    for i in 1:2, j in 1:2
        @test JuMP.getvalue(X[i,j]) ≈ psdvar_solution[1][i,j] atol=1e-4
    end

    # should match example3 modulo irrelevant changes
    ConicBenchmarkUtilities.jump_to_cbf(jm, "example3", "sdptest.cbf")

    output = """
    # Generated by ConicBenchmarkUtilities.jl
    VER
    2

    OBJSENSE
    MIN

    PSDVAR
    1
    2

    VAR
    2 1
    F 2

    PSDCON
    1
    2

    CON
    1 1
    L- 1

    OBJFCOORD
    2
    0 0 0 1.0
    0 1 1 1.0

    OBJACOORD
    2
    0 1.0
    1 1.0

    FCOORD
    1
    0 0 0 1 -0.9999999999999999

    ACOORD
    2
    0 0 1.0
    0 1 1.0

    HCOORD
    4
    0 0 0 1 0.9999999999999999
    0 0 1 1 3.0
    0 1 0 0 3.0
    0 1 0 1 0.9999999999999999

    DCOORD
    2
    0 0 0 -1.0
    0 1 1 -1.0

    """

    @test read("sdptest.cbf", String) == output
    rm("sdptest.cbf")
end

end

max_stars_repo_name: mlubin/ConicBenchmarkUtilities

max_issues_repo_name: mlubin/ConicBenchmarkUtilities

max_forks_repo_name: mlubin/ConicBenchmarkUtilities


text:
#=
Copyright (c) 2018-2022 Chris Coey, Lea Kapelevich, and contributors

This Julia package Hypatia.jl is released under the MIT license; see LICENSE
file in the root directory or at https://github.com/chriscoey/Hypatia.jl
=#

insts = OrderedDict()
insts["minimal"] = [
    ((1, 2, 2, 2, true),),
    ((1, 2, 2, 2, false),),
    ]
insts["fast"] = [
    ((2, 2, 3, 2, true),),
    ((2, 2, 3, 2, false),),
    ((3, 3, 3, 3, true),),
    ((3, 3, 3, 3, false),),
    ((3, 3, 5, 4, true),),
    ((5, 2, 5, 3, true),),
    ((1, 30, 2, 30, true),),
    ((1, 30, 2, 30, false),),
    ((10, 1, 3, 1, true),),
    ((10, 1, 3, 1, false),),
    ]
return (PolyEnvelopeNative, insts)

ext: jl


text:
import Base:  +, -, ==, hash
#Position on a 2D space wiht continuouns coordinate system
struct Real2D{T<:Real} <: Position
    x::T
    y::T
end

function +(p1::Real2D{T}, p2::Real2D{T}) where {T<:Real}
    Real2D(p1.x+p2.x, p1.y+p2.y)
end
function -(p1::Real2D{T}, p2::Real2D{T}) where {T<:Real}
    Real2D(p1.x-p2.x, p1.y-p2.y)
end
function ==(p1::Real2D{T}, p2::Real2D{T}) where {T<:Real}
    p1.x ≈ p2.x && p1.y ≈ p2.y
end

function hash(p::Real2D{T}, h::UInt) where {T<:Real}
    hash((p.x,p.y), h)
end

"""
Utility function for toroidal transformation of euclidian coordinate.
"""
function toroidal(p::Real2D{T}, dim1::T, dim2::T) where {T<:Real}
    return Real2D(toroidalTransform(p.x,dim1),toroidalTransform(p.y,dim2))
end

"""
Utility function for toroidal distance.
"""
function distance(p1::Real2D{T}, p2::Real2D{T},  dim1::T, dim2::T, toroidal::Bool) where {T<:Real}
    if toroidal
        dx = toroidalDistance(p1.x,p2.x,dim1);
        dy = toroidalDistance(p1.y,p2.y,dim2);

    else
        dx = p1.x - p2.x;
        dy = p1.y - p2.y;
    end
    return sqrt(dx * dx + dy * dy)
end

"""
Utility function for toroidal euclidian field.
"""
function toroidalTransform(val::T, dim::T) where {T<:Real}
    if (val >= 0 && val < dim)  return val end
    val = val % dim
    if (val < 0) val = val + dim end
    return val
end

"""
Utility function for toroidal distance on euclidian field.
"""
function toroidalDistance(val1::T, val2::T, dim::T) where {T<:Real}
    if (abs(val1-val2) <= dim / 2) return val1 - val2 end
    d = toroidalTransform(val1,dim) - toroidalTransform(val2,dim)
    if (d * 2 > dim) return d - dim end
    if (d * 2 < -dim) return d + dim end
    return d
end


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

"""
    delete_recommendation_preferences(recommendation_preference_names, resource_type)
    delete_recommendation_preferences(recommendation_preference_names, resource_type, params::Dict{String,<:Any})

Deletes a recommendation preference, such as enhanced infrastructure metrics. For more
information, see Activating enhanced infrastructure metrics in the Compute Optimizer User
Guide.

# Arguments
- `recommendation_preference_names`: The name of the recommendation preference to delete.
  Enhanced infrastructure metrics (EnhancedInfrastructureMetrics) is the only feature that
  can be activated through preferences. Therefore, it is also the only recommendation
  preference that can be deleted.
- `resource_type`: The target resource type of the recommendation preference to delete. The
  Ec2Instance option encompasses standalone instances and instances that are part of Auto
  Scaling groups. The AutoScalingGroup option encompasses only instances that are part of an
  Auto Scaling group.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"scope"`: An object that describes the scope of the recommendation preference to delete.
  You can delete recommendation preferences that are created at the organization level (for
  management accounts of an organization only), account level, and resource level. For more
  information, see Activating enhanced infrastructure metrics in the Compute Optimizer User
  Guide.
"""
function delete_recommendation_preferences(
    recommendationPreferenceNames,
    resourceType;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "DeleteRecommendationPreferences",
        Dict{String,Any}(
            "recommendationPreferenceNames" => recommendationPreferenceNames,
            "resourceType" => resourceType,
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_recommendation_preferences(
    recommendationPreferenceNames,
    resourceType,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "DeleteRecommendationPreferences",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "recommendationPreferenceNames" => recommendationPreferenceNames,
                    "resourceType" => resourceType,
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Describes recommendation export jobs created in the last seven days. Use the
ExportAutoScalingGroupRecommendations or ExportEC2InstanceRecommendations actions to
request an export of your recommendations. Then use the DescribeRecommendationExportJobs
action to view your export jobs.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"filters"`: An array of objects to specify a filter that returns a more specific list of
  export jobs.
- `"jobIds"`: The identification numbers of the export jobs to return. An export job ID is
  returned when you create an export using the ExportAutoScalingGroupRecommendations or
  ExportEC2InstanceRecommendations actions. All export jobs created in the last seven days
  are returned if this parameter is omitted.
- `"maxResults"`: The maximum number of export jobs to return with a single request. To
  retrieve the remaining results, make another request with the returned nextToken value.
- `"nextToken"`: The token to advance to the next page of export jobs.
"""
function describe_recommendation_export_jobs(;
    aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "DescribeRecommendationExportJobs";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_recommendation_export_jobs(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "DescribeRecommendationExportJobs",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Exports optimization recommendations for Auto Scaling groups. Recommendations are exported
in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation
(JSON) (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that
you specify. For more information, see Exporting Recommendations in the Compute Optimizer
User Guide. You can have only one Auto Scaling group export job in progress per Amazon Web
Services Region.

# Arguments
- `s3_destination_config`: An object to specify the destination Amazon Simple Storage
  Service (Amazon S3) bucket name and key prefix for the export job. You must create the
  destination Amazon S3 bucket for your recommendations export before you create the export
  job. Compute Optimizer does not create the S3 bucket for you. After you create the S3
  bucket, ensure that it has the required permissions policy to allow Compute Optimizer to
  write the export file to it. If you plan to specify an object prefix when you create the
  export job, you must include the object prefix in the policy that you add to the S3 bucket.
  For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute
  Optimizer User Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The IDs of the Amazon Web Services accounts for which to export Auto
  Scaling group recommendations. If your account is the management account of an
  organization, use this parameter to specify the member account for which you want to export
  recommendations. This parameter cannot be specified together with the include member
  accounts parameter. The parameters are mutually exclusive. Recommendations for member
  accounts are not included in the export if this parameter, or the include member accounts
  parameter, is omitted. You can specify multiple account IDs per request.
- `"fieldsToExport"`: The recommendations data to include in the export file. For more
  information about the fields that can be exported, see Exported files in the Compute
  Optimizer User Guide.
- `"fileFormat"`: The format of the export file. The only export file format currently
  supported is Csv.
- `"filters"`: An array of objects to specify a filter that exports a more specific set of
  Auto Scaling group recommendations.
- `"includeMemberAccounts"`: Indicates whether to include recommendations for resources in
  all member accounts of the organization if your account is the management account of an
  organization. The member accounts must also be opted in to Compute Optimizer, and trusted
  access for Compute Optimizer must be enabled in the organization account. For more
  information, see Compute Optimizer and Amazon Web Services Organizations trusted access in
  the Compute Optimizer User Guide. Recommendations for member accounts of the organization
  are not included in the export file if this parameter is omitted. This parameter cannot be
  specified together with the account IDs parameter. The parameters are mutually exclusive.
  Recommendations for member accounts are not included in the export if this parameter, or
  the account IDs parameter, is omitted.
- `"recommendationPreferences"`: An object to specify the preferences for the Auto Scaling
  group recommendations to export.
"""
function export_auto_scaling_group_recommendations(
    s3DestinationConfig; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "ExportAutoScalingGroupRecommendations",
        Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function export_auto_scaling_group_recommendations(
    s3DestinationConfig,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "ExportAutoScalingGroupRecommendations",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Exports optimization recommendations for Amazon EBS volumes. Recommendations are exported
in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation
(JSON) (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that
you specify. For more information, see Exporting Recommendations in the Compute Optimizer
User Guide. You can have only one Amazon EBS volume export job in progress per Amazon Web
Services Region.

# Arguments
- `s3_destination_config`:

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The IDs of the Amazon Web Services accounts for which to export Amazon
  EBS volume recommendations. If your account is the management account of an organization,
  use this parameter to specify the member account for which you want to export
  recommendations. This parameter cannot be specified together with the include member
  accounts parameter. The parameters are mutually exclusive. Recommendations for member
  accounts are not included in the export if this parameter, or the include member accounts
  parameter, is omitted. You can specify multiple account IDs per request.
- `"fieldsToExport"`: The recommendations data to include in the export file. For more
  information about the fields that can be exported, see Exported files in the Compute
  Optimizer User Guide.
- `"fileFormat"`: The format of the export file. The only export file format currently
  supported is Csv.
- `"filters"`: An array of objects to specify a filter that exports a more specific set of
  Amazon EBS volume recommendations.
- `"includeMemberAccounts"`: Indicates whether to include recommendations for resources in
  all member accounts of the organization if your account is the management account of an
  organization. The member accounts must also be opted in to Compute Optimizer, and trusted
  access for Compute Optimizer must be enabled in the organization account. For more
  information, see Compute Optimizer and Amazon Web Services Organizations trusted access in
  the Compute Optimizer User Guide. Recommendations for member accounts of the organization
  are not included in the export file if this parameter is omitted. This parameter cannot be
  specified together with the account IDs parameter. The parameters are mutually exclusive.
  Recommendations for member accounts are not included in the export if this parameter, or
  the account IDs parameter, is omitted.
"""
function export_ebsvolume_recommendations(
    s3DestinationConfig; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "ExportEBSVolumeRecommendations",
        Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function export_ebsvolume_recommendations(
    s3DestinationConfig,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "ExportEBSVolumeRecommendations",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Exports optimization recommendations for Amazon EC2 instances. Recommendations are exported
in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation
(JSON) (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that
you specify. For more information, see Exporting Recommendations in the Compute Optimizer
User Guide. You can have only one Amazon EC2 instance export job in progress per Amazon Web
Services Region.

# Arguments
- `s3_destination_config`: An object to specify the destination Amazon Simple Storage
  Service (Amazon S3) bucket name and key prefix for the export job. You must create the
  destination Amazon S3 bucket for your recommendations export before you create the export
  job. Compute Optimizer does not create the S3 bucket for you. After you create the S3
  bucket, ensure that it has the required permissions policy to allow Compute Optimizer to
  write the export file to it. If you plan to specify an object prefix when you create the
  export job, you must include the object prefix in the policy that you add to the S3 bucket.
  For more information, see Amazon S3 Bucket Policy for Compute Optimizer in the Compute
  Optimizer User Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The IDs of the Amazon Web Services accounts for which to export instance
  recommendations. If your account is the management account of an organization, use this
  parameter to specify the member account for which you want to export recommendations. This
  parameter cannot be specified together with the include member accounts parameter. The
  parameters are mutually exclusive. Recommendations for member accounts are not included in
  the export if this parameter, or the include member accounts parameter, is omitted. You can
  specify multiple account IDs per request.
- `"fieldsToExport"`: The recommendations data to include in the export file. For more
  information about the fields that can be exported, see Exported files in the Compute
  Optimizer User Guide.
- `"fileFormat"`: The format of the export file. The only export file format currently
  supported is Csv.
- `"filters"`: An array of objects to specify a filter that exports a more specific set of
  instance recommendations.
- `"includeMemberAccounts"`: Indicates whether to include recommendations for resources in
  all member accounts of the organization if your account is the management account of an
  organization. The member accounts must also be opted in to Compute Optimizer, and trusted
  access for Compute Optimizer must be enabled in the organization account. For more
  information, see Compute Optimizer and Amazon Web Services Organizations trusted access in
  the Compute Optimizer User Guide. Recommendations for member accounts of the organization
  are not included in the export file if this parameter is omitted. Recommendations for
  member accounts are not included in the export if this parameter, or the account IDs
  parameter, is omitted.
- `"recommendationPreferences"`: An object to specify the preferences for the Amazon EC2
  instance recommendations to export.
"""
function export_ec2_instance_recommendations(
    s3DestinationConfig; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "ExportEC2InstanceRecommendations",
        Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function export_ec2_instance_recommendations(
    s3DestinationConfig,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "ExportEC2InstanceRecommendations",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Exports optimization recommendations for Lambda functions. Recommendations are exported in
a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation
(JSON) (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that
you specify. For more information, see Exporting Recommendations in the Compute Optimizer
User Guide. You can have only one Lambda function export job in progress per Amazon Web
Services Region.

# Arguments
- `s3_destination_config`:

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The IDs of the Amazon Web Services accounts for which to export Lambda
  function recommendations. If your account is the management account of an organization, use
  this parameter to specify the member account for which you want to export recommendations.
  This parameter cannot be specified together with the include member accounts parameter. The
  parameters are mutually exclusive. Recommendations for member accounts are not included in
  the export if this parameter, or the include member accounts parameter, is omitted. You can
  specify multiple account IDs per request.
- `"fieldsToExport"`: The recommendations data to include in the export file. For more
  information about the fields that can be exported, see Exported files in the Compute
  Optimizer User Guide.
- `"fileFormat"`: The format of the export file. The only export file format currently
  supported is Csv.
- `"filters"`: An array of objects to specify a filter that exports a more specific set of
  Lambda function recommendations.
- `"includeMemberAccounts"`: Indicates whether to include recommendations for resources in
  all member accounts of the organization if your account is the management account of an
  organization. The member accounts must also be opted in to Compute Optimizer, and trusted
  access for Compute Optimizer must be enabled in the organization account. For more
  information, see Compute Optimizer and Amazon Web Services Organizations trusted access in
  the Compute Optimizer User Guide. Recommendations for member accounts of the organization
  are not included in the export file if this parameter is omitted. This parameter cannot be
  specified together with the account IDs parameter. The parameters are mutually exclusive.
  Recommendations for member accounts are not included in the export if this parameter, or
  the account IDs parameter, is omitted.
"""
function export_lambda_function_recommendations(
    s3DestinationConfig; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "ExportLambdaFunctionRecommendations",
        Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function export_lambda_function_recommendations(
    s3DestinationConfig,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "ExportLambdaFunctionRecommendations",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("s3DestinationConfig" => s3DestinationConfig),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns Auto Scaling group recommendations. Compute Optimizer generates recommendations for
Amazon EC2 Auto Scaling groups that meet a specific set of requirements. For more
information, see the Supported resources and requirements in the Compute Optimizer User
Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The ID of the Amazon Web Services account for which to return Auto
  Scaling group recommendations. If your account is the management account of an
  organization, use this parameter to specify the member account for which you want to return
  Auto Scaling group recommendations. Only one account ID can be specified per request.
- `"autoScalingGroupArns"`: The Amazon Resource Name (ARN) of the Auto Scaling groups for
  which to return recommendations.
- `"filters"`: An array of objects to specify a filter that returns a more specific list of
  Auto Scaling group recommendations.
- `"maxResults"`: The maximum number of Auto Scaling group recommendations to return with a
  single request. To retrieve the remaining results, make another request with the returned
  nextToken value.
- `"nextToken"`: The token to advance to the next page of Auto Scaling group
  recommendations.
- `"recommendationPreferences"`: An object to specify the preferences for the Auto Scaling
  group recommendations to return in the response.
"""
function get_auto_scaling_group_recommendations(;
    aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetAutoScalingGroupRecommendations";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_auto_scaling_group_recommendations(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetAutoScalingGroupRecommendations",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns Amazon Elastic Block Store (Amazon EBS) volume recommendations. Compute Optimizer
generates recommendations for Amazon EBS volumes that meet a specific set of requirements.
For more information, see the Supported resources and requirements in the Compute Optimizer
User Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The ID of the Amazon Web Services account for which to return volume
  recommendations. If your account is the management account of an organization, use this
  parameter to specify the member account for which you want to return volume
  recommendations. Only one account ID can be specified per request.
- `"filters"`: An array of objects to specify a filter that returns a more specific list of
  volume recommendations.
- `"maxResults"`: The maximum number of volume recommendations to return with a single
  request. To retrieve the remaining results, make another request with the returned
  nextToken value.
- `"nextToken"`: The token to advance to the next page of volume recommendations.
- `"volumeArns"`: The Amazon Resource Name (ARN) of the volumes for which to return
  recommendations.
"""
function get_ebsvolume_recommendations(; aws_config::AbstractAWSConfig=global_aws_config())
    return compute_optimizer(
        "GetEBSVolumeRecommendations";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_ebsvolume_recommendations(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetEBSVolumeRecommendations",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns Amazon EC2 instance recommendations. Compute Optimizer generates recommendations
for Amazon Elastic Compute Cloud (Amazon EC2) instances that meet a specific set of
requirements. For more information, see the Supported resources and requirements in the
Compute Optimizer User Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The ID of the Amazon Web Services account for which to return instance
  recommendations. If your account is the management account of an organization, use this
  parameter to specify the member account for which you want to return instance
  recommendations. Only one account ID can be specified per request.
- `"filters"`: An array of objects to specify a filter that returns a more specific list of
  instance recommendations.
- `"instanceArns"`: The Amazon Resource Name (ARN) of the instances for which to return
  recommendations.
- `"maxResults"`: The maximum number of instance recommendations to return with a single
  request. To retrieve the remaining results, make another request with the returned
  nextToken value.
- `"nextToken"`: The token to advance to the next page of instance recommendations.
- `"recommendationPreferences"`: An object to specify the preferences for the Amazon EC2
  instance recommendations to return in the response.
"""
function get_ec2_instance_recommendations(;
    aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetEC2InstanceRecommendations";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_ec2_instance_recommendations(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetEC2InstanceRecommendations",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_ec2_recommendation_projected_metrics(end_time, instance_arn, period, start_time, stat)
    get_ec2_recommendation_projected_metrics(end_time, instance_arn, period, start_time, stat, params::Dict{String,<:Any})

Returns the projected utilization metrics of Amazon EC2 instance recommendations.  The Cpu
and Memory metrics are the only projected utilization metrics returned when you run this
action. Additionally, the Memory metric is returned only for resources that have the
unified CloudWatch agent installed on them. For more information, see Enabling Memory
Utilization with the CloudWatch Agent.

# Arguments
- `end_time`: The timestamp of the last projected metrics data point to return.
- `instance_arn`: The Amazon Resource Name (ARN) of the instances for which to return
  recommendation projected metrics.
- `period`: The granularity, in seconds, of the projected metrics data points.
- `start_time`: The timestamp of the first projected metrics data point to return.
- `stat`: The statistic of the projected metrics.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"recommendationPreferences"`: An object to specify the preferences for the Amazon EC2
  recommendation projected metrics to return in the response.
"""
function get_ec2_recommendation_projected_metrics(
    endTime,
    instanceArn,
    period,
    startTime,
    stat;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "GetEC2RecommendationProjectedMetrics",
        Dict{String,Any}(
            "endTime" => endTime,
            "instanceArn" => instanceArn,
            "period" => period,
            "startTime" => startTime,
            "stat" => stat,
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_ec2_recommendation_projected_metrics(
    endTime,
    instanceArn,
    period,
    startTime,
    stat,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "GetEC2RecommendationProjectedMetrics",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "endTime" => endTime,
                    "instanceArn" => instanceArn,
                    "period" => period,
                    "startTime" => startTime,
                    "stat" => stat,
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns the recommendation preferences that are in effect for a given resource, such as
enhanced infrastructure metrics. Considers all applicable preferences that you might have
set at the resource, account, and organization level. When you create a recommendation
preference, you can set its status to Active or Inactive. Use this action to view the
recommendation preferences that are in effect, or Active.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the resource for which to confirm
  effective recommendation preferences. Only EC2 instance and Auto Scaling group ARNs are
  currently supported.

"""
function get_effective_recommendation_preferences(
    resourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetEffectiveRecommendationPreferences",
        Dict{String,Any}("resourceArn" => resourceArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_effective_recommendation_preferences(
    resourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "GetEffectiveRecommendationPreferences",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("resourceArn" => resourceArn), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns the enrollment (opt in) status of an account to the Compute Optimizer service. If
the account is the management account of an organization, this action also confirms the
enrollment status of member accounts of the organization. Use the
GetEnrollmentStatusesForOrganization action to get detailed information about the
enrollment status of member accounts of an organization.

"""
function get_enrollment_status(; aws_config::AbstractAWSConfig=global_aws_config())
    return compute_optimizer(
        "GetEnrollmentStatus"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function get_enrollment_status(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetEnrollmentStatus",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns the Compute Optimizer enrollment (opt-in) status of organization member accounts,
if your account is an organization management account. To get the enrollment status of
standalone accounts, use the GetEnrollmentStatus action.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"filters"`: An array of objects to specify a filter that returns a more specific list of
  account enrollment statuses.
- `"maxResults"`: The maximum number of account enrollment statuses to return with a single
  request. You can specify up to 100 statuses to return with each request. To retrieve the
  remaining results, make another request with the returned nextToken value.
- `"nextToken"`: The token to advance to the next page of account enrollment statuses.
"""
function get_enrollment_statuses_for_organization(;
    aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetEnrollmentStatusesForOrganization";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_enrollment_statuses_for_organization(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetEnrollmentStatusesForOrganization",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns Lambda function recommendations. Compute Optimizer generates recommendations for
functions that meet a specific set of requirements. For more information, see the Supported
resources and requirements in the Compute Optimizer User Guide.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The ID of the Amazon Web Services account for which to return function
  recommendations. If your account is the management account of an organization, use this
  parameter to specify the member account for which you want to return function
  recommendations. Only one account ID can be specified per request.
- `"filters"`: An array of objects to specify a filter that returns a more specific list of
  function recommendations.
- `"functionArns"`: The Amazon Resource Name (ARN) of the functions for which to return
  recommendations. You can specify a qualified or unqualified ARN. If you specify an
  unqualified ARN without a function version suffix, Compute Optimizer will return
  recommendations for the latest (LATEST) version of the function. If you specify a qualified
  ARN with a version suffix, Compute Optimizer will return recommendations for the specified
  function version. For more information about using function versions, see Using versions in
  the Lambda Developer Guide.
- `"maxResults"`: The maximum number of function recommendations to return with a single
  request. To retrieve the remaining results, make another request with the returned
  nextToken value.
- `"nextToken"`: The token to advance to the next page of function recommendations.
"""
function get_lambda_function_recommendations(;
    aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetLambdaFunctionRecommendations";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_lambda_function_recommendations(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetLambdaFunctionRecommendations",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns existing recommendation preferences, such as enhanced infrastructure metrics. Use
the scope parameter to specify which preferences to return. You can specify to return
preferences for an organization, a specific account ID, or a specific EC2 instance or Auto
Scaling group Amazon Resource Name (ARN). For more information, see Activating enhanced
infrastructure metrics in the Compute Optimizer User Guide.

# Arguments
- `resource_type`: The target resource type of the recommendation preference for which to
  return preferences. The Ec2Instance option encompasses standalone instances and instances
  that are part of Auto Scaling groups. The AutoScalingGroup option encompasses only
  instances that are part of an Auto Scaling group.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of recommendation preferences to return with a single
  request. To retrieve the remaining results, make another request with the returned
  nextToken value.
- `"nextToken"`: The token to advance to the next page of recommendation preferences.
- `"scope"`: An object that describes the scope of the recommendation preference to return.
  You can return recommendation preferences that are created at the organization level (for
  management accounts of an organization only), account level, and resource level. For more
  information, see Activating enhanced infrastructure metrics in the Compute Optimizer User
  Guide.
"""
function get_recommendation_preferences(
    resourceType; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetRecommendationPreferences",
        Dict{String,Any}("resourceType" => resourceType);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_recommendation_preferences(
    resourceType,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "GetRecommendationPreferences",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("resourceType" => resourceType), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Returns the optimization findings for an account. It returns the number of:   Amazon EC2
instances in an account that are Underprovisioned, Overprovisioned, or Optimized.   Auto
Scaling groups in an account that are NotOptimized, or Optimized.   Amazon EBS volumes in
an account that are NotOptimized, or Optimized.   Lambda functions in an account that are
NotOptimized, or Optimized.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"accountIds"`: The ID of the Amazon Web Services account for which to return
  recommendation summaries. If your account is the management account of an organization, use
  this parameter to specify the member account for which you want to return recommendation
  summaries. Only one account ID can be specified per request.
- `"maxResults"`: The maximum number of recommendation summaries to return with a single
  request. To retrieve the remaining results, make another request with the returned
  nextToken value.
- `"nextToken"`: The token to advance to the next page of recommendation summaries.
"""
function get_recommendation_summaries(; aws_config::AbstractAWSConfig=global_aws_config())
    return compute_optimizer(
        "GetRecommendationSummaries"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function get_recommendation_summaries(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "GetRecommendationSummaries",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Creates a new recommendation preference or updates an existing recommendation preference,
such as enhanced infrastructure metrics. For more information, see Activating enhanced
infrastructure metrics in the Compute Optimizer User Guide.

# Arguments
- `resource_type`: The target resource type of the recommendation preference to create. The
  Ec2Instance option encompasses standalone instances and instances that are part of Auto
  Scaling groups. The AutoScalingGroup option encompasses only instances that are part of an
  Auto Scaling group.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"enhancedInfrastructureMetrics"`: The status of the enhanced infrastructure metrics
  recommendation preference to create or update. A status of Active confirms that the
  preference is applied in the latest recommendation refresh, and a status of Inactive
  confirms that it's not yet applied.
- `"scope"`: An object that describes the scope of the recommendation preference to create.
  You can create recommendation preferences at the organization level (for management
  accounts of an organization only), account level, and resource level. For more information,
  see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.  You
  cannot create recommendation preferences for Auto Scaling groups at the organization and
  account levels. You can create recommendation preferences for Auto Scaling groups only at
  the resource level by specifying a scope name of ResourceArn and a scope value of the Auto
  Scaling group Amazon Resource Name (ARN). This will configure the preference for all
  instances that are part of the specified the Auto Scaling group.
"""
function put_recommendation_preferences(
    resourceType; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "PutRecommendationPreferences",
        Dict{String,Any}("resourceType" => resourceType);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function put_recommendation_preferences(
    resourceType,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return compute_optimizer(
        "PutRecommendationPreferences",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("resourceType" => resourceType), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Updates the enrollment (opt in and opt out) status of an account to the Compute Optimizer
service. If the account is a management account of an organization, this action can also be
used to enroll member accounts of the organization. You must have the appropriate
permissions to opt in to Compute Optimizer, to view its recommendations, and to opt out.
For more information, see Controlling access with Amazon Web Services Identity and Access
Management in the Compute Optimizer User Guide. When you opt in, Compute Optimizer
automatically creates a service-linked role in your account to access its data. For more
information, see Using Service-Linked Roles for Compute Optimizer in the Compute Optimizer
User Guide.

# Arguments
- `status`: The new enrollment status of the account. The following status options are
  available:    Active - Opts in your account to the Compute Optimizer service. Compute
  Optimizer begins analyzing the configuration and utilization metrics of your Amazon Web
  Services resources after you opt in. For more information, see Metrics analyzed by Compute
  Optimizer in the Compute Optimizer User Guide.    Inactive - Opts out your account from the
  Compute Optimizer service. Your account's recommendations and related metrics data will be
  deleted from Compute Optimizer after you opt out.    The Pending and Failed options cannot
  be used to update the enrollment status of an account. They are returned in the response of
  a request to update the enrollment status of an account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"includeMemberAccounts"`: Indicates whether to enroll member accounts of the
  organization if the account is the management account of an organization.
"""
function update_enrollment_status(status; aws_config::AbstractAWSConfig=global_aws_config())
    return compute_optimizer(
        "UpdateEnrollmentStatus",
        Dict{String,Any}("status" => status);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_enrollment_status(
    status, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return compute_optimizer(
        "UpdateEnrollmentStatus",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("status" => status), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end