text:
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.

struct VirtualMachineScaleSetsApi <: SwaggerApi
    client::Swagger.Client
end

"""

Converts SinglePlacementGroup property to false for a existing virtual machine scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: parameters::VMScaleSetConvertToSinglePlacementGroupInput (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsConvertToSinglePlacementGroup(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsConvertToSinglePlacementGroup(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsConvertToSinglePlacementGroup(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsConvertToSinglePlacementGroup(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsConvertToSinglePlacementGroup(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Create or update a VM scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: parameters::VirtualMachineScaleSet (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSet
"""
function _swaggerinternal_virtualMachineScaleSetsCreateOrUpdate(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "PUT", VirtualMachineScaleSet, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsCreateOrUpdate(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsCreateOrUpdate(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsCreateOrUpdate(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsCreateOrUpdate(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceIDs
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsDeallocate(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsDeallocate(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsDeallocate(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsDeallocate(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsDeallocate(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Deletes a VM scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsDelete(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsDelete(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsDelete(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsDelete(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsDelete(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Deletes virtual machines in a VM scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceRequiredIDs (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsDeleteInstances(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, vmInstanceIDs, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsDeleteInstances(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, vmInstanceIDs, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsDeleteInstances(_api, resourceGroupName, vmScaleSetName, vmInstanceIDs, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsDeleteInstances(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, vmInstanceIDs, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsDeleteInstances(_api, resourceGroupName, vmScaleSetName, vmInstanceIDs, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: platformUpdateDomain::Int32 (required)
Return: RecoveryWalkResponse
"""
function _swaggerinternal_virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalk(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String, platformUpdateDomain::Int32; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", RecoveryWalkResponse, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_param(_ctx.query, "platformUpdateDomain", platformUpdateDomain)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalk(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String, platformUpdateDomain::Int32; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalk(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId, platformUpdateDomain; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalk(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String, platformUpdateDomain::Int32; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalk(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId, platformUpdateDomain; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Display information about a virtual machine scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSet
"""
function _swaggerinternal_virtualMachineScaleSetsGet(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", VirtualMachineScaleSet, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsGet(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsGet(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsGet(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsGet(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets the status of a VM scale set instance.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSetInstanceView
"""
function _swaggerinternal_virtualMachineScaleSetsGetInstanceView(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", VirtualMachineScaleSetInstanceView, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsGetInstanceView(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsGetInstanceView(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsGetInstanceView(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsGetInstanceView(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets list of OS upgrades on a VM scale set instance.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSetListOSUpgradeHistory
"""
function _swaggerinternal_virtualMachineScaleSetsGetOSUpgradeHistory(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", VirtualMachineScaleSetListOSUpgradeHistory, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsGetOSUpgradeHistory(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsGetOSUpgradeHistory(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsGetOSUpgradeHistory(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsGetOSUpgradeHistory(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a list of all VM scale sets under a resource group.
Param: resourceGroupName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSetListResult
"""
function _swaggerinternal_virtualMachineScaleSetsList(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", VirtualMachineScaleSetListResult, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsList(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsList(_api, resourceGroupName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsList(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsList(_api, resourceGroupName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSetListWithLinkResult
"""
function _swaggerinternal_virtualMachineScaleSetsListAll(_api::VirtualMachineScaleSetsApi, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", VirtualMachineScaleSetListWithLinkResult, "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", ["azure_auth"])
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsListAll(_api::VirtualMachineScaleSetsApi, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsListAll(_api, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsListAll(_api::VirtualMachineScaleSetsApi, response_stream::Channel, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsListAll(_api, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSetListSkusResult
"""
function _swaggerinternal_virtualMachineScaleSetsListSkus(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", VirtualMachineScaleSetListSkusResult, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsListSkus(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsListSkus(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsListSkus(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsListSkus(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceIDs
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsPerformMaintenance(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsPerformMaintenance(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsPerformMaintenance(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsPerformMaintenance(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsPerformMaintenance(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceIDs
Param: skipShutdown::Bool
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsPowerOff(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, skipShutdown=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "skipShutdown", skipShutdown)  # type Bool
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsPowerOff(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, skipShutdown=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsPowerOff(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, skipShutdown=skipShutdown, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsPowerOff(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, skipShutdown=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsPowerOff(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, skipShutdown=skipShutdown, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceIDs
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsRedeploy(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsRedeploy(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsRedeploy(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsRedeploy(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsRedeploy(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmScaleSetReimageInput::VirtualMachineScaleSetReimageParameters
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsReimage(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmScaleSetReimageInput=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", ["azure_auth"], vmScaleSetReimageInput)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsReimage(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmScaleSetReimageInput=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsReimage(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmScaleSetReimageInput=vmScaleSetReimageInput, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsReimage(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmScaleSetReimageInput=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsReimage(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmScaleSetReimageInput=vmScaleSetReimageInput, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceIDs
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsReimageAll(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsReimageAll(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsReimageAll(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsReimageAll(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsReimageAll(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Restarts one or more virtual machines in a VM scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceIDs
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsRestart(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsRestart(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsRestart(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsRestart(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsRestart(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Changes ServiceState property for a given service
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: parameters::OrchestrationServiceStateInput (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsSetOrchestrationServiceState(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsSetOrchestrationServiceState(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsSetOrchestrationServiceState(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsSetOrchestrationServiceState(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsSetOrchestrationServiceState(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Starts one or more virtual machines in a VM scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceIDs
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsStart(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsStart(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsStart(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsStart(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, api_version::String, subscriptionId::String; vmInstanceIDs=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsStart(_api, resourceGroupName, vmScaleSetName, api_version, subscriptionId; vmInstanceIDs=vmInstanceIDs, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Update a VM scale set.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: parameters::VirtualMachineScaleSetUpdate (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: VirtualMachineScaleSet
"""
function _swaggerinternal_virtualMachineScaleSetsUpdate(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "PATCH", VirtualMachineScaleSet, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsUpdate(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsUpdate(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsUpdate(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsUpdate(_api, resourceGroupName, vmScaleSetName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.
Param: resourceGroupName::String (required)
Param: vmScaleSetName::String (required)
Param: vmInstanceIDs::VirtualMachineScaleSetVMInstanceRequiredIDs (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_virtualMachineScaleSetsUpdateInstances(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, vmInstanceIDs, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", ["azure_auth"], vmInstanceIDs)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "vmScaleSetName", vmScaleSetName)  # type String
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function virtualMachineScaleSetsUpdateInstances(_api::VirtualMachineScaleSetsApi, resourceGroupName::String, vmScaleSetName::String, vmInstanceIDs, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsUpdateInstances(_api, resourceGroupName, vmScaleSetName, vmInstanceIDs, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function virtualMachineScaleSetsUpdateInstances(_api::VirtualMachineScaleSetsApi, response_stream::Channel, resourceGroupName::String, vmScaleSetName::String, vmInstanceIDs, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_virtualMachineScaleSetsUpdateInstances(_api, resourceGroupName, vmScaleSetName, vmInstanceIDs, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

export virtualMachineScaleSetsConvertToSinglePlacementGroup, virtualMachineScaleSetsCreateOrUpdate, virtualMachineScaleSetsDeallocate, virtualMachineScaleSetsDelete, virtualMachineScaleSetsDeleteInstances, virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalk, virtualMachineScaleSetsGet, virtualMachineScaleSetsGetInstanceView, virtualMachineScaleSetsGetOSUpgradeHistory, virtualMachineScaleSetsList, virtualMachineScaleSetsListAll, virtualMachineScaleSetsListSkus, virtualMachineScaleSetsPerformMaintenance, virtualMachineScaleSetsPowerOff, virtualMachineScaleSetsRedeploy, virtualMachineScaleSetsReimage, virtualMachineScaleSetsReimageAll, virtualMachineScaleSetsRestart, virtualMachineScaleSetsSetOrchestrationServiceState, virtualMachineScaleSetsStart, virtualMachineScaleSetsUpdate, virtualMachineScaleSetsUpdateInstances


text:
using Cassette, InteractiveUtils

Cassette.@context TraceurCtx

struct Trace
  seen::Set
  stack::Vector{Call}
  warn
  maxdepth::Int
end

function Trace(w; maxdepth=typemax(Int))
  Trace(Set(), Vector{Call}(), w, maxdepth)
end

isprimitive(f) = f isa Core.Builtin || f isa Core.IntrinsicFunction

const ignored_methods = Set([@which((1,2)[1])])
const ignored_functions = Set([getproperty, setproperty!])

function Cassette.prehook(ctx::TraceurCtx, f, args...)
  tra = ctx.metadata
  C = DynamicCall(f, args...)
  push!(tra.stack, C)
  nothing
end

function Cassette.posthook(ctx::TraceurCtx, out, f, args...)
  tra = ctx.metadata
  C = tra.stack[end]
  f = C.f
  T = typeof.((f, args))
  if !(f ∈ ignored_functions || T ∈ tra.seen || isprimitive(f) ||
       method(C) ∈ ignored_methods || method(C).module ∈ (Core, Core.Compiler))
    push!(tra.seen, T)
    analyse((a...) -> tra.warn(Warning(a..., copy(tra.stack))), C)
  end
  pop!(tra.stack)
  nothing
end

function Cassette.overdub(ctx::TraceurCtx, f, args...)
  tra = ctx.metadata
  if (length(tra.stack) > tra.maxdepth)
    return f(args...)
  else
    invoke(Cassette.overdub, Tuple{Cassette.Context, typeof(f), typeof.(args)...}, ctx, f, args...)
  end
end

trace(w, f; kwargs...) = Cassette.recurse(TraceurCtx(metadata=Trace(w; kwargs...)), f)

function warntrace(f; modules=[], kwargs...)
  trace(warning_printer(modules), f; kwargs...)
end

"""
    warnings(f; kwargs...)::Vector{Traceur.Warnings}

Collect all warnings generated by Traceur's analysis of the execution of the
no-arg function `f` and return them.

Possible keyword arguments:
- `maxdepth=typemax(Int)` constrols how far Traceur recurses through the call stack.
- If `modules` is nonempty, only warnings for methods defined in one of the modules specified will be printed.
"""
function warnings(f; modules=[], kwargs...)
  warnings = Warning[]
  trace(w -> push!(warnings, w), f; kwargs...)
  if !isempty(modules)
    filter!(x -> getmod(x) in modules, warnings)
  end
  return warnings
end

"""
    @trace(functioncall(args...), maxdepth=2, modules=[])

Analyse `functioncall(args...)` for common performance problems and print them to
the terminal.

Optional arguments:
- `maxdepth` constrols how far Traceur recurses through the call stack.
- If `modules` is nonempty, only warnings for methods defined in one of the modules specified will be printed.
"""
macro trace(ex, args...)
  quote
    warntrace(() -> $(esc(ex)); $(map(esc, args)...))
  end
end

ext: jl


text:
function plot_lines!(vis::Visualizer, model::Flamingo, q::AbstractVector;
		r=0.005, offset=0.05, size=10, name::Symbol=:Flamingo, col::Bool=true)
	r_contact = r*8/7
	p_shift = [0.0, 0.0, r_contact]
	orange_mat, blue_mat, black_mat = get_line_material(size)

	# Point Traj
	torso_point = Vector{Point{3,Float64}}()
	t1_point = Vector{Point{3,Float64}}()
	t2_point = Vector{Point{3,Float64}}()
	for qi in q
		k_torso = kinematics_1(model, qi, body = :torso, mode = :com)
		p_torso = [k_torso[1], -offset, k_torso[2]] + p_shift

		k_toe_1 = kinematics_3(model, qi, body = :foot_1, mode = :toe)
		p_toe_1 = [k_toe_1[1], -offset, k_toe_1[2]] + p_shift

		k_toe_2 = kinematics_3(model, qi, body = :foot_2, mode = :toe)
		p_toe_2 = [k_toe_2[1], -offset, k_toe_2[2]] + p_shift

		push!(torso_point, Point(p_torso...))
		push!(t1_point, Point(p_toe_1...))
		push!(t2_point, Point(p_toe_2...))
	end

	# Set lines
	if col
		setobject!(vis[name][:lines][:torso], MeshCat.Line(torso_point, orange_mat))
		setobject!(vis[name][:lines][:toe1], MeshCat.Line(t1_point, blue_mat))
		setobject!(vis[name][:lines][:toe2], MeshCat.Line(t2_point, blue_mat))
	else
		setobject!(vis[name][:lines][:torso], MeshCat.Line(torso_point, black_mat))
		setobject!(vis[name][:lines][:toe1], MeshCat.Line(t1_point, black_mat))
		setobject!(vis[name][:lines][:toe2], MeshCat.Line(t2_point, black_mat))
	end
	return nothing
end

function build_robot!(vis::Visualizer, model::Flamingo; name::Symbol=:Flamingo, r=0.005, α=1.0)
	r = convert(Float32, r)
	r_contact = convert(Float32, r*8/7)
	body_mat = MeshPhongMaterial(color = RGBA(0.0, 0.0, 0.0, α))
	contact_mat = MeshPhongMaterial(color = RGBA(1.0, 165.0 / 255.0, 0.0, α))

	default_background!(vis)

	torso = Cylinder(Point3f0(0.0), Point3f0(0.0, 0.0, model.l_torso), r)
	setobject!(vis[name][:robot]["torso"], torso, body_mat)

	thigh_1 = Cylinder(Point3f0(0.0), Point3f0(0.0, 0.0, model.l_thigh1), r)
	setobject!(vis[name][:robot]["thigh1"], thigh_1, body_mat)

	calf_1 = Cylinder(Point3f0(0.0), Point3f0(0.0, 0.0, model.l_calf1), r)
	setobject!(vis[name][:robot]["calf1"], calf_1, body_mat)

	foot_1 = Cylinder(Point3f0(0.0), Point3f0(0.0, 0.0, model.l_foot1 + model.d_foot1), r)
	setobject!(vis[name][:robot]["foot1"], foot_1, body_mat)

	thigh_2 = Cylinder(Point3f0(0.0), Point3f0(0.0, 0.0, model.l_thigh2), r)
	setobject!(vis[name][:robot]["thigh2"], thigh_2, body_mat)

	calf_2 = Cylinder(Point3f0(0.0), Point3f0(0.0, 0.0, model.l_calf2), r)
	setobject!(vis[name][:robot]["calf2"], calf_2, body_mat)

	foot_2 = Cylinder(Point3f0(0.0), Point3f0(0.0, 0.0, model.l_foot2 + model.d_foot2), r)
	setobject!(vis[name][:robot]["foot2"], foot_2, body_mat)

	setobject!(vis[name][:robot]["heel1"], Sphere(Point3f0(0.0), r_contact), contact_mat)
	setobject!(vis[name][:robot]["heel2"], Sphere(Point3f0(0.0), r_contact), contact_mat)
	setobject!(vis[name][:robot]["toe1"], Sphere(Point3f0(0.0), r_contact), contact_mat)
	setobject!(vis[name][:robot]["toe2"], Sphere(Point3f0(0.0), r_contact), contact_mat)
	setobject!(vis[name][:robot]["knee1"], Sphere(Point3f0(0.0), r), body_mat)
	setobject!(vis[name][:robot]["knee2"], Sphere(Point3f0(0.0), r), body_mat)
	setobject!(vis[name][:robot]["hip"], Sphere(Point3f0(0.0), r), body_mat)
	setobject!(vis[name][:robot]["torso_top"], Sphere(Point3f0(0.0), r), body_mat)

	return nothing
end

function set_robot!(vis::Visualizer, model::Flamingo, q::AbstractVector;
		name::Symbol=:Flamingo, r=0.005)

	r = convert(Float32, r)
	r_contact = convert(Float32, r*8/7)
	p_shift = [0.0; 0.0; r_contact]

	p = [q[1]; 0.0; q[2]] + p_shift

	k_torso = kinematics_1(model, q, body = :torso, mode = :ee)
	p_torso = [k_torso[1], 0.0, k_torso[2]] + p_shift

	k_thigh_1 = kinematics_1(model, q, body = :thigh_1, mode = :ee)
	p_thigh_1 = [k_thigh_1[1], 0.0, k_thigh_1[2]] + p_shift

	k_calf_1 = kinematics_2(model, q, body = :calf_1, mode = :ee)
	p_calf_1 = [k_calf_1[1], 0.0, k_calf_1[2]] + p_shift

	k_thigh_2 = kinematics_1(model, q, body = :thigh_2, mode = :ee)
	p_thigh_2 = [k_thigh_2[1], 0.0, k_thigh_2[2]] + p_shift

	k_calf_2 = kinematics_2(model, q, body = :calf_2, mode = :ee)
	p_calf_2 = [k_calf_2[1], 0.0, k_calf_2[2]] + p_shift

	k_toe_1 = kinematics_3(model, q, body = :foot_1, mode = :toe)
	p_toe_1 = [k_toe_1[1], 0.0, k_toe_1[2]] + p_shift

	k_heel_1 = kinematics_3(model, q, body = :foot_1, mode = :heel)
	p_heel_1 = [k_heel_1[1], 0.0, k_heel_1[2]] + p_shift

	k_toe_2 = kinematics_3(model, q, body = :foot_2, mode = :toe)
	p_toe_2 = [k_toe_2[1], 0.0, k_toe_2[2]] + p_shift

	k_heel_2 = kinematics_3(model, q, body = :foot_2, mode = :heel)
	p_heel_2 = [k_heel_2[1], 0.0, k_heel_2[2]] + p_shift

	settransform!(vis[name][:robot]["thigh1"], cable_transform(p, p_thigh_1))
	settransform!(vis[name][:robot]["calf1"], cable_transform(p_thigh_1, p_calf_1))
	settransform!(vis[name][:robot]["foot1"], cable_transform(p_toe_1, p_heel_1))

	settransform!(vis[name][:robot]["thigh2"], cable_transform(p, p_thigh_2))
	settransform!(vis[name][:robot]["calf2"], cable_transform(p_thigh_2, p_calf_2))
	settransform!(vis[name][:robot]["foot2"], cable_transform(p_toe_2, p_heel_2))

	settransform!(vis[name][:robot]["torso"], cable_transform(p_torso,p))
	settransform!(vis[name][:robot]["heel1"], Translation(p_heel_1))
	settransform!(vis[name][:robot]["heel2"], Translation(p_heel_2))
	settransform!(vis[name][:robot]["toe1"], Translation(p_toe_1))
	settransform!(vis[name][:robot]["toe2"], Translation(p_toe_2))
	settransform!(vis[name][:robot]["knee1"], Translation(p_thigh_1))
	settransform!(vis[name][:robot]["knee2"], Translation(p_thigh_2))
	settransform!(vis[name][:robot]["hip"], Translation(p))
	settransform!(vis[name][:robot]["torso_top"], Translation(p_torso))

	return nothing
end

function contact_point(model::Flamingo, q::AbstractVector)
	k_toe_1 = kinematics_3(model, q, body = :foot_1, mode = :toe)
	p_toe_1 = [k_toe_1[1], 0.0, k_toe_1[2]]

	k_heel_1 = kinematics_3(model, q, body = :foot_1, mode = :heel)
	p_heel_1 = [k_heel_1[1], 0.0, k_heel_1[2]]

	k_toe_2 = kinematics_3(model, q, body = :foot_2, mode = :toe)
	p_toe_2 = [k_toe_2[1], 0.0, k_toe_2[2]]

	k_heel_2 = kinematics_3(model, q, body = :foot_2, mode = :heel)
	p_heel_2 = [k_heel_2[1], 0.0, k_heel_2[2]]

	pc = [p_toe_1, p_heel_1, p_toe_2, p_heel_2]
	return pc
end

function build_meshrobot!(vis::Visualizer, model::Flamingo; name::Symbol=:Flamingo, α=1.0)
	default_background!(vis)

	# urdf = joinpath(@__DIR__, "mesh", "flamingo.urdf")
	# mechanism = MeshCatMechanisms.parse_urdf(urdf)
	# mvis = MechanismVisualizer(mechanism, URDFVisuals(urdf, package_path=[@__DIR__]), vis[name])
	urdf = joinpath(@__DIR__, "mesh", "flamingo.urdf")
	package_path = @__DIR__
	build_meshrobot!(vis, model, urdf, package_path; name=name, α=α)
end

function convert_config(model::Flamingo, q::AbstractVector)
    _q = zeros(7)
    _q[1] = q[3]
    _q[2] = q[4] - _q[1]
    _q[4] = (q[5] - _q[2] - _q[1])
    _q[6] = q[8] - _q[4] - _q[2] - _q[1] - 0.5 * π

    _q[3] = q[6] - _q[1]
    _q[5] = q[7] - _q[3] - _q[1]
    _q[7] = q[9] - _q[5] - _q[3] - _q[1] - 0.5 * π

    return _q, compose(Translation(q[1], 0.0, q[2] + 0.02), LinearMap(RotZ(π)))
end

function flamingo_animation!(vis, sim, surf; lines = true)
	x_mean = 1.5 #0.5 * (sim.traj.q[1][1] + sim.traj.q[end][1])
	shift_traj = deepcopy(sim.traj)
	sim.traj.q[end][1]
	for t = 1:length(shift_traj.q)
		shift_traj.q[t][1] -= x_mean
	end

	# surf_shift = x -> x[3] - sim.model.env.surf(x[1] + x_mean)[1]
	# plot_surface!(vis, surf_shift, xlims=[-4.5, 4.5], ylims = [-0.5, 0.5],
	# 	col = (0.9, 0.9, 0.9), α = 1.0)
	x_range = range(-3.0, stop = 3.0, length = 100)
	surface_points = [Point(x, 0.0, surf(x + x_mean)) for x in x_range]
	surface_mat = LineBasicMaterial(color=RGBA(0.0, 0.0, 0.0, 1.0), linewidth=5)
	setobject!(vis[:lines][:surface], MeshCat.Line(surface_points, surface_mat))

	# lines && plot_lines!(vis, model, shift_traj.q[1:end], offset=-0.25, size = 5)

	settransform!(vis["/Cameras/default"],
			compose(Translation(0.0, -95.0, -1.0), LinearMap(RotY(0.0 * π) * RotZ(-π / 2.0))))
	setprop!(vis["/Cameras/default/rotated/<object>"], "zoom", 50)

	anim = visualize_meshrobot!(vis, sim.model, shift_traj, sample=10)

	return anim, shift_traj
end

function flamingo_ghost!(vis, sim, surf; lines = true)
	x_mean = 1.5 #0.5 * (sim.traj.q[1][1] + sim.traj.q[end][1])
	shift_traj = deepcopy(sim.traj)
	sim.traj.q[end][1]
	for t = 1:length(shift_traj.q)
		shift_traj.q[t][1] -= x_mean
	end

	# surf_shift = x -> x[3] - sim.model.env.surf(x[1] + x_mean)[1]
	# plot_surface!(vis, surf_shift, xlims=[-4.5, 4.5], ylims = [-0.5, 0.5],
	# 	col = (0.9, 0.9, 0.9), α = 1.0)
	x_range = range(-3.0, stop = 3.0, length = 100)
	surface_points = [Point(x, 0.0, surf(x + x_mean)) for x in x_range]
	surface_mat = LineBasicMaterial(color=RGBA(0.0, 0.0, 0.0, 1.0), linewidth=5)
	setobject!(vis[:lines][:surface], MeshCat.Line(surface_points, surface_mat))

	# lines && plot_lines!(vis, model, shift_traj.q[1:end], offset=-0.25, size = 5)

	settransform!(vis["/Cameras/default"],
			compose(Translation(0.0, -95.0, -1.0), LinearMap(RotY(0.0 * π) * RotZ(-π / 2.0))))
	setprop!(vis["/Cameras/default/rotated/<object>"], "zoom", 50)

	t = 1
	mvis1 = build_meshrobot!(vis, sim.model; name=:Flamingo1, α = 0.20)
	set_meshrobot!(vis, mvis1, sim.model, shift_traj.q[t], name = :Flamingo1)

	t = 1175
	mvis2 = build_meshrobot!(vis, sim.model; name=:Flamingo2, α = 0.40)
	set_meshrobot!(vis, mvis2, sim.model, shift_traj.q[t], name = :Flamingo2)

	t = 2565
	mvis3 = build_meshrobot!(vis, sim.model; name=:Flamingo3, α = 0.60)
	set_meshrobot!(vis, mvis3, sim.model, shift_traj.q[t], name = :Flamingo3)

	t = 3750
	mvis4 = build_meshrobot!(vis, sim.model; name=:Flamingo4, α = 0.80)
	set_meshrobot!(vis, mvis4, sim.model, shift_traj.q[t], name = :Flamingo4)

	t = shift_traj.H
	mvis5 = build_meshrobot!(vis, sim.model; name=:Flamingo5, α = 1.0)
	set_meshrobot!(vis, mvis5, sim.model, shift_traj.q[t], name = :Flamingo5)
end


text:
# Adapted from https://github.com/Roger-luo/Comonicon.jl/blob/master/example/pkg.jl

using ComoniconGUI

# pkg activate <string> --shared=false

module PkgCmd

using ComoniconGUI

"""
activate the environment at `path`.

# Arguments

- `path`: the path of the environment

# Flags

- `--shared`: whether activate the shared environment
"""
@cast function activate(path; shared::Bool = false)
    println("activating $path (shared=$shared)")
end

"""
deactivate the environment at `path`.

# Arguments

- `path`: the path of the environment

# Flags

- `--shared`: whether activate the shared environment
"""
@cast function deactivate(path; shared::Bool = false)
    println("deactivating $path (shared=$shared)")
end

@main

end

PkgCmd.poptart_main()


text:
using Quaternions
using StaticArrays
#using ArrayFire

include("matrix.jl")
include("vector.jl")

"""
TODO
"""
function frustum{T}(left::T, right::T, bottom::T, top::T, znear::T, zfar::T)
  (right == left || bottom == top || znear == zfar) && return eye(Mat4x4(T))
  T[
    2*znear/(right-left) 0 0 0
    0 2*znear/(top-bottom) 0 0
    (right+left)/(right-left) (top+bottom)/(top-bottom) (-(zfar+znear)/(zfar-znear)) -(2*znear*zfar) / (zfar-znear)
    0 0 -1 0
  ]
end

"""
TODO
"""
function projection_perspective{T}(fovy::T, aspect::T, znear::T, zfar::T)
  (znear == zfar) && error("znear ($znear) must be different from tfar ($zfar)")
  zfn = 1/(zfar-znear)

  t = tan(fovy * 0.5)
  h = T(tan(fovy * pi / 360) * znear)
  w = T(h * aspect)

  left = -w
  right = w
  bottom = -h
  top = h

  frustum(-w, w, -h, h, znear, zfar)
end

"""
TODO
"""
function projection_orthographic{T}(left::T,right::T,bottom::T,top::T,znear::T,zfar::T)
  (right==left || bottom==top || znear==zfar) && return eye(Mat4x4(T))
  T[
    2/(right-left) 0 0 0
    0 2/(top-bottom) 0 0
    0 0 -2/(zfar-znear) 0
    -(right+left)/(right-left) -(top+bottom)/(top-bottom) -(zfar+znear)/(zfar-znear) 1
  ]
end

"""
TODO
"""
function translation{T}(t::Array{T,1})
  lt = length(t)
  T[
    1 0 0 (lt<1?0:t[1])
    0 1 0 (lt<2?0:t[2])
    0 0 1 (lt<3?0:t[3])
    0 0 0 (lt<4?1:t[4])
  ]
end

"""
TODO
"""
function rotation{T}(r::Array{T,1})
  lr = length(r)
  T[
    1 0 0 0
    0 1 0 0
    0 0 1 0
    (lr<1?0:r[1]) (lr<2?0:r[2]) (lr<3?0:r[3]) (lr<4?1:r[4])
  ]
end

"""
TODO
"""
function rotation{T}(q::Quaternion{T})
  sx, sy, sz = 2q.s*q.v1,  2q.s*q.v2,   2q.s*q.v3
  xx, xy, xz = 2q.v1^2,    2q.v1*q.v2,  2q.v1*q.v3
  yy, yz, zz = 2q.v2^2,    2q.v2*q.v3,  2q.v3^2

  T[
      1-(yy+zz)  xy+sz        xz-sy        0
      xy-sz        1-(xx+zz)  yz+sx        0
      xz+sy        yz-sx        1-(xx+yy)  0
      0 0 0 1
  ]
end

"""
TODO
"""
function computeRotation{T}(r::Array{T,1})
  lr = length(r)
  (lr<3) && error("rotation has less than 3 elements!")

  dirBackwards= T[-1,0,0]
  dirRight = T[0,0,1]
  dirUp = T[0,1,0] #cross(dirRight, dirBackwards)

  q = qrotation(dirRight, r[3]) * qrotation(dirUp, r[1]) * qrotation(dirBackwards, r[2])

  #q = qrotation(T[1,1,1],0)
  #if lr<3 q = qrotation(dirRight, r[3]) end
  #if lr<1 q *= qrotation(dirUp, r[1]) end
  #if lr<2 q *= qrotation(dirBackwards, r[2]) end

  rotation(q)
end

"""
TODO
"""
function scaling{T}(s::Array{T})
  ls = length(s)
  T[
    (ls<1?1:s[1]) 0 0 0
    0 (ls<2?1:s[2]) 0 0
    0 0 (ls<3?1:s[3]) 0
    0 0 0 (ls<4?1:s[4])
  ]
end

"""
TODO
"""
function transform{T}(t::Array{T,1},r::Array{T,1},s::Array{T,1})
#=
  lt = length(t)
  lr = length(r)
  ls = length(s)
  T[
    (ls<1?1:s[1]) 0 0 (lt<1?0:t[1])
    0 (ls<2?1:s[2]) 0 (lt<2?0:t[2])
    0 0 (ls<3?1:s[3]) (lt<3?0:t[3])
    (lr<1?0:r[1]) (lr<2?0:r[2]) (lr<3?0:r[3]) (lt<4?1:t[4])*(lr<4?1:r[4])*(ls<4?1:s[4])
  ]
=#
  translation(t)*computeRotation(r)*scaling(s)
end

"""
TODO
"""
function ViewRH{T}(eye::Array{T,1}, yaw::T, pitch::T)
  (length(eye) < 3) && error("eye has less than 3 elements!")

  # If the pitch and yaw angles are in degrees,
  # they need to be converted to radians. Here
  # I assume the values are already converted to radians.
  cosPitch = cos(pitch)
  sinPitch = sin(pitch)
  cosYaw = cos(yaw)
  sinYaw = sin(yaw)

  xaxis = T[ cosYaw, 0, -sinYaw ]
  yaxis = T[ sinYaw * sinPitch, cosPitch, cosYaw * sinPitch ]
  zaxis = T[ sinYaw * cosPitch, -sinPitch, cosPitch * cosYaw ]
  eaxis = T[ -dot(xaxis,eye), -dot(yaxis,eye), -dot(zaxis,eye) ]

  # Create a 4x4 view matrix from the right, up, forward and eye position vectors
  T[
    xaxis[1] yaxis[1] zaxis[1] eaxis[1]*0
    xaxis[2] yaxis[2] zaxis[2] eaxis[2]*0
    xaxis[3] yaxis[3] zaxis[3] eaxis[3]*0
    eaxis[1]*1 eaxis[2]*1 eaxis[3]*1 1
  ]
end

"""
TODO
"""
function lookat{T}(eye::Array{T,1}, lookAt::Array{T,1}, up::Array{T,1})
  (length(eye) < 3) && error("eye has less than 3 elements!")
  (length(lookAt) < 3) && error("lookAt has less than 3 elements!")
  (length(up) < 3) && error("up has less than 3 elements!")

  zaxis  = normalize(eye-lookAt)
  xaxis  = normalize(cross(up,zaxis))
  yaxis  = normalize(cross(zaxis, xaxis))
  eaxis = T[ -dot(xaxis,eye), -dot(yaxis,eye), -dot(zaxis,eye) ]

  T[
      xaxis[1] yaxis[1] zaxis[1] 0;
      xaxis[2] yaxis[2] zaxis[2] 0;
      xaxis[3] yaxis[3] zaxis[3] 0;
      eaxis[1] eaxis[2] eaxis[3] 1
  ]
end

"""
TODO
"""
forward{T}(m::Array{T, 2}) = T[m[3,1],m[3,2],m[3,3]]

"""
TODO
"""
right{T}(m::Array{T, 2}) = T[m[1,1],m[1,2],m[1,3]]

"""
TODO
"""
up{T}(m::Array{T, 2}) = T[m[2,1],m[2,2],m[2,3]]

#=
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & v)
{
  tquat<T, P> Result(uninitialize);

  T const a(angle);
  T const s = glm::sin(a * static_cast<T>(0.5));

  Result.w = glm::cos(a * static_cast<T>(0.5));
  Result.x = v.x * s;
  Result.y = v.y * s;
  Result.z = v.z * s;
  return Result;
}

function mat4x4ToMat3x3{T}(q)
  qxx = (q.x * q.x)
  qyy = (q.y * q.y)
  qzz = (q.z * q.z)
  qxz = (q.x * q.z)
  qxy = (q.x * q.y)
  qyz = (q.y * q.z)
  qwx = (q.w * q.x)
  qwy = (q.w * q.y)
  qwz = (q.w * q.z)

  Result = Mat3x3(T)
  Result[0][0] = T(1) - T(2) * (qyy +  qzz);
  Result[0][1] = T(2) * (qxy + qwz);
  Result[0][2] = T(2) * (qxz - qwy);

  Result[1][0] = T(2) * (qxy - qwz);
  Result[1][1] = T(1) - T(2) * (qxx +  qzz);
  Result[1][2] = T(2) * (qyz + qwx);

  Result[2][0] = T(2) * (qxz + qwy);
  Result[2][1] = T(2) * (qyz - qwx);
  Result[2][2] = T(1) - T(2) * (qxx +  qyy);
  Result
end
=#

# glm::mat4 rotate = glm::transpose(glm::toMat4(m_Rotation));

max_stars_repo_name: Gilga/JuliaOpenGL

max_issues_repo_name: Gilga/JuliaOpenGL

max_forks_repo_name: Gilga/JuliaOpenGL


text:
#
# Wrapper for implementing SCIP separators in Julia.
#
# Please study the corresponding SCIP documentation first, to become familiar
# with basic concepts and terms: https://www.scipopt.org/doc/html/SEPA.php
#
# The basic idea is that you create a new subtype of `AbstractSeparator`
# to store the separator data and implement the fundamental callback by
# adding a method to the function `exec_lp`. In `test/sepa.jl` and
# `test/sepa_support.jl` you can find examples on how to use separators
#
#
# Current limitations:
# - We only support SEPAEXECLP, not SEPAEXECSOL.
# - We don't support these optional methods: SEPAFREE, SEPACOPY, SEPAINIT,
#   SEPAINITSOL, SEPAEXITSOL
#

#
# Abstract Supertypes:
#

"""
    AbstractSeparator

Abstract supertype for objects that store all user data belonging to the
separator. This object is also used for method dispatch with the callback
functions.

From SCIP's point-of-view, this objects corresponds to the SCIP_SEPADATA,
but its memory is managed by Julia's GC.

It's recommended to store a reference to your instance of `SCIPData` or
`SCIP.Optimizer` here, so that you can use it within `exec_lp`.
"""
abstract type AbstractSeparator end

#
# Fundamental Callback for Julia.
#

"""
    exec_lp(separator::SEPA)::SCIP_RESULT

Adds cutting planes to the model. Feasible solutions may be cutted off, as long
as at least one optimal solution stays feasible.

Use the functions `sol_values` to access the solution values.

Acceptable result values are:
* `SCIP_CUTOFF`: The current subproblem is infeasible.
* `SCIP_CONSADDED`: Added a constraint.
* `SCIP_REDUCEDDOM`: Reduced the domain of a variable.
* `SCIP_SEPARATED`: Added a cutting plane.
* `SCIP_DIDNOTFIND`: Searched for domain reductions or cutting planes, but did
  not find any.
* `SCIP_DIDNOTRUN`: Separator was skipped.
* `SCIP_DELAYED`: Separator was skipped, but should be called again.
* `SCIP_NEWROUND`: A new separator round should be started without calling the
  remaining separator methods.
"""
function exec_lp end

#
# Fundamental callback functions with SCIP's C API.
#
# There is only a single, generic implementation for each of these, which are
# passed to all user-defined SCIP separators, but they will call the user's
# method in the function body.
#

"""
Generic `exec_lp` function, matching the signature from SCIP's C API.
"""
function _sepaexeclp(scip::Ptr{SCIP_}, sepa::Ptr{SCIP_SEPA},
                     result::Ptr{SCIP_RESULT},
                     allowlocal::SCIP_Bool)
    # get Julia object out of separator data
    sepadata::Ptr{SCIP_SEPADATA} = SCIPsepaGetData(sepa)
    separator = unsafe_pointer_to_objref(sepadata)

    # call user method via dispatch
    res = exec_lp(separator)
    unsafe_store!(result, res)

    return SCIP_OKAY
end

"""
Generic `free` function, matching the signature from SCIP's C API.
"""
function _sepafree(scip::Ptr{SCIP_}, sepa::Ptr{SCIP_SEPA})
    # Here, we should free the separator data. But because this is an object
    # created and owned by Julia, we will let GC do it.
    # Instead, we will just set the pointer to NULL, so that SCIP will think
    # that it is taken care of.
    SCIPsepaSetData(sepa, C_NULL)

    return SCIP_OKAY
end

#
# Adding a separator to SCIP.
#

"""
    include_sepa(
        scip::Ptr{SCIP_},
        sepas::Dict{Any, Ptr{SCIP_SEPA}},
        sepa::SEPA;
        name::String,
        description::String,
        priority::Int,
        freq::Int,
        maxbounddist::Float,
        usesubscip::Bool,
        delay::Bool
    )

Include a user defined separator `sepa` to the SCIP instance `scip`.

"""
function include_sepa(scip::Ptr{SCIP_}, sepas::Dict{Any, Ptr{SCIP_SEPA}}, sepa::SEPA;
                      name="", description="", priority=0, freq=1,
                      maxbounddist=0.0, usessubscip=false,
                      delay=false) where SEPA <: AbstractSeparator
    # Get C function pointers from Julia functions
    _execlp = @cfunction(_sepaexeclp, SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_SEPA}, Ptr{SCIP_RESULT}, SCIP_Bool))
    _execsol = C_NULL

    # Store pointer to SCIP structure (for future C API calls)
    sepa__ = Ref{Ptr{SCIP_SEPA}}(C_NULL)

    # Hand over Julia object as separator data:
    sepadata_ = pointer_from_objref(sepa)

    # Try to create unique name, or else SCIP will complain!
    if name == ""
        name = "__sepa__$(length(sepas))"
    end

    # Register separator with SCIP instance.
    @SCIP_CALL SCIPincludeSepaBasic(scip, sepa__, name, description,
                             priority, freq, maxbounddist,
                             usessubscip, delay,
                             _execlp, _execsol,
                             sepadata_)

    # Sanity checks
    @assert sepa__[] != C_NULL

    # Set additional callbacks.
    @SCIP_CALL SCIPsetSepaFree(
        scip, sepa__[],
        @cfunction(_sepafree, SCIP_RETCODE, (Ptr{SCIP_}, Ptr{SCIP_SEPA})))

    # Register separator (for GC-protection and mapping).
    sepas[sepa] = sepa__[]
end

"""
    add_cut_sepa(
        scip::Ptr{SCIP_},
        vars::Dict{VarRef, Ref{Ptr{SCIP_VAR}}}
        sepas::Dict{Any, Ptr{SCIP_SEPA}}
        sepa::SEPA,
        varrefs::AbstractArray{VarRef},
        coefs::AbstractArray{Float64},
        lhs::Float64,
        rhs::Float64,
        islocal::Bool,
        modifiable::Bool,
        removable::Bool
    )

Add the cut given by `varrefs`, `coefs`, `lhs` and `rhs` to `scip`.
`add_cut_sepa` is intended to be called from the method `exec_lp`, that is
associated to the separator `sepa`.

# Arguments
- islocal: is cut only valid locally?
- modifiable: is row modifiable during node processing (subject to column generation)?
- removable: should the row be removed from the LP due to aging or cleanup?
"""
function add_cut_sepa(scip::Ptr{SCIP_}, vars::Dict{VarRef, Ref{Ptr{SCIP_VAR}}}, sepas::Dict{Any, Ptr{SCIP_SEPA}}, sepa::SEPA, varrefs, coefs, lhs, rhs;
                      islocal=false, modifiable=false, removable=true
                     ) where SEPA <: AbstractSeparator
    @assert length(varrefs) == length(coefs)
    vars = [vars[vr][] for vr in varrefs]
    row__ = Ref{Ptr{SCIP_ROW}}(C_NULL)
    sepa__ = sepas[sepa]
    @SCIP_CALL SCIPcreateEmptyRowSepa(
        scip, row__, sepa__, "", lhs, rhs, islocal, modifiable, removable)
    @SCIP_CALL SCIPaddVarsToRow(scip, row__[], length(vars), vars, coefs)
    if islocal
      infeasible = Ref{SCIP_Bool}()
      @SCIP_CALL SCIPaddRow(scip, row__[], true, infeasible)
    else
      @SCIP_CALL SCIPaddPoolCut(scip, row__[])
    end
    @SCIP_CALL SCIPreleaseRow(scip, row__)
end


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

"""
    complete_snapshot(snapshot_id, x-amz-_changed_blocks_count)
    complete_snapshot(snapshot_id, x-amz-_changed_blocks_count, params::Dict{String,<:Any})

Seals and completes the snapshot after all of the required blocks of data have been written
to it. Completing the snapshot changes the status to completed. You cannot write new blocks
to a snapshot after it has been completed.

# Arguments
- `snapshot_id`: The ID of the snapshot.
- `x-amz-_changed_blocks_count`: The number of blocks that were written to the snapshot.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"x-amz-Checksum"`: An aggregated Base-64 SHA256 checksum based on the checksums of each
  written block. To generate the aggregated checksum using the linear aggregation method,
  arrange the checksums for each written block in ascending order of their block index,
  concatenate them to form a single string, and then generate the checksum on the entire
  string using the SHA256 algorithm.
- `"x-amz-Checksum-Aggregation-Method"`: The aggregation method used to generate the
  checksum. Currently, the only supported aggregation method is LINEAR.
- `"x-amz-Checksum-Algorithm"`: The algorithm used to generate the checksum. Currently, the
  only supported algorithm is SHA256.
"""
complete_snapshot(snapshotId, x_amz_ChangedBlocksCount; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("POST", "/snapshots/completion/$(snapshotId)", Dict{String, Any}("headers"=>Dict{String, Any}("x-amz-ChangedBlocksCount"=>x_amz_ChangedBlocksCount)); aws_config=aws_config)
complete_snapshot(snapshotId, x_amz_ChangedBlocksCount, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("POST", "/snapshots/completion/$(snapshotId)", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("headers"=>Dict{String, Any}("x-amz-ChangedBlocksCount"=>x_amz_ChangedBlocksCount)), params)); aws_config=aws_config)

"""
    get_snapshot_block(block_index, block_token, snapshot_id)
    get_snapshot_block(block_index, block_token, snapshot_id, params::Dict{String,<:Any})

Returns the data in a block in an Amazon Elastic Block Store snapshot.

# Arguments
- `block_index`: The block index of the block from which to get data. Obtain the BlockIndex
  by running the ListChangedBlocks or ListSnapshotBlocks operations.
- `block_token`: The block token of the block from which to get data. Obtain the BlockToken
  by running the ListChangedBlocks or ListSnapshotBlocks operations.
- `snapshot_id`: The ID of the snapshot containing the block from which to get data.

"""
get_snapshot_block(blockIndex, blockToken, snapshotId; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("GET", "/snapshots/$(snapshotId)/blocks/$(blockIndex)", Dict{String, Any}("blockToken"=>blockToken); aws_config=aws_config)
get_snapshot_block(blockIndex, blockToken, snapshotId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("GET", "/snapshots/$(snapshotId)/blocks/$(blockIndex)", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("blockToken"=>blockToken), params)); aws_config=aws_config)

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

Returns information about the blocks that are different between two Amazon Elastic Block
Store snapshots of the same volume/snapshot lineage.

# Arguments
- `second_snapshot_id`: The ID of the second snapshot to use for the comparison.  The
  SecondSnapshotId parameter must be specified with a FirstSnapshotID parameter; otherwise,
  an error occurs.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"firstSnapshotId"`: The ID of the first snapshot to use for the comparison.  The
  FirstSnapshotID parameter must be specified with a SecondSnapshotId parameter; otherwise,
  an error occurs.
- `"maxResults"`: The number of results to return.
- `"pageToken"`: The token to request the next page of results.
- `"startingBlockIndex"`: The block index from which the comparison should start. The list
  in the response will start from this block index or the next valid block index in the
  snapshots.
"""
list_changed_blocks(secondSnapshotId; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("GET", "/snapshots/$(secondSnapshotId)/changedblocks"; aws_config=aws_config)
list_changed_blocks(secondSnapshotId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("GET", "/snapshots/$(secondSnapshotId)/changedblocks", params; aws_config=aws_config)

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

Returns information about the blocks in an Amazon Elastic Block Store snapshot.

# Arguments
- `snapshot_id`: The ID of the snapshot from which to get block indexes and block tokens.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The number of results to return.
- `"pageToken"`: The token to request the next page of results.
- `"startingBlockIndex"`: The block index from which the list should start. The list in the
  response will start from this block index or the next valid block index in the snapshot.
"""
list_snapshot_blocks(snapshotId; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("GET", "/snapshots/$(snapshotId)/blocks"; aws_config=aws_config)
list_snapshot_blocks(snapshotId, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("GET", "/snapshots/$(snapshotId)/blocks", params; aws_config=aws_config)

"""
    put_snapshot_block(block_data, block_index, snapshot_id, x-amz-_checksum, x-amz-_checksum-_algorithm, x-amz-_data-_length)
    put_snapshot_block(block_data, block_index, snapshot_id, x-amz-_checksum, x-amz-_checksum-_algorithm, x-amz-_data-_length, params::Dict{String,<:Any})

Writes a block of data to a snapshot. If the specified block contains data, the existing
data is overwritten. The target snapshot must be in the pending state. Data written to a
snapshot must be aligned with 512-byte sectors.

# Arguments
- `block_data`: The data to write to the block. The block data is not signed as part of the
  Signature Version 4 signing process. As a result, you must generate and provide a
  Base64-encoded SHA256 checksum for the block data using the x-amz-Checksum header. Also,
  you must specify the checksum algorithm using the x-amz-Checksum-Algorithm header. The
  checksum that you provide is part of the Signature Version 4 signing process. It is
  validated against a checksum generated by Amazon EBS to ensure the validity and
  authenticity of the data. If the checksums do not correspond, the request fails. For more
  information, see  Using checksums with the EBS direct APIs in the Amazon Elastic Compute
  Cloud User Guide.
- `block_index`: The block index of the block in which to write the data. A block index is
  a logical index in units of 512 KiB blocks. To identify the block index, divide the logical
  offset of the data in the logical volume by the block size (logical offset of data/524288).
  The logical offset of the data must be 512 KiB aligned.
- `snapshot_id`: The ID of the snapshot.
- `x-amz-_checksum`: A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums
  are supported.
- `x-amz-_checksum-_algorithm`: The algorithm used to generate the checksum. Currently, the
  only supported algorithm is SHA256.
- `x-amz-_data-_length`: The size of the data to write to the block, in bytes. Currently,
  the only supported size is 524288. Valid values: 524288

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"x-amz-Progress"`: The progress of the write process, as a percentage.
"""
put_snapshot_block(BlockData, blockIndex, snapshotId, x_amz_Checksum, x_amz_Checksum_Algorithm, x_amz_Data_Length; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("PUT", "/snapshots/$(snapshotId)/blocks/$(blockIndex)", Dict{String, Any}("BlockData"=>BlockData, "headers"=>Dict{String, Any}("x-amz-Checksum"=>x_amz_Checksum, "x-amz-Checksum-Algorithm"=>x_amz_Checksum_Algorithm, "x-amz-Data-Length"=>x_amz_Data_Length)); aws_config=aws_config)
put_snapshot_block(BlockData, blockIndex, snapshotId, x_amz_Checksum, x_amz_Checksum_Algorithm, x_amz_Data_Length, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("PUT", "/snapshots/$(snapshotId)/blocks/$(blockIndex)", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("BlockData"=>BlockData, "headers"=>Dict{String, Any}("x-amz-Checksum"=>x_amz_Checksum, "x-amz-Checksum-Algorithm"=>x_amz_Checksum_Algorithm, "x-amz-Data-Length"=>x_amz_Data_Length)), params)); aws_config=aws_config)

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

Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the
request completes.  After creating the snapshot, use  PutSnapshotBlock to write blocks of
data to the snapshot.

# Arguments
- `volume_size`: The size of the volume, in GiB. The maximum size is 16384 GiB (16 TiB).

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"ClientToken"`: A unique, case-sensitive identifier that you provide to ensure the
  idempotency of the request. Idempotency ensures that an API request completes only once.
  With an idempotent request, if the original request completes successfully. The subsequent
  retries with the same client token return the result from the original successful request
  and they have no additional effect. If you do not specify a client token, one is
  automatically generated by the AWS SDK. For more information, see  Idempotency for
  StartSnapshot API in the Amazon Elastic Compute Cloud User Guide.
- `"Description"`: A description for the snapshot.
- `"Encrypted"`: Indicates whether to encrypt the snapshot. To create an encrypted
  snapshot, specify true. To create an unencrypted snapshot, omit this parameter. If you
  specify a value for ParentSnapshotId, omit this parameter. If you specify true, the
  snapshot is encrypted using the CMK specified using the KmsKeyArn parameter. If no value is
  specified for KmsKeyArn, the default CMK for your account is used. If no default CMK has
  been specified for your account, the AWS managed CMK is used. To set a default CMK for your
  account, use  ModifyEbsDefaultKmsKeyId. If your account is enabled for encryption by
  default, you cannot set this parameter to false. In this case, you can omit this parameter.
  For more information, see  Using encryption in the Amazon Elastic Compute Cloud User Guide.
- `"KmsKeyArn"`: The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
  customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK,
  the default AWS managed CMK is used. If you specify a ParentSnapshotId, omit this
  parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the
  parent snapshot. If Encrypted is set to true, you must specify a CMK ARN.
- `"ParentSnapshotId"`: The ID of the parent snapshot. If there is no parent snapshot, or
  if you are creating the first snapshot for an on-premises volume, omit this parameter. If
  your account is enabled for encryption by default, you cannot use an unencrypted snapshot
  as a parent snapshot. You must first create an encrypted copy of the parent snapshot using
  CopySnapshot.
- `"Tags"`: The tags to apply to the snapshot.
- `"Timeout"`: The amount of time (in minutes) after which the snapshot is automatically
  cancelled if:   No blocks are written to the snapshot.   The snapshot is not completed
  after writing the last block of data.   If no value is specified, the timeout defaults to
  60 minutes.
"""
start_snapshot(VolumeSize; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("POST", "/snapshots", Dict{String, Any}("VolumeSize"=>VolumeSize, "ClientToken"=>string(uuid4())); aws_config=aws_config)
start_snapshot(VolumeSize, params::AbstractDict{String, <:Any}; aws_config::AbstractAWSConfig=global_aws_config()) = ebs("POST", "/snapshots", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("VolumeSize"=>VolumeSize, "ClientToken"=>string(uuid4())), params)); aws_config=aws_config)