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

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

"""
Creates a predefined tag name.
This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.
Param: tagName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: TagDetails
"""
function _swaggerinternal_tagsCreateOrUpdate(_api::TagsApi, tagName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "PUT", TagDetails, "/subscriptions/{subscriptionId}/tagNames/{tagName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "tagName", tagName)  # 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 tagsCreateOrUpdate(_api::TagsApi, tagName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsCreateOrUpdate(_api, tagName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsCreateOrUpdate(_api::TagsApi, response_stream::Channel, tagName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsCreateOrUpdate(_api, tagName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Creates or updates the entire set of tags on a resource or subscription.
This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.
Param: scope::String (required)
Param: api_version::String (required)
Param: parameters::TagsResource (required)
Return: TagsResource
"""
function _swaggerinternal_tagsCreateOrUpdateAtScope(_api::TagsApi, scope::String, api_version::String, parameters; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "PUT", TagsResource, "/{scope}/providers/Microsoft.Resources/tags/default", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "scope", scope)  # 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 tagsCreateOrUpdateAtScope(_api::TagsApi, scope::String, api_version::String, parameters; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsCreateOrUpdateAtScope(_api, scope, api_version, parameters; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsCreateOrUpdateAtScope(_api::TagsApi, response_stream::Channel, scope::String, api_version::String, parameters; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsCreateOrUpdateAtScope(_api, scope, api_version, parameters; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Creates a predefined value for a predefined tag name.
This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters.
Param: tagName::String (required)
Param: tagValue::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: TagValue
"""
function _swaggerinternal_tagsCreateOrUpdateValue(_api::TagsApi, tagName::String, tagValue::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "PUT", TagValue, "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "tagName", tagName)  # type String
    Swagger.set_param(_ctx.path, "tagValue", tagValue)  # 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 tagsCreateOrUpdateValue(_api::TagsApi, tagName::String, tagValue::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsCreateOrUpdateValue(_api, tagName, tagValue, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsCreateOrUpdateValue(_api::TagsApi, response_stream::Channel, tagName::String, tagValue::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsCreateOrUpdateValue(_api, tagName, tagValue, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes a predefined tag name.
This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.
Param: tagName::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_tagsDelete(_api::TagsApi, tagName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/subscriptions/{subscriptionId}/tagNames/{tagName}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "tagName", tagName)  # 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 tagsDelete(_api::TagsApi, tagName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsDelete(_api, tagName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsDelete(_api::TagsApi, response_stream::Channel, tagName::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsDelete(_api, tagName, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes the entire set of tags on a resource or subscription.

Param: scope::String (required)
Param: api_version::String (required)
Return: Nothing
"""
function _swaggerinternal_tagsDeleteAtScope(_api::TagsApi, scope::String, api_version::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/{scope}/providers/Microsoft.Resources/tags/default", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # 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 tagsDeleteAtScope(_api::TagsApi, scope::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsDeleteAtScope(_api, scope, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsDeleteAtScope(_api::TagsApi, response_stream::Channel, scope::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsDeleteAtScope(_api, scope, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Deletes a predefined tag value for a predefined tag name.
This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource.
Param: tagName::String (required)
Param: tagValue::String (required)
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: Nothing
"""
function _swaggerinternal_tagsDeleteValue(_api::TagsApi, tagName::String, tagValue::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "DELETE", Nothing, "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", ["azure_auth"])
    Swagger.set_param(_ctx.path, "tagName", tagName)  # type String
    Swagger.set_param(_ctx.path, "tagValue", tagValue)  # 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 tagsDeleteValue(_api::TagsApi, tagName::String, tagValue::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsDeleteValue(_api, tagName, tagValue, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsDeleteValue(_api::TagsApi, response_stream::Channel, tagName::String, tagValue::String, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsDeleteValue(_api, tagName, tagValue, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Gets the entire set of tags on a resource or subscription.

Param: scope::String (required)
Param: api_version::String (required)
Return: TagsResource
"""
function _swaggerinternal_tagsGetAtScope(_api::TagsApi, scope::String, api_version::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", TagsResource, "/{scope}/providers/Microsoft.Resources/tags/default", ["azure_auth"])
    Swagger.set_param(_ctx.path, "scope", scope)  # 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 tagsGetAtScope(_api::TagsApi, scope::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsGetAtScope(_api, scope, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsGetAtScope(_api::TagsApi, response_stream::Channel, scope::String, api_version::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsGetAtScope(_api, scope, api_version; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Gets a summary of tag usage under the subscription.
This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Param: api_version::String (required)
Param: subscriptionId::String (required)
Return: TagsListResult
"""
function _swaggerinternal_tagsList(_api::TagsApi, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", TagsListResult, "/subscriptions/{subscriptionId}/tagNames", ["azure_auth"])
    Swagger.set_param(_ctx.path, "subscriptionId", subscriptionId)  # type String
    Swagger.set_param(_ctx.query, "api-version", api_version)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json"] : [_mediaType])
    return _ctx
end

function tagsList(_api::TagsApi, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsList(_api, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsList(_api::TagsApi, response_stream::Channel, api_version::String, subscriptionId::String; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsList(_api, api_version, subscriptionId; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

"""
Selectively updates the set of tags on a resource or subscription.
This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
Param: scope::String (required)
Param: api_version::String (required)
Param: parameters::TagsPatchResource (required)
Return: TagsResource
"""
function _swaggerinternal_tagsUpdateAtScope(_api::TagsApi, scope::String, api_version::String, parameters; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "PATCH", TagsResource, "/{scope}/providers/Microsoft.Resources/tags/default", ["azure_auth"], parameters)
    Swagger.set_param(_ctx.path, "scope", scope)  # 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 tagsUpdateAtScope(_api::TagsApi, scope::String, api_version::String, parameters; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsUpdateAtScope(_api, scope, api_version, parameters; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function tagsUpdateAtScope(_api::TagsApi, response_stream::Channel, scope::String, api_version::String, parameters; _mediaType=nothing)
    _ctx = _swaggerinternal_tagsUpdateAtScope(_api, scope, api_version, parameters; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

export tagsCreateOrUpdate, tagsCreateOrUpdateAtScope, tagsCreateOrUpdateValue, tagsDelete, tagsDeleteAtScope, tagsDeleteValue, tagsGetAtScope, tagsList, tagsUpdateAtScope
