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

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

"""

Calculate the hash of the given template.
Param: api_version::String (required)
Param: template::Any (required)
Return: TemplateHashResult
"""
function _swaggerinternal_deploymentsCalculateTemplateHash(_api::DeploymentsApi, api_version::String, template; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", TemplateHashResult, "/providers/Microsoft.Resources/calculateTemplateHash", ["azure_auth"], template)
    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 deploymentsCalculateTemplateHash(_api::DeploymentsApi, api_version::String, template; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCalculateTemplateHash(_api, api_version, template; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCalculateTemplateHash(_api::DeploymentsApi, response_stream::Channel, api_version::String, template; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCalculateTemplateHash(_api, api_version, template; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resource group partially deployed.
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCancel(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsCancel", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsCancel", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsCancel", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCancel", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCancel(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancel(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCancel(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancel(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resources partially deployed.
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCancelAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsCancelAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsCancelAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsCancelAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCancelAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", ["azure_auth"])
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCancelAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCancelAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resources partially deployed.
Param: scope::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCancelAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCancelAtScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCancelAtScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCancelAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCancelAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resources partially deployed.
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCancelAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCancelAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCancelAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCancelAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCancelAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resources partially deployed.
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCancelAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCancelAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCancelAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", Nothing, "/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCancelAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCancelAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCancelAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Checks whether the deployment exists.
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCheckExistence(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsCheckExistence", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsCheckExistence", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsCheckExistence", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistence", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "HEAD", Nothing, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCheckExistence(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistence(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCheckExistence(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistence(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Checks whether the deployment exists.
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCheckExistenceAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsCheckExistenceAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsCheckExistenceAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "HEAD", Nothing, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCheckExistenceAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCheckExistenceAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Checks whether the deployment exists.
Param: scope::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCheckExistenceAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "HEAD", Nothing, "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCheckExistenceAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCheckExistenceAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Checks whether the deployment exists.
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCheckExistenceAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "HEAD", Nothing, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCheckExistenceAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCheckExistenceAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Checks whether the deployment exists.
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsCheckExistenceAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCheckExistenceAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "HEAD", Nothing, "/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCheckExistenceAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCheckExistenceAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCheckExistenceAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deploys resources to a resource group.
You can provide the template and parameters directly in the request or link to JSON files.
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: parameters::Deployment (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsCreateOrUpdate(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsCreateOrUpdate", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsCreateOrUpdate", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdate", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdate", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "PUT", DeploymentExtended, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCreateOrUpdate(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdate(_api, resourceGroupName, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCreateOrUpdate(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdate(_api, resourceGroupName, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deploys resources at management group scope.
You can provide the template and parameters directly in the request or link to JSON files.
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: parameters::ScopedDeployment (required)
Param: api_version::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsCreateOrUpdateAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsCreateOrUpdateAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsCreateOrUpdateAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "PUT", DeploymentExtended, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCreateOrUpdateAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtManagementGroupScope(_api, groupId, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCreateOrUpdateAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtManagementGroupScope(_api, groupId, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deploys resources at a given scope.
You can provide the template and parameters directly in the request or link to JSON files.
Param: scope::String (required)
Param: deploymentName::String (required)
Param: parameters::Deployment (required)
Param: api_version::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsCreateOrUpdateAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "PUT", DeploymentExtended, "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCreateOrUpdateAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtScope(_api, scope, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCreateOrUpdateAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtScope(_api, scope, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deploys resources at subscription scope.
You can provide the template and parameters directly in the request or link to JSON files.
Param: deploymentName::String (required)
Param: parameters::Deployment (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsCreateOrUpdateAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "PUT", DeploymentExtended, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCreateOrUpdateAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtSubscriptionScope(_api, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCreateOrUpdateAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtSubscriptionScope(_api, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deploys resources at tenant scope.
You can provide the template and parameters directly in the request or link to JSON files.
Param: deploymentName::String (required)
Param: parameters::ScopedDeployment (required)
Param: api_version::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsCreateOrUpdateAtTenantScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsCreateOrUpdateAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "PUT", DeploymentExtended, "/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsCreateOrUpdateAtTenantScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtTenantScope(_api, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsCreateOrUpdateAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsCreateOrUpdateAtTenantScope(_api, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsDelete(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsDelete", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsDelete", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsDelete", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsDelete", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsDelete(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDelete(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsDelete(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDelete(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsDeleteAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsDeleteAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsDeleteAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsDeleteAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsDeleteAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsDeleteAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsDeleteAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.
Param: scope::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsDeleteAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsDeleteAtScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsDeleteAtScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsDeleteAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsDeleteAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsDeleteAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsDeleteAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsDeleteAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsDeleteAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsDeleteAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes a deployment from the deployment history.
A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_deploymentsDeleteAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsDeleteAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsDeleteAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsDeleteAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsDeleteAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsDeleteAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Exports the template used for specified deployment.
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentExportResult
"""
function _swaggerinternal_deploymentsExportTemplate(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsExportTemplate", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsExportTemplate", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsExportTemplate", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplate", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentExportResult, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsExportTemplate(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplate(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsExportTemplate(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplate(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Exports the template used for specified deployment.
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: DeploymentExportResult
"""
function _swaggerinternal_deploymentsExportTemplateAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsExportTemplateAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsExportTemplateAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentExportResult, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", ["azure_auth"])
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsExportTemplateAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsExportTemplateAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Exports the template used for specified deployment.
Param: scope::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: DeploymentExportResult
"""
function _swaggerinternal_deploymentsExportTemplateAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentExportResult, "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsExportTemplateAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsExportTemplateAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Exports the template used for specified deployment.
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentExportResult
"""
function _swaggerinternal_deploymentsExportTemplateAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentExportResult, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsExportTemplateAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsExportTemplateAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Exports the template used for specified deployment.
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: DeploymentExportResult
"""
function _swaggerinternal_deploymentsExportTemplateAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsExportTemplateAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentExportResult, "/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsExportTemplateAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsExportTemplateAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsExportTemplateAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a deployment.
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsGet(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsGet", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsGet", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsGet", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsGet", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentExtended, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsGet(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGet(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsGet(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGet(_api, resourceGroupName, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a deployment.
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsGetAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsGetAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsGetAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsGetAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsGetAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentExtended, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsGetAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsGetAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtManagementGroupScope(_api, groupId, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a deployment.
Param: scope::String (required)
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsGetAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsGetAtScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsGetAtScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentExtended, "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsGetAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsGetAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtScope(_api, scope, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a deployment.
Param: deploymentName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsGetAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsGetAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsGetAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentExtended, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsGetAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsGetAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtSubscriptionScope(_api, deploymentName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Gets a deployment.
Param: deploymentName::String (required)
Param: api_version::String (required)
Return: DeploymentExtended
"""
function _swaggerinternal_deploymentsGetAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsGetAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsGetAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentExtended, "/providers/Microsoft.Resources/deployments/{deploymentName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsGetAtTenantScope(_api::DeploymentsApi, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsGetAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsGetAtTenantScope(_api, deploymentName, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Get all the deployments for a management group.
Param: groupId::String (required)
Param: api_version::String (required)
Param: filter::String
Param: top::Int32
Return: DeploymentListResult
"""
function _swaggerinternal_deploymentsListAtManagementGroupScope(_api::DeploymentsApi, groupId::String, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsListAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsListAtManagementGroupScope", :minLength, groupId, 1)

    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentListResult, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/", ["azure_auth"])
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.query, "\$filter", filter)  # type String
    Swagger.set_param(_ctx.query, "\$top", top)  # type Int32
    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 deploymentsListAtManagementGroupScope(_api::DeploymentsApi, groupId::String, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtManagementGroupScope(_api, groupId, api_version; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsListAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtManagementGroupScope(_api, groupId, api_version; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Get all the deployments at the given scope.
Param: scope::String (required)
Param: api_version::String (required)
Param: filter::String
Param: top::Int32
Return: DeploymentListResult
"""
function _swaggerinternal_deploymentsListAtScope(_api::DeploymentsApi, scope::String, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentListResult, "/{scope}/providers/Microsoft.Resources/deployments/", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.query, "\$filter", filter)  # type String
    Swagger.set_param(_ctx.query, "\$top", top)  # type Int32
    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 deploymentsListAtScope(_api::DeploymentsApi, scope::String, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtScope(_api, scope, api_version; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsListAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtScope(_api, scope, api_version; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Get all the deployments for a subscription.
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: filter::String
Param: top::Int32
Return: DeploymentListResult
"""
function _swaggerinternal_deploymentsListAtSubscriptionScope(_api::DeploymentsApi, api_version::String, subscriptionId::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentListResult, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", ["azure_auth"])
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "\$filter", filter)  # type String
    Swagger.set_param(_ctx.query, "\$top", top)  # type Int32
    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 deploymentsListAtSubscriptionScope(_api::DeploymentsApi, api_version::String, subscriptionId::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtSubscriptionScope(_api, api_version, subscriptionId; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsListAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, api_version::String, subscriptionId::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtSubscriptionScope(_api, api_version, subscriptionId; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Get all the deployments at the tenant scope.
Param: api_version::String (required)
Param: filter::String
Param: top::Int32
Return: DeploymentListResult
"""
function _swaggerinternal_deploymentsListAtTenantScope(_api::DeploymentsApi, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentListResult, "/providers/Microsoft.Resources/deployments/", ["azure_auth"])
    Swagger.set_param(_ctx.query, "\$filter", filter)  # type String
    Swagger.set_param(_ctx.query, "\$top", top)  # type Int32
    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 deploymentsListAtTenantScope(_api::DeploymentsApi, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtTenantScope(_api, api_version; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsListAtTenantScope(_api::DeploymentsApi, response_stream::Channel, api_version::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListAtTenantScope(_api, api_version; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Get all the deployments for a resource group.
Param: resourceGroupName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Param: filter::String
Param: top::Int32
Return: DeploymentListResult
"""
function _swaggerinternal_deploymentsListByResourceGroup(_api::DeploymentsApi, resourceGroupName::String, api_version::String, subscriptionId::String; filter=nothing, top=nothing, _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsListByResourceGroup", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsListByResourceGroup", :minLength, resourceGroupName, 1)

    _ctx = Swagger.Ctx(_api.client, "GET", DeploymentListResult, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", ["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, "\$filter", filter)  # type String
    Swagger.set_param(_ctx.query, "\$top", top)  # type Int32
    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 deploymentsListByResourceGroup(_api::DeploymentsApi, resourceGroupName::String, api_version::String, subscriptionId::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListByResourceGroup(_api, resourceGroupName, api_version, subscriptionId; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsListByResourceGroup(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, api_version::String, subscriptionId::String; filter=nothing, top=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsListByResourceGroup(_api, resourceGroupName, api_version, subscriptionId; filter=filter, top=top, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: parameters::Deployment (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentValidateResult
"""
function _swaggerinternal_deploymentsValidate(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsValidate", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsValidate", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsValidate", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsValidate", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentValidateResult, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsValidate(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidate(_api, resourceGroupName, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsValidate(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidate(_api, resourceGroupName, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: parameters::ScopedDeployment (required)
Param: api_version::String (required)
Return: DeploymentValidateResult
"""
function _swaggerinternal_deploymentsValidateAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsValidateAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsValidateAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsValidateAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsValidateAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentValidateResult, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsValidateAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtManagementGroupScope(_api, groupId, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsValidateAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtManagementGroupScope(_api, groupId, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
Param: scope::String (required)
Param: deploymentName::String (required)
Param: parameters::Deployment (required)
Param: api_version::String (required)
Return: DeploymentValidateResult
"""
function _swaggerinternal_deploymentsValidateAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsValidateAtScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsValidateAtScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentValidateResult, "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "scope", scope)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsValidateAtScope(_api::DeploymentsApi, scope::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtScope(_api, scope, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsValidateAtScope(_api::DeploymentsApi, response_stream::Channel, scope::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtScope(_api, scope, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
Param: deploymentName::String (required)
Param: parameters::Deployment (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: DeploymentValidateResult
"""
function _swaggerinternal_deploymentsValidateAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsValidateAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsValidateAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentValidateResult, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsValidateAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtSubscriptionScope(_api, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsValidateAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtSubscriptionScope(_api, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
Param: deploymentName::String (required)
Param: parameters::ScopedDeployment (required)
Param: api_version::String (required)
Return: DeploymentValidateResult
"""
function _swaggerinternal_deploymentsValidateAtTenantScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsValidateAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsValidateAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", DeploymentValidateResult, "/providers/Microsoft.Resources/deployments/{deploymentName}/validate", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsValidateAtTenantScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtTenantScope(_api, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsValidateAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsValidateAtTenantScope(_api, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Returns changes that will be made by the deployment if executed at the scope of the resource group.
Param: resourceGroupName::String (required)
Param: deploymentName::String (required)
Param: parameters::DeploymentWhatIf (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: WhatIfOperationResult
"""
function _swaggerinternal_deploymentsWhatIf(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("resourceGroupName", "deploymentsWhatIf", :maxLength, resourceGroupName, 90)
    Swagger.validate_param("resourceGroupName", "deploymentsWhatIf", :minLength, resourceGroupName, 1)

    Swagger.validate_param("deploymentName", "deploymentsWhatIf", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsWhatIf", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", WhatIfOperationResult, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "resourceGroupName", resourceGroupName)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsWhatIf(_api::DeploymentsApi, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIf(_api, resourceGroupName, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsWhatIf(_api::DeploymentsApi, response_stream::Channel, resourceGroupName::String, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIf(_api, resourceGroupName, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Returns changes that will be made by the deployment if executed at the scope of the management group.
Param: groupId::String (required)
Param: deploymentName::String (required)
Param: parameters::ScopedDeploymentWhatIf (required)
Param: api_version::String (required)
Return: WhatIfOperationResult
"""
function _swaggerinternal_deploymentsWhatIfAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("groupId", "deploymentsWhatIfAtManagementGroupScope", :maxLength, groupId, 90)
    Swagger.validate_param("groupId", "deploymentsWhatIfAtManagementGroupScope", :minLength, groupId, 1)

    Swagger.validate_param("deploymentName", "deploymentsWhatIfAtManagementGroupScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsWhatIfAtManagementGroupScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", WhatIfOperationResult, "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "groupId", groupId)  # type String
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsWhatIfAtManagementGroupScope(_api::DeploymentsApi, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIfAtManagementGroupScope(_api, groupId, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsWhatIfAtManagementGroupScope(_api::DeploymentsApi, response_stream::Channel, groupId::String, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIfAtManagementGroupScope(_api, groupId, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Returns changes that will be made by the deployment if executed at the scope of the subscription.
Param: deploymentName::String (required)
Param: parameters::DeploymentWhatIf (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: WhatIfOperationResult
"""
function _swaggerinternal_deploymentsWhatIfAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsWhatIfAtSubscriptionScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsWhatIfAtSubscriptionScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", WhatIfOperationResult, "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsWhatIfAtSubscriptionScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIfAtSubscriptionScope(_api, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsWhatIfAtSubscriptionScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, parameters, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIfAtSubscriptionScope(_api, deploymentName, parameters, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""

Returns changes that will be made by the deployment if executed at the scope of the tenant group.
Param: deploymentName::String (required)
Param: parameters::ScopedDeploymentWhatIf (required)
Param: api_version::String (required)
Return: WhatIfOperationResult
"""
function _swaggerinternal_deploymentsWhatIfAtTenantScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    Swagger.validate_param("deploymentName", "deploymentsWhatIfAtTenantScope", :maxLength, deploymentName, 64)
    Swagger.validate_param("deploymentName", "deploymentsWhatIfAtTenantScope", :minLength, deploymentName, 1)

    _ctx = Swagger.Ctx(_api.client, "POST", WhatIfOperationResult, "/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "deploymentName", deploymentName)  # 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 deploymentsWhatIfAtTenantScope(_api::DeploymentsApi, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIfAtTenantScope(_api, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function deploymentsWhatIfAtTenantScope(_api::DeploymentsApi, response_stream::Channel, deploymentName::String, parameters, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_deploymentsWhatIfAtTenantScope(_api, deploymentName, parameters, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

export deploymentsCalculateTemplateHash, deploymentsCancel, deploymentsCancelAtManagementGroupScope, deploymentsCancelAtScope, deploymentsCancelAtSubscriptionScope, deploymentsCancelAtTenantScope, deploymentsCheckExistence, deploymentsCheckExistenceAtManagementGroupScope, deploymentsCheckExistenceAtScope, deploymentsCheckExistenceAtSubscriptionScope, deploymentsCheckExistenceAtTenantScope, deploymentsCreateOrUpdate, deploymentsCreateOrUpdateAtManagementGroupScope, deploymentsCreateOrUpdateAtScope, deploymentsCreateOrUpdateAtSubscriptionScope, deploymentsCreateOrUpdateAtTenantScope, deploymentsDelete, deploymentsDeleteAtManagementGroupScope, deploymentsDeleteAtScope, deploymentsDeleteAtSubscriptionScope, deploymentsDeleteAtTenantScope, deploymentsExportTemplate, deploymentsExportTemplateAtManagementGroupScope, deploymentsExportTemplateAtScope, deploymentsExportTemplateAtSubscriptionScope, deploymentsExportTemplateAtTenantScope, deploymentsGet, deploymentsGetAtManagementGroupScope, deploymentsGetAtScope, deploymentsGetAtSubscriptionScope, deploymentsGetAtTenantScope, deploymentsListAtManagementGroupScope, deploymentsListAtScope, deploymentsListAtSubscriptionScope, deploymentsListAtTenantScope, deploymentsListByResourceGroup, deploymentsValidate, deploymentsValidateAtManagementGroupScope, deploymentsValidateAtScope, deploymentsValidateAtSubscriptionScope, deploymentsValidateAtTenantScope, deploymentsWhatIf, deploymentsWhatIfAtManagementGroupScope, deploymentsWhatIfAtSubscriptionScope, deploymentsWhatIfAtTenantScope
