text:
using JuMP, Mosek, SCS
import MathProgComplex

function run_SDPpb(cst, optsense)
    m = Model(solver=MosekSolver(LOG=0))
    # m = Model(solver=SCSSolver(verbose=0))

    @variable(m, Xs1[1:3,1:3], SDP)
    @variable(m, Xs2[1:1,1:1], SDP)
    @variable(m, Xs3[1:1,1:1], SDP)

    @constraint(m, Xs1[1,1] == 1)
    @constraint(m, Xs2[1,1] + Xs1[2,2] + Xs1[3,3] == 4)
    @constraint(m, Xs3[1,1] - Xs1[2,1] - Xs1[3,1] == 0)

    # Find upper bound
    @objective(m, optsense, -Xs1[1,3]+cst)
    solve(m)
    return getobjectivevalue(m)
end

function main()
    @show run_SDPpb(0., :Min)
    @show run_SDPpb(1., :Min)

    @show run_SDPpb(0., :Max)
    @show run_SDPpb(1., :Max)
end

main()
# println(m)

# MathProgBase.writeproblem(m.internalModel, "JuMP_task.jtask")
# mv("JuMP_task.jtask", "JuMP_task.json", remove_destination = true)

# println("\nSolution is:")
# @show getvalue(Xs1)
# @show getvalue(Xs2)
# @show getvalue(Xs3)

# @show getdual(Xs1)
# @show getdual(Xs2)
# @show getdual(Xs3)

############ Plain Mosek:

printstream(msg::String) = print(msg)

barvardim = [3, 1, 1]

numcon = 3
bkc = [Mosek.Boundkey(2), Mosek.Boundkey(2), Mosek.Boundkey(2)]
blc = [1, 4, 0]
buc = [1, 4, 0]

barai    = [1, 2, 2, 2, 3, 3, 3]
baraj    = [1, 1, 1, 2, 1, 1, 3]
barak    = [1, 2, 3, 1, 2, 3, 1]
baral    = [1, 2, 3, 1, 1, 1, 1]
baraijkl = [1, 1, 1, 1, -1/2, -1/2, 1]

barcj    = [1]
barck    = [3]
barcl    = [1]
barcjkl  = [-0.5]

# Create a task object and attach log stream printer
maketask() do task

    putstreamfunc(task, MSK_STREAM_LOG, printstream)

    # Append SDP matrix variables and scalar variables.
    # The variables will initially be fixed at zero.
    appendbarvars(task,barvardim)

    # Append 'numcon' empty constraints.
    # The constraints will initially have no bounds.
    appendcons(task,numcon)
    putconboundslice(task,1,numcon+1, bkc,blc,buc)

    # putobjsense(task, MSK_OBJECTIVE_SENSE_MAXIMIZE)
    putobjsense(task, MSK_OBJECTIVE_SENSE_MINIMIZE)

    # Set constraints SDP vars coeffs
    putbarablocktriplet(task, length(barai), barai, baraj, barak, baral, baraijkl)

    # Objective matrices and constant
    putbarcblocktriplet(task, length(barcj), barcj, barck, barcl, barcjkl)

    optimize(task)

    writedata(task, "Mosek.jtask")
    mv("Mosek.jtask", "Mosek.json", remove_destination = true)

    solutionsummary(task,MSK_STREAM_MSG)

    info("suc:")
    @show getsuc(task, MSK_SOL_ITR)
    info("slc:")
    @show getslc(task, MSK_SOL_ITR)
    info("sux:")
    @show getsux(task, MSK_SOL_ITR)
    info("slx:")
    @show getslx(task, MSK_SOL_ITR)

    # Get status information about the solution
    prosta = getprosta(task, MSK_SOL_ITR)
    solsta = getsolsta(task, MSK_SOL_ITR)

    info("Primal solution:")
    @show getbarxj(task, MSK_SOL_ITR, 1)
    @show getbarxj(task, MSK_SOL_ITR, 2)

    info("Dual solution:")
    @show getbarsj(task, MSK_SOL_ITR, 1)
    @show getbarsj(task, MSK_SOL_ITR, 2)

end

# ##########################################################################
# m = Model(solver=MosekSolver())

# @variable(m, Xs1[1:6,1:6], SDP)
# @variable(m, Xs2[1:1,1:1], SDP)
# @variable(m, Xs3[1:1,1:1], SDP)

# # moment constraint one
# @constraint(m, Xs1[1,1] == 1)

# # Ball constraint
# @constraint(m, Xs1[4,4] + Xs1[6,6] + Xs2[1,1] == 16)
# @constraint(m, Xs1[2,2] + Xs1[3,3] + Xs3[1,1] == 100)

# # Find upper bound
# @objective(m, Max, Xs1[1,2])

# println(m)
# solve(m)
# println("Maximum value is ", getobjective(m))

# println("\nSolution is:")
# @show getvalue(Xs1)
# @show getvalue(Xs2)

# @show getdual(Xs1)
# @show getdual(Xs2)


text:
#Function to emulate Matlab's rectpulse
#25/07/2017

function rectpulse(XX,Nsamp)
  UU = repmat(XX,Nsamp,1)
  sX = size(XX)
  YY = zeros(size(UU))
  for kk = 1:sX[1]
    YY[((kk-1)*Nsamp+1):(kk*Nsamp),:] = UU[kk:sX[1]:end,:]
  end
  return YY
end

ext: jl

max_stars_repo_name: CSChisholm/Rydberg

max_issues_repo_name: CSChisholm/Rydberg

max_forks_repo_name: CSChisholm/Rydberg


text:
@testset "LimitOrder" begin

    price = UInt128(10)
    size = UInt128(100)
    trader_id = UInt128(1)
    order_id = UInt128(2)

    order = LimitOrder(price, size, trader_id, BUY, order_id)
    @test order.size == size
    @test order.trader_id == trader_id
    @test order.side == BUY
    @test order.order_id == order_id
end


text:
using OrdinaryDiffEq, StaticArrays, BenchmarkTools

const σ, ρ, β = 10.0, 28.0, 8/3

mutable struct system1{T, F, J}
  state::T
  eom!::F
  jacob::J
end

println("---Benchmarking in-place version of eom---")
# in-place approach:
@inline @inbounds function eom_lorenz!(du, u)
  du[1] = σ*(u[2]-u[1])
  du[2] = u[1]*(ρ-u[3]) - u[2]
  du[3] = u[1]*u[2] - β*u[3]
end
@inline @inbounds function jacob_lorenz(u)
  i = one(eltype(u))
  o = zero(eltype(u))
  @SMatrix [-σ*i           σ*i    zero(i);
            (ρ*i - u[3])   (-i)   (-u[1]);
            u[2]           u[1]   (-β*i) ]
end# should give exponents [0.9056, 0, -14.5723]
u0 = [0, 10.0, 0]
lor1 = system1(u0, eom_lorenz!, jacob_lorenz)

function tangentbundle_setup_integrator(ds::system1, t_final)
  D = 3
  f! = ds.eom!
  jac = ds.jacob

  tbeom! = (t, u, du) -> begin
    f!(view(du, :, 1), u)
    A_mul_B!(
      view(du, :, 2:D+1),
      jac(view(u, :, 1)),
      view(u, :, 2:D+1)
    )
  end

  S = [ds.state eye(eltype(ds.state), D)]
  tbprob = ODEProblem(tbeom!, S, (zero(t_final), t_final))
  tb_integ = init(tbprob, Tsit5(); save_everystep=false)
  return tb_integ
end

integ1 = tangentbundle_setup_integrator(lor1, 100.0)
integ1.opts.advance_to_tstop=true

t = 1.0:1.0:100.0
#compile:
push!(integ1.opts.tstops, t[1]); step!(integ1)
state1 = integ1.u
#time:
for i in 2:6
  println("time for one step:")
  push!(integ1.opts.tstops, t[i]);
  @time step!(integ1);
end
#time for solve:
println("time for solve:")
@time solve!(integ1)

println("---Benchmarking SMatrix version of eom---")
# SVector approach:
mutable struct system2{T, F, J}
  state::T
  eom::F
  jacob::J
end

@inline @inbounds function eom_lorenz(u)
  @SVector [σ*(u[2]-u[1]), u[1]*(ρ-u[3]) - u[2], u[1]*u[2] - β*u[3]]
end

u0 = @SVector [0, 10.0, 0]
lor2 = system2(u0, eom_lorenz, jacob_lorenz)

function tangentbundle_setup_integrator(ds::system2, t_final)
  D = 3
  f = ds.eom
  jac = ds.jacob

  # function tbeom2(t, u)
  #   return SMatrix{3, 4}(f(u)..., (jac(view(u, :, 1))*view(u, :, 2:4))...)
  # end
  #
  # # Different approach that makes an SMatrix first for multiplication:
  # function tbeom3(t, u)
  #   mm = SMatrix{3,3}(u[:, 2:4])
  #   return SMatrix{3, 4}(f(u)..., jac(u[:, 1])*mm...)
  # end

  # Approach 3 without splatting
  function tbeom4(t, u)
    mm = SMatrix{3,3}(u[:, 2:4])
    return hcat(f(u), jac(u[:, 1])*mm)
  end

  S = SMatrix{3, 4}(ds.state..., eye(eltype(ds.state), 3)...)
  tbprob = ODEProblem(tbeom4, S, (zero(t_final), t_final))
  tb_integ = init(tbprob, Tsit5(); save_everystep=false)
  return tb_integ
end

integ2 = tangentbundle_setup_integrator(lor2, 100.0)
integ2.opts.advance_to_tstop=true
# compile:
push!(integ2.opts.tstops, t[1]); step!(integ2)
state2 = integ2.u
#time:
for i in 2:6
  println("time for one step:")
  push!(integ2.opts.tstops, t[i]);
  @time step!(integ2);
end
#time for solve:
println("time for solve:")
@time solve!(integ2)


text:
#=

@author : Spencer Lyon <spencer.lyon@nyu.edu>
          Victoria Gregory <victoria.gregory@nyu.edu>

=#
using Plots
pyplot()
using LaTeXStrings

# bivariate normal function. I could call plt.mlab, but this is more fun!
# See http://mathworld.wolfram.com/BivariateNormalDistribution.html
function bivariate_normal(X::Matrix, Y::Matrix, σ_x::Real=1.0, σ_y::Real=1.0,
                          μ_x::Real=0.0, μ_y::Real=0.0, σ_xy::Real=0.0)
    Xμ = X .- μ_x
    Yμ = Y .- μ_y

    ρ = σ_xy/(σ_x*σ_y)
    z = Xμ.^2/σ_x^2 + Yμ.^2/σ_y^2 - 2*ρ.*Xμ.*Yμ/(σ_x*σ_y)
    denom = 2π*σ_x*σ_y*sqrt(1-ρ^2)
    return exp.(-z/(2*(1-ρ^2))) ./ denom
end

# == Set up the Gaussian prior density p == #
Σ = [0.4 0.3
     0.3 0.45]
x_hat = [0.2
         -0.2]''

# == Define the matrices G and R from the equation y = G x + N(0, R) == #
G = eye(2)
R = 0.5 .* Σ

# == The matrices A and Q == #
A = [1.2 0
     0   -0.2]
Q = 0.3 .* Σ

# == The observed value of y == #
y = [2.3, -1.9]''

# == Set up grid for plotting == #
x_grid = linspace(-1.5, 2.9, 100)
y_grid = linspace(-3.1, 1.7, 100)
X=repmat(x_grid',length(y_grid),1)
Y=repmat(y_grid,1,length(y_grid))

function gen_gaussian_plot_vals(μ, C)
    "Z values for plotting the bivariate Gaussian N(μ, C)"
    m_x, m_y = μ[1], μ[2]
    s_x, s_y = sqrt(C[1, 1]), sqrt(C[2, 2])
    s_xy = C[1, 2]
    return bivariate_normal(X, Y, s_x, s_y, m_x, m_y, s_xy)
end

function plot1()
    Z = gen_gaussian_plot_vals(x_hat, Σ)
    contour(x_grid, y_grid, Z, fill=true, levels=6, color=:lightrainbow)
    contour!(x_grid, y_grid, Z, fill=false, levels=6, color=:grays, cbar=false)
end

function plot2()
    Z = gen_gaussian_plot_vals(x_hat, Σ)
    contour(x_grid, y_grid, Z, fill=true, levels=6, color=:lightrainbow)
    contour!(x_grid, y_grid, Z, fill=false, levels=6, color=:grays, cbar=false)
    annotate!(y[1], y[2], L"$y$", color=:black)
end

function plot3()
    Z = gen_gaussian_plot_vals(x_hat, Σ)
    M = Σ * G' * inv(G * Σ * G' + R)
    x_hat_F = x_hat + M * (y - G * x_hat)
    Σ_F = Σ - M * G * Σ
    new_Z = gen_gaussian_plot_vals(x_hat_F, Σ_F)
    # Plot Density 1
    contour(x_grid, y_grid, new_Z, fill=true, levels=6, color=:lightrainbow, alpha=0.8)
    contour!(x_grid, y_grid, new_Z, fill=false, levels=6, color=:grays, cbar=false)
    # Plot Density 2
    contour!(x_grid, y_grid, Z, fill=false, levels=6, color=:grays, cbar=false)
    annotate!(y[1], y[2], L"$y$", color=:black)
end

function plot4()
    Z = gen_gaussian_plot_vals(x_hat, Σ)
    M = Σ * G' * inv(G * Σ * G' + R)
    x_hat_F = x_hat + M * (y - G * x_hat)
    Σ_F = Σ - M * G * Σ
    Z_F = gen_gaussian_plot_vals(x_hat_F, Σ_F)
    new_x_hat = A * x_hat_F
    new_Σ = A * Σ_F * A' + Q
    new_Z = gen_gaussian_plot_vals(new_x_hat, new_Σ)
    # Plot Density 1
    contour(x_grid, y_grid, new_Z, fill=true, levels=6, color=:lightrainbow, alpha=0.9)
    contour!(x_grid, y_grid, new_Z, fill=false, levels=6, color=:grays, cbar=false)
    # Plot Density 2
    contour!(x_grid, y_grid, Z, fill=false, levels=6, color=:grays, cbar=false)
    # Plot Density 3
    contour!(x_grid, y_grid, Z_F, fill=false, levels=6, color=:grays, cbar=false)
    annotate!(y[1], y[2], L"$y$", color=:black)
end


text:
function add_solver_xml!(::NEOSSolver{:CPLEX, :MPS}, m::MPSModel)
	# Add solution display
	m.xmlmodel = replace(m.xmlmodel, r"<post>.*</post>"s, "<post><![CDATA[disp sol objective\ndisplay solution variables -\ndisplay solution dual -\ndisplay solution reduced -]]></post>")

	# Add user options
	param_string = ""
	for key in keys(m.solver.params)
		param_string *= "set $(key) $(m.solver.params[key])\n"
	end
	m.xmlmodel = replace(m.xmlmodel, r"<options>.*</options>"s, "<options><![CDATA[$(param_string)]]></options>")
end

# CPLEX> MIP - Integer optimal solution:  Objective = -1.6000000000e+01
# CPLEX> Incumbent solution
# Variable Name           Solution Value
# VAR1                          1.000000
# VAR4                          1.000000
# VAR5                          1.000000

function parse_status!(::NEOSSolver{:CPLEX, :MPS}, m::MPSModel)
	if contains(m.last_results, "optimal solution") || contains(m.last_results, "Optimal:")
		m.status = OPTIMAL
	elseif contains(m.last_results, "unbounded") || contains(m.last_results, "Unbounded")
		m.status = UNBOUNDED
	elseif contains(m.last_results, "infeasible") || contains(m.last_results, "Infeasible")
		m.status = INFEASIBLE
	end
end

function parse_objective!(::NEOSSolver{:CPLEX, :MPS}, m::MPSModel)
		sci = match(r"Objective\W+?=\W+?(-?[\d\.]+)e([\+\-]\d+)", m.last_results).captures
		m.objVal = parse(Float64, sci[1]) * 10. ^ parse(Int, sci[2])
end

function parse_solution!(::NEOSSolver{:CPLEX, :MPS}, m::MPSModel)
	try
		cplex_parsevalue_helper!(m, m.solution, r"Solution Value(.+?)CPLEX>"s, r"V(\d+)\s+(-?[\d.]+)")
	catch
		# Check if the null solution returned
		cplex_catchcheck(m.last_results, "variable")
	end
end

function cplex_catchcheck(results, stype)
	if match(Regex("All $stype(.+?) in the range (.*?) are 0", "i"), results) == nothing && match(Regex("The $stype(.+?)is 0.", "i"), results) == nothing
		println(results)
		error("Unable to parse the solution correctly. See the returned file above.")
	end
end

function parse_duals!(::NEOSSolver{:CPLEX, :MPS}, m::MPSModel)
	m.duals = zeros(m.nrow)
	try
		cplex_parsevalue_helper!(m, m.duals, r"Dual Price(.+?)CPLEX>"s, r"C(\d+)\s+(-?[\d.]+)")
	catch
		cplex_catchcheck(m.last_results, "dual")
	end

	m.reducedcosts = zeros(m.ncol)
	try
		cplex_parsevalue_helper!(m, m.reducedcosts, r"Reduced Cost(.+?)CPLEX>"s, r"V(\d+)\s+(-?[\d.]+)")
	catch
		cplex_catchcheck(m.last_results, "reduced cost")
	end
end

function cplex_parsevalue_helper!(m::MPSModel, to_vector::Vector, reg1::Regex, reg2::Regex)
	if length(to_vector) > 0
		for v in matchall(reg2, match(reg1, m.last_results).captures[1])
			regmatch = match(reg2, v)
			to_vector[parse(Int, regmatch.captures[1])] = parse(Float64, regmatch.captures[2])
		end
	end
end


text:
module LegacyOptim

using Optim

import Optim: Optimizer, perform_linesearch!, promote_objtype, value_gradient!,
              gradient, value, initial_state, trace!, update!, update_state!,
              update_g!,
              @add_linesearch_fields, @initial_linesearch,
              LineSearches

export AcceleratedGradientDescent, MomentumGradientDescent

include("multivariate/solvers/accelerated_gradient_descent.jl")
include("multivariate/solvers/momentum_gradient_descent.jl")

# I think this should be trait based instead of FirstOrderSolvers etc being
# a Union of Optim types (makes it hard to expand in other packages!)
promote_objtype(method::Union{AcceleratedGradientDescent, MomentumGradientDescent}, initial_x, obj_args...) = OnceDifferentiable(obj_args..., initial_x)
promote_objtype(method::Union{AcceleratedGradientDescent, MomentumGradientDescent}, initial_x, od::OnceDifferentiable) = od
promote_objtype(method::Union{AcceleratedGradientDescent, MomentumGradientDescent}, initial_x, td::TwiceDifferentiable) = td
function update_g!(d, state, method::M) where M<:Union{AcceleratedGradientDescent, MomentumGradientDescent}
    # Update the function value and gradient
    value_gradient!(d, state.x)
end

function trace!(tr, d, state, iteration, method::Union{AcceleratedGradientDescent, MomentumGradientDescent}, options)
    dt = Dict()
    if options.extended_trace
        dt["x"] = copy(state.x)
        dt["g(x)"] = copy(gradient(d))
        dt["Current step size"] = state.alpha
    end
    g_norm = vecnorm(gradient(d), Inf)
    update!(tr,
            iteration,
            value(d),
            g_norm,
            dt,
            options.store_trace,
            options.show_trace,
            options.show_every,
            options.callback)
end

end # module


text:
module ArithmeticKoans

function sum(x, y)
end

function difference(x, y)
end

function multiplication(x, y)
end

function division(x, y)
end

function integer_division(x, y)
end

function power(x, y)
end

function modulo(x, y)
end

end


text:
nextfloat(p::Posit8) = reinterpret(Posit8,reinterpret(UInt8,p)+one(UInt8))
nextfloat(p::Posit16) = reinterpret(Posit16,reinterpret(UInt16,p)+one(UInt16))
nextfloat(p::Posit32) = reinterpret(Posit32,reinterpret(UInt32,p)+one(UInt32))

prevfloat(p::Posit8) = reinterpret(Posit8,reinterpret(UInt8,p)-one(UInt8))
prevfloat(p::Posit16) = reinterpret(Posit16,reinterpret(UInt16,p)-one(UInt16))
prevfloat(p::Posit32) = reinterpret(Posit32,reinterpret(UInt32,p)-one(UInt32))

nextfloat(p::T) where {T<:Union{PositX1,PositX2}} = reinterpret(T,reinterpret(UInt32,p)+reinterpret(UInt32,floatmin(T)))
prevfloat(p::T) where {T<:Union{PositX1,PositX2}} = reinterpret(T,reinterpret(UInt32,p)-reinterpret(UInt32,floatmin(T)))


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

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

Accept EULAs.

# Arguments
- `studio_id`: A collection of EULA IDs.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"eulaIds"`: The EULA ID.
"""
function accept_eulas(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/eula-acceptances",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function accept_eulas(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/eula-acceptances",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_launch_profile(ec2_subnet_ids, launch_profile_protocol_versions, name, stream_configuration, studio_component_ids, studio_id)
    create_launch_profile(ec2_subnet_ids, launch_profile_protocol_versions, name, stream_configuration, studio_component_ids, studio_id, params::Dict{String,<:Any})

Create a launch profile.

# Arguments
- `ec2_subnet_ids`: Specifies the IDs of the EC2 subnets where streaming sessions will be
  accessible from. These subnets must support the specified instance types.
- `launch_profile_protocol_versions`: The version number of the protocol that is used by
  the launch profile. The only valid version is \"2021-03-31\".
- `name`: The name for the launch profile.
- `stream_configuration`: A configuration for a streaming session.
- `studio_component_ids`: Unique identifiers for a collection of studio components that can
  be used with this launch profile.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"description"`: The description.
- `"tags"`: A collection of labels, in the form of key:value pairs, that apply to this
  resource.
"""
function create_launch_profile(
    ec2SubnetIds,
    launchProfileProtocolVersions,
    name,
    streamConfiguration,
    studioComponentIds,
    studioId;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/launch-profiles",
        Dict{String,Any}(
            "ec2SubnetIds" => ec2SubnetIds,
            "launchProfileProtocolVersions" => launchProfileProtocolVersions,
            "name" => name,
            "streamConfiguration" => streamConfiguration,
            "studioComponentIds" => studioComponentIds,
            "X-Amz-Client-Token" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_launch_profile(
    ec2SubnetIds,
    launchProfileProtocolVersions,
    name,
    streamConfiguration,
    studioComponentIds,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/launch-profiles",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "ec2SubnetIds" => ec2SubnetIds,
                    "launchProfileProtocolVersions" => launchProfileProtocolVersions,
                    "name" => name,
                    "streamConfiguration" => streamConfiguration,
                    "studioComponentIds" => studioComponentIds,
                    "X-Amz-Client-Token" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_streaming_image(ec2_image_id, name, studio_id)
    create_streaming_image(ec2_image_id, name, studio_id, params::Dict{String,<:Any})

Creates a streaming image resource in a studio.

# Arguments
- `ec2_image_id`: The ID of an EC2 machine image with which to create this streaming image.
- `name`: A friendly name for a streaming image resource.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"description"`: A human-readable description of the streaming image.
- `"tags"`: A collection of labels, in the form of key:value pairs, that apply to this
  resource.
"""
function create_streaming_image(
    ec2ImageId, name, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-images",
        Dict{String,Any}(
            "ec2ImageId" => ec2ImageId,
            "name" => name,
            "X-Amz-Client-Token" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_streaming_image(
    ec2ImageId,
    name,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-images",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "ec2ImageId" => ec2ImageId,
                    "name" => name,
                    "X-Amz-Client-Token" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Creates a streaming session in a studio. After invoking this operation, you must poll
GetStreamingSession until the streaming session is in state READY.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"ec2InstanceType"`: The EC2 Instance type used for the streaming session.
- `"launchProfileId"`: The launch profile ID.
- `"ownedBy"`: The user ID of the user that owns the streaming session.
- `"streamingImageId"`: The ID of the streaming image.
- `"tags"`: A collection of labels, in the form of key:value pairs, that apply to this
  resource.
"""
function create_streaming_session(
    studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_streaming_session(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_streaming_session_stream(session_id, studio_id)
    create_streaming_session_stream(session_id, studio_id, params::Dict{String,<:Any})

Creates a streaming session stream for a streaming session. After invoking this API, invoke
GetStreamingSessionStream with the returned streamId to poll the resource until it is in
state READY.

# Arguments
- `session_id`: The streaming session ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"expirationInSeconds"`: The expiration time in seconds.
"""
function create_streaming_session_stream(
    sessionId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/streams",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_streaming_session_stream(
    sessionId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/streams",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_studio(admin_role_arn, display_name, studio_name, user_role_arn)
    create_studio(admin_role_arn, display_name, studio_name, user_role_arn, params::Dict{String,<:Any})

Create a new Studio. When creating a Studio, two IAM roles must be provided: the admin role
and the user Role. These roles are assumed by your users when they log in to the Nimble
Studio portal. The user role must have the AmazonNimbleStudio-StudioUser managed policy
attached for the portal to function properly. The Admin Role must have the
AmazonNimbleStudio-StudioAdmin managed policy attached for the portal to function properly.
You may optionally specify a KMS key in the StudioEncryptionConfiguration. In Nimble
Studio, resource names, descriptions, initialization scripts, and other data you provide
are always encrypted at rest using an KMS key. By default, this key is owned by Amazon Web
Services and managed on your behalf. You may provide your own KMS key when calling
CreateStudio to encrypt this data using a key you own and manage. When providing an KMS key
during studio creation, Nimble Studio creates KMS grants in your account to provide your
studio user and admin roles access to these KMS keys. If you delete this grant, the studio
will no longer be accessible to your portal users. If you delete the studio KMS key, your
studio will no longer be accessible.

# Arguments
- `admin_role_arn`: The IAM role that Studio Admins will assume when logging in to the
  Nimble Studio portal.
- `display_name`: A friendly name for the studio.
- `studio_name`: The studio name that is used in the URL of the Nimble Studio portal when
  accessed by Nimble Studio users.
- `user_role_arn`: The IAM role that Studio Users will assume when logging in to the Nimble
  Studio portal.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"studioEncryptionConfiguration"`: The studio encryption configuration.
- `"tags"`: A collection of labels, in the form of key:value pairs, that apply to this
  resource.
"""
function create_studio(
    adminRoleArn,
    displayName,
    studioName,
    userRoleArn;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios",
        Dict{String,Any}(
            "adminRoleArn" => adminRoleArn,
            "displayName" => displayName,
            "studioName" => studioName,
            "userRoleArn" => userRoleArn,
            "X-Amz-Client-Token" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_studio(
    adminRoleArn,
    displayName,
    studioName,
    userRoleArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "adminRoleArn" => adminRoleArn,
                    "displayName" => displayName,
                    "studioName" => studioName,
                    "userRoleArn" => userRoleArn,
                    "X-Amz-Client-Token" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_studio_component(name, studio_id, type)
    create_studio_component(name, studio_id, type, params::Dict{String,<:Any})

Creates a studio component resource.

# Arguments
- `name`: The name for the studio component.
- `studio_id`: The studio ID.
- `type`: The type of the studio component.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"configuration"`: The configuration of the studio component, based on component type.
- `"description"`: The description.
- `"ec2SecurityGroupIds"`: The EC2 security groups that control access to the studio
  component.
- `"initializationScripts"`: Initialization scripts for studio components.
- `"scriptParameters"`: Parameters for the studio component scripts.
- `"subtype"`: The specific subtype of a studio component.
- `"tags"`: A collection of labels, in the form of key:value pairs, that apply to this
  resource.
"""
function create_studio_component(
    name, studioId, type; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/studio-components",
        Dict{String,Any}(
            "name" => name, "type" => type, "X-Amz-Client-Token" => string(uuid4())
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_studio_component(
    name,
    studioId,
    type,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/studio-components",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "name" => name, "type" => type, "X-Amz-Client-Token" => string(uuid4())
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_launch_profile(launch_profile_id, studio_id)
    delete_launch_profile(launch_profile_id, studio_id, params::Dict{String,<:Any})

Permanently delete a launch profile.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function delete_launch_profile(
    launchProfileId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_launch_profile(
    launchProfileId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_launch_profile_member(launch_profile_id, principal_id, studio_id)
    delete_launch_profile_member(launch_profile_id, principal_id, studio_id, params::Dict{String,<:Any})

Delete a user from launch profile membership.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `principal_id`: The principal ID. This currently supports a Amazon Web Services SSO
  UserId.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function delete_launch_profile_member(
    launchProfileId,
    principalId,
    studioId;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership/$(principalId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_launch_profile_member(
    launchProfileId,
    principalId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership/$(principalId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_streaming_image(streaming_image_id, studio_id)
    delete_streaming_image(streaming_image_id, studio_id, params::Dict{String,<:Any})

Delete streaming image.

# Arguments
- `streaming_image_id`: The streaming image ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function delete_streaming_image(
    streamingImageId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/streaming-images/$(streamingImageId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_streaming_image(
    streamingImageId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/streaming-images/$(streamingImageId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_streaming_session(session_id, studio_id)
    delete_streaming_session(session_id, studio_id, params::Dict{String,<:Any})

Deletes streaming session resource. After invoking this operation, use GetStreamingSession
to poll the resource until it transitions to a DELETED state. A streaming session will
count against your streaming session quota until it is marked DELETED.

# Arguments
- `session_id`: The streaming session ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function delete_streaming_session(
    sessionId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_streaming_session(
    sessionId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Delete a studio resource.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function delete_studio(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_studio(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_studio_component(studio_component_id, studio_id)
    delete_studio_component(studio_component_id, studio_id, params::Dict{String,<:Any})

Deletes a studio component resource.

# Arguments
- `studio_component_id`: The studio component ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function delete_studio_component(
    studioComponentId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/studio-components/$(studioComponentId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_studio_component(
    studioComponentId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/studio-components/$(studioComponentId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_studio_member(principal_id, studio_id)
    delete_studio_member(principal_id, studio_id, params::Dict{String,<:Any})

Delete a user from studio membership.

# Arguments
- `principal_id`: The principal ID. This currently supports a Amazon Web Services SSO
  UserId.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function delete_studio_member(
    principalId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/membership/$(principalId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_studio_member(
    principalId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "DELETE",
        "/2020-08-01/studios/$(studioId)/membership/$(principalId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Get Eula.

# Arguments
- `eula_id`: The EULA ID.

"""
function get_eula(eulaId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET",
        "/2020-08-01/eulas/$(eulaId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_eula(
    eulaId, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/eulas/$(eulaId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_launch_profile(launch_profile_id, studio_id)
    get_launch_profile(launch_profile_id, studio_id, params::Dict{String,<:Any})

Get a launch profile.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `studio_id`: The studio ID.

"""
function get_launch_profile(
    launchProfileId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_launch_profile(
    launchProfileId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_launch_profile_details(launch_profile_id, studio_id)
    get_launch_profile_details(launch_profile_id, studio_id, params::Dict{String,<:Any})

Launch profile details include the launch profile resource and summary information of
resources that are used by, or available to, the launch profile. This includes the name and
description of all studio components used by the launch profiles, and the name and
description of streaming images that can be used with this launch profile.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `studio_id`: The studio ID.

"""
function get_launch_profile_details(
    launchProfileId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/details";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_launch_profile_details(
    launchProfileId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/details",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_launch_profile_initialization(launch_profile_id, launch_profile_protocol_versions, launch_purpose, platform, studio_id)
    get_launch_profile_initialization(launch_profile_id, launch_profile_protocol_versions, launch_purpose, platform, studio_id, params::Dict{String,<:Any})

Get a launch profile initialization.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `launch_profile_protocol_versions`: The launch profile protocol versions supported by the
  client.
- `launch_purpose`: The launch purpose.
- `platform`: The platform where this Launch Profile will be used, either WINDOWS or LINUX.
- `studio_id`: The studio ID.

"""
function get_launch_profile_initialization(
    launchProfileId,
    launchProfileProtocolVersions,
    launchPurpose,
    platform,
    studioId;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/init",
        Dict{String,Any}(
            "launchProfileProtocolVersions" => launchProfileProtocolVersions,
            "launchPurpose" => launchPurpose,
            "platform" => platform,
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_launch_profile_initialization(
    launchProfileId,
    launchProfileProtocolVersions,
    launchPurpose,
    platform,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/init",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "launchProfileProtocolVersions" => launchProfileProtocolVersions,
                    "launchPurpose" => launchPurpose,
                    "platform" => platform,
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_launch_profile_member(launch_profile_id, principal_id, studio_id)
    get_launch_profile_member(launch_profile_id, principal_id, studio_id, params::Dict{String,<:Any})

Get a user persona in launch profile membership.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `principal_id`: The principal ID. This currently supports a Amazon Web Services SSO
  UserId.
- `studio_id`: The studio ID.

"""
function get_launch_profile_member(
    launchProfileId,
    principalId,
    studioId;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership/$(principalId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_launch_profile_member(
    launchProfileId,
    principalId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership/$(principalId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_streaming_image(streaming_image_id, studio_id)
    get_streaming_image(streaming_image_id, studio_id, params::Dict{String,<:Any})

Get streaming image.

# Arguments
- `streaming_image_id`: The streaming image ID.
- `studio_id`: The studio ID.

"""
function get_streaming_image(
    streamingImageId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-images/$(streamingImageId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_streaming_image(
    streamingImageId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-images/$(streamingImageId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_streaming_session(session_id, studio_id)
    get_streaming_session(session_id, studio_id, params::Dict{String,<:Any})

Gets StreamingSession resource. anvoke this operation to poll for a streaming session state
while creating or deleting a session.

# Arguments
- `session_id`: The streaming session ID.
- `studio_id`: The studio ID.

"""
function get_streaming_session(
    sessionId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_streaming_session(
    sessionId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_streaming_session_stream(session_id, stream_id, studio_id)
    get_streaming_session_stream(session_id, stream_id, studio_id, params::Dict{String,<:Any})

Gets a StreamingSessionStream for a streaming session. Invoke this operation to poll the
resource after invoking CreateStreamingSessionStream. After the StreamingSessionStream
changes to the state READY, the url property will contain a stream to be used with the DCV
streaming client.

# Arguments
- `session_id`: The streaming session ID.
- `stream_id`: The streaming session stream ID.
- `studio_id`: The studio ID.

"""
function get_streaming_session_stream(
    sessionId, streamId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/streams/$(streamId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_streaming_session_stream(
    sessionId,
    streamId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/streams/$(streamId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Get a Studio resource.

# Arguments
- `studio_id`: The studio ID.

"""
function get_studio(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_studio(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_studio_component(studio_component_id, studio_id)
    get_studio_component(studio_component_id, studio_id, params::Dict{String,<:Any})

Gets a studio component resource.

# Arguments
- `studio_component_id`: The studio component ID.
- `studio_id`: The studio ID.

"""
function get_studio_component(
    studioComponentId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/studio-components/$(studioComponentId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_studio_component(
    studioComponentId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/studio-components/$(studioComponentId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_studio_member(principal_id, studio_id)
    get_studio_member(principal_id, studio_id, params::Dict{String,<:Any})

Get a user's membership in a studio.

# Arguments
- `principal_id`: The principal ID. This currently supports a Amazon Web Services SSO
  UserId.
- `studio_id`: The studio ID.

"""
function get_studio_member(
    principalId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/membership/$(principalId)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_studio_member(
    principalId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/membership/$(principalId)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

List Eula Acceptances.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"eulaIds"`: The list of EULA IDs that have been previously accepted.
- `"nextToken"`: The token to request the next page of results.
"""
function list_eula_acceptances(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/eula-acceptances";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_eula_acceptances(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/eula-acceptances",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

List Eulas.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"eulaIds"`: The list of EULA IDs that should be returned
- `"nextToken"`: The token to request the next page of results.
"""
function list_eulas(; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET", "/2020-08-01/eulas"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function list_eulas(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/eulas",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_launch_profile_members(launch_profile_id, studio_id)
    list_launch_profile_members(launch_profile_id, studio_id, params::Dict{String,<:Any})

Get all users in a given launch profile membership.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The max number of results to return in the response.
- `"nextToken"`: The token to request the next page of results.
"""
function list_launch_profile_members(
    launchProfileId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_launch_profile_members(
    launchProfileId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

List all the launch profiles a studio.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The max number of results to return in the response.
- `"nextToken"`: The token to request the next page of results.
- `"principalId"`: The principal ID. This currently supports a Amazon Web Services SSO
  UserId.
- `"states"`: Filter this request to launch profiles in any of the given states.
"""
function list_launch_profiles(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_launch_profiles(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/launch-profiles",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

List the streaming image resources available to this studio. This list will contain both
images provided by Amazon Web Services, as well as streaming images that you have created
in your studio.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"nextToken"`: The token to request the next page of results.
- `"owner"`: Filter this request to streaming images with the given owner
"""
function list_streaming_images(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-images";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_streaming_images(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-images",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Lists the streaming image resources in a studio.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"createdBy"`: Filters the request to streaming sessions created by the given user.
- `"nextToken"`: The token to request the next page of results.
- `"ownedBy"`: Filters the request to streaming session owned by the given user
- `"sessionIds"`: Filters the request to only the provided session IDs.
"""
function list_streaming_sessions(
    studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-sessions";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_streaming_sessions(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/streaming-sessions",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Lists the StudioComponents in a studio.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The max number of results to return in the response.
- `"nextToken"`: The token to request the next page of results.
- `"states"`: Filters the request to studio components that are in one of the given states.
- `"types"`: Filters the request to studio components that are of one of the given types.
"""
function list_studio_components(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/studio-components";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_studio_components(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/studio-components",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Get all users in a given studio membership.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The max number of results to return in the response.
- `"nextToken"`: The token to request the next page of results.
"""
function list_studio_members(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/membership";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_studio_members(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "GET",
        "/2020-08-01/studios/$(studioId)/membership",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

List studios in your Amazon Web Services account in the requested Amazon Web Services
Region.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"nextToken"`: The token to request the next page of results.
"""
function list_studios(; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "GET", "/2020-08-01/studios"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function list_studios(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/studios",
        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})

Gets the tags for a resource, given its Amazon Resource Names (ARN). This operation
supports ARNs for all resource types in Nimble Studio that support tags, including studio,
studio component, launch profile, streaming image, and streaming session. All resources
that can be tagged will contain an ARN property, so you do not have to create this ARN
yourself.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the resource for which you want to list
  tags.

"""
function list_tags_for_resource(
    resourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "GET",
        "/2020-08-01/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 nimble(
        "GET",
        "/2020-08-01/tags/$(resourceArn)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    put_launch_profile_members(identity_store_id, launch_profile_id, members, studio_id)
    put_launch_profile_members(identity_store_id, launch_profile_id, members, studio_id, params::Dict{String,<:Any})

Add/update users with given persona to launch profile membership.

# Arguments
- `identity_store_id`: The ID of the identity store.
- `launch_profile_id`: The Launch Profile ID.
- `members`: A list of members.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function put_launch_profile_members(
    identityStoreId,
    launchProfileId,
    members,
    studioId;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership",
        Dict{String,Any}(
            "identityStoreId" => identityStoreId,
            "members" => members,
            "X-Amz-Client-Token" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function put_launch_profile_members(
    identityStoreId,
    launchProfileId,
    members,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "identityStoreId" => identityStoreId,
                    "members" => members,
                    "X-Amz-Client-Token" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    put_studio_members(identity_store_id, members, studio_id)
    put_studio_members(identity_store_id, members, studio_id, params::Dict{String,<:Any})

Add/update users with given persona to studio membership.

# Arguments
- `identity_store_id`: The ID of the identity store.
- `members`: A list of members.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function put_studio_members(
    identityStoreId, members, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/membership",
        Dict{String,Any}(
            "identityStoreId" => identityStoreId,
            "members" => members,
            "X-Amz-Client-Token" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function put_studio_members(
    identityStoreId,
    members,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/membership",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "identityStoreId" => identityStoreId,
                    "members" => members,
                    "X-Amz-Client-Token" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    start_streaming_session(session_id, studio_id)
    start_streaming_session(session_id, studio_id, params::Dict{String,<:Any})

 Transitions sessions from the STOPPED state into the READY state. The START_IN_PROGRESS
state is the intermediate state between the STOPPED and READY states.

# Arguments
- `session_id`: The streaming session ID for the StartStreamingSessionRequest.
- `studio_id`: The studio ID for the StartStreamingSessionRequest.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function start_streaming_session(
    sessionId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/start",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function start_streaming_session(
    sessionId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/start",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Repairs the Amazon Web Services SSO configuration for a given studio. If the studio has a
valid Amazon Web Services SSO configuration currently associated with it, this operation
will fail with a validation error. If the studio does not have a valid Amazon Web Services
SSO configuration currently associated with it, then a new Amazon Web Services SSO
application is created for the studio and the studio is changed to the READY state. After
the Amazon Web Services SSO application is repaired, you must use the Amazon Nimble Studio
console to add administrators and users to your studio.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function start_studio_ssoconfiguration_repair(
    studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "PUT",
        "/2020-08-01/studios/$(studioId)/sso-configuration",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function start_studio_ssoconfiguration_repair(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "PUT",
        "/2020-08-01/studios/$(studioId)/sso-configuration",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    stop_streaming_session(session_id, studio_id)
    stop_streaming_session(session_id, studio_id, params::Dict{String,<:Any})

Transitions sessions from the READY state into the STOPPED state. The STOP_IN_PROGRESS
state is the intermediate state between the READY and STOPPED states.

# Arguments
- `session_id`: The streaming session ID for the StopStreamingSessionRequest.
- `studio_id`: The studioId for the StopStreamingSessionRequest.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function stop_streaming_session(
    sessionId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/stop",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function stop_streaming_session(
    sessionId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/studios/$(studioId)/streaming-sessions/$(sessionId)/stop",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Creates tags for a resource, given its ARN.

# Arguments
- `resource_arn`:  The Amazon Resource Name (ARN) of the resource you want to add tags to.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"tags"`: A collection of labels, in the form of key:value pairs, that apply to this
  resource.
"""
function tag_resource(resourceArn; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "POST",
        "/2020-08-01/tags/$(resourceArn)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function tag_resource(
    resourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "POST",
        "/2020-08-01/tags/$(resourceArn)",
        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 the tags for a resource.

# Arguments
- `resource_arn`: Identifies the Amazon Resource Name(ARN) key from which you are removing
  tags.
- `tag_keys`: One or more tag keys. Specify only the tag keys, not the tag values.

"""
function untag_resource(
    resourceArn, tagKeys; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "DELETE",
        "/2020-08-01/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 nimble(
        "DELETE",
        "/2020-08-01/tags/$(resourceArn)",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("tagKeys" => tagKeys), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_launch_profile(launch_profile_id, studio_id)
    update_launch_profile(launch_profile_id, studio_id, params::Dict{String,<:Any})

Update a launch profile.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"description"`: The description.
- `"launchProfileProtocolVersions"`: The version number of the protocol that is used by the
  launch profile. The only valid version is \"2021-03-31\".
- `"name"`: The name for the launch profile.
- `"streamConfiguration"`: A configuration for a streaming session.
- `"studioComponentIds"`: Unique identifiers for a collection of studio components that can
  be used with this launch profile.
"""
function update_launch_profile(
    launchProfileId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_launch_profile(
    launchProfileId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_launch_profile_member(launch_profile_id, persona, principal_id, studio_id)
    update_launch_profile_member(launch_profile_id, persona, principal_id, studio_id, params::Dict{String,<:Any})

Update a user persona in launch profile membership.

# Arguments
- `launch_profile_id`: The Launch Profile ID.
- `persona`: The persona.
- `principal_id`: The principal ID. This currently supports a Amazon Web Services SSO
  UserId.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
"""
function update_launch_profile_member(
    launchProfileId,
    persona,
    principalId,
    studioId;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership/$(principalId)",
        Dict{String,Any}("persona" => persona, "X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_launch_profile_member(
    launchProfileId,
    persona,
    principalId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/launch-profiles/$(launchProfileId)/membership/$(principalId)",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "persona" => persona, "X-Amz-Client-Token" => string(uuid4())
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_streaming_image(streaming_image_id, studio_id)
    update_streaming_image(streaming_image_id, studio_id, params::Dict{String,<:Any})

Update streaming image.

# Arguments
- `streaming_image_id`: The streaming image ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"description"`: The description.
- `"name"`: The name for the streaming image.
"""
function update_streaming_image(
    streamingImageId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/streaming-images/$(streamingImageId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_streaming_image(
    streamingImageId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/streaming-images/$(streamingImageId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

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

Update a Studio resource. Currently, this operation only supports updating the displayName
of your studio.

# Arguments
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"adminRoleArn"`: The IAM role that Studio Admins will assume when logging in to the
  Nimble Studio portal.
- `"displayName"`: A friendly name for the studio.
- `"userRoleArn"`: The IAM role that Studio Users will assume when logging in to the Nimble
  Studio portal.
"""
function update_studio(studioId; aws_config::AbstractAWSConfig=global_aws_config())
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_studio(
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_studio_component(studio_component_id, studio_id)
    update_studio_component(studio_component_id, studio_id, params::Dict{String,<:Any})

Updates a studio component resource.

# Arguments
- `studio_component_id`: The studio component ID.
- `studio_id`: The studio ID.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"X-Amz-Client-Token"`: Unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. If you don’t specify a client token, the AWS SDK
  automatically generates a client token and uses it for the request to ensure idempotency.
- `"configuration"`: The configuration of the studio component, based on component type.
- `"description"`: The description.
- `"ec2SecurityGroupIds"`: The EC2 security groups that control access to the studio
  component.
- `"initializationScripts"`: Initialization scripts for studio components.
- `"name"`: The name for the studio component.
- `"scriptParameters"`: Parameters for the studio component scripts.
- `"subtype"`: The specific subtype of a studio component.
- `"type"`: The type of the studio component.
"""
function update_studio_component(
    studioComponentId, studioId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/studio-components/$(studioComponentId)",
        Dict{String,Any}("X-Amz-Client-Token" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_studio_component(
    studioComponentId,
    studioId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return nimble(
        "PATCH",
        "/2020-08-01/studios/$(studioId)/studio-components/$(studioComponentId)",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("X-Amz-Client-Token" => string(uuid4())), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end


text:
## --- Special functions

    @test isapprox(fast_inv_sqrt(5.0), 1/sqrt(5.0), atol=1e-6)
    @test isapprox(fast_inv_sqrt(5f0), 1/sqrt(5f0), atol=1e-6)
    @test nearest(Int64, 3.3) === 3
    @test nearest(Float64, 1//3) === 1/3

## --- Linear regression

    @test linreg(1:10, 1:10) ≈ [0, 1]

## --- Distributions

    @test normpdf.(0, 1,-1:1) ≈ [0.24197072451914337, 0.3989422804014327, 0.24197072451914337]
    @test normpdf.(1:10, 1:10, 1:10) ≈ normpdf(collect.((1:10, 1:10, 1:10))...)

    @test normpdf_ll.(0,1,-5:5) == -(-5:5).^2/2
    r = collect(-5:5)
    @test normpdf_ll(0,1,r) == normpdf_ll(0,ones(11),r) == normpdf_ll(zeros(11),ones(11),r) == sum(normpdf_ll.(0,1,r))
    @test normpdf_ll(ones(10),1,collect(1:10)) == normpdf_ll(collect(1:10),1,ones(10)) ≈ -142.5 # Test for symmetry

    @test normcdf(1,1,1) == 0.5
    result = zeros(5)
    normcdf!(result, 0, 1, -2:2)
    @test result ≈ normcdf(0,1,-2:2) ≈ normcdf.(0,1,-2:2) ≈ [0.02275013194817921, 0.15865525393145707, 0.5, 0.8413447460685429, 0.9772498680518208]
    @test normcdf.(1:10, 1:10, 1:10) == normcdf(collect.((1:10, 1:10, 1:10))...) == fill(0.5, 10)

    @test normcdf_ll.(0,1,-5:5) ≈ [-15.064998393988725, -10.360101486527292, -6.607726221510349, -3.7831843336820317, -1.841021645009264, -0.6931471805599453, -0.17275377902344985, -0.023012909328963486, -0.0013508099647481923, -3.1671743377489226e-5, -2.866516129637633e-7]
    r = collect(-5:5)
    @test normcdf_ll(r) ≈ -38.54732871798976
    @test normcdf_ll(r) == normcdf_ll(0,1,r) == normcdf_ll(0,ones(11),r) == normcdf_ll(zeros(11),ones(11),r) == sum(normcdf_ll.(0,1,r))
    @test normcdf_ll(zeros(10),1,collect(1:10)) ==  normcdf_ll(-collect(1:10),1,zeros(10)) ≈ -0.19714945770002004 # Test for symmetry
    @test normcdf_ll!(float.(r)) ≈ -38.54732871798976
    @test normcdf_ll!(float.(r)) == normcdf_ll!(0,1,float.(r)) == normcdf_ll!(0,ones(11),float.(r)) == normcdf_ll!(zeros(11),ones(11),float.(r))
    @test normcdf_ll!(zeros(10),1,collect(1:10.)) == normcdf_ll!(-collect(1:10),1,zeros(10)) ≈ -0.19714945770002004 # Test for symmetry

    @test normproduct(0,1,0,1) === normpdf(0,sqrt(2),0) === 0.28209479177387814
    @test normproduct_ll(0,1,0,1) === normpdf_ll(0,1,0) === 0.0

    @test [-2,0,2] ≈ norm_quantile.([0.022750131948, 0.5, 0.977249868052])
    @test norm_quantile.(0:0.25:1) ≈ [-Inf, -0.6744897501960818, 0.0, 0.6744897501960818, Inf]

    @test isapprox(norm_width(390682215445)/2, 7, atol=1e-5)

## -- Geometry

    @test inpolygon([-1,0,1,0],[0,1,0,-1],[0,0])
    @test !inpolygon([-1,0,1,0],[0,1,0,-1],[0,10])
    @test inpolygon([-1,0,1,0],[0,1,0,-1],prevfloat.([0.5,0.5]))
    @test !inpolygon([-1,0,1,0],[0,1,0,-1],nextfloat.([0.5,0.5]))
    @test inpolygon([-1,1,1,-1],[1,1,-1,-1],(0,0))
    @test !inpolygon([-1,1,1,-1],[1,1,-1,-1],(1.1,1))

    i,j = find_grid_inpolygon(-1.5:1/3:1.5, -1.5:1/3:1.5, [-.75,.75,.75,-.75],[.75,.75,-.75,-.75])
    @test sort([i j], dims=2) == [4 4; 4 5; 4 6; 4 7; 4 5; 5 5; 5 6; 5 7; 4 6; 5 6; 6 6; 6 7; 4 7; 5 7; 6 7; 7 7]

    @test all( arcdistance(0,100,[30,0,0],[100,100,95]) .≈ [30,0,5] )

## ---

max_stars_repo_name: brenhinkeller/StatGeochemBase

max_issues_repo_name: brenhinkeller/StatGeochemBase

max_forks_repo_name: brenhinkeller/StatGeochemBase


text:
# ---
# title: 372. Super Pow
# id: problem372
# author: Tian Jun
# date: 2020-10-31
# difficulty: Medium
# categories: Math
# link: <https://leetcode.com/problems/super-pow/description/>
# hidden: true
# ---
#
# Your task is to calculate `ab` mod `1337` where `a` is a positive integer and
# `b` is an extremely large positive integer given in the form of an array.
#
#
#
# **Example 1:**
#
#
#
#     Input: a = 2, b = [3]
#     Output: 8
#
#
# **Example 2:**
#
#
#
#     Input: a = 2, b = [1,0]
#     Output: 1024
#
#
# **Example 3:**
#
#
#
#     Input: a = 1, b = [4,3,3,8,5,2]
#     Output: 1
#
#
# **Example 4:**
#
#
#
#     Input: a = 2147483647, b = [2,0,0]
#     Output: 1198
#
#
#
#
# **Constraints:**
#
#   * `1 <= a <= 231 - 1`
#   * `1 <= b.length <= 2000`
#   * `0 <= b[i] <= 9`
#   * `b` doesn't contain leading zeros.
#
#
## @lc code=start
using LeetCode

## add your code here:
## @lc code=end


text:
module Nodes

export Node, value, next

mutable struct Node{T}

    value::T
    next::Union{Node{T},Nothing}

    function Node{T}(value::T) where {T}
        new{T}(value, nothing)
    end

    function Node{T}(value::T, next::Node{T}) where {T}
        new{T}(value, next)
    end

end

function value(node::Node{T})::T where {T}
    node.value
end

function next(node::Node{T})::Union{Node{T},Nothing} where {T}
    node.next
end

end