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

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

function _swaggerinternal_adminAppsApprove(_api::AdminApi; app_id=nothing, request_id=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.apps.approve", ["slackAuth"])
    Swagger.set_param(_ctx.form, "app_id", app_id)  # type String
    Swagger.set_param(_ctx.form, "request_id", request_id)  # type String
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Approve an app for installation on a workspace.
Param: app_id::String
Param: request_id::String
Param: team_id::String
Return: Dict{String, Any}
"""
function adminAppsApprove(_api::AdminApi; app_id=nothing, request_id=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsApprove(_api; app_id=app_id, request_id=request_id, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminAppsApprove(_api::AdminApi, response_stream::Channel; app_id=nothing, request_id=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsApprove(_api; app_id=app_id, request_id=request_id, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminAppsApprovedList(_api::AdminApi; limit=nothing, cursor=nothing, team_id=nothing, enterprise_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.apps.approved.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "enterprise_id", enterprise_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List approved apps for an org or workspace.
Param: limit::Int32
Param: cursor::String
Param: team_id::String
Param: enterprise_id::String
Return: Dict{String, Any}
"""
function adminAppsApprovedList(_api::AdminApi; limit=nothing, cursor=nothing, team_id=nothing, enterprise_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsApprovedList(_api; limit=limit, cursor=cursor, team_id=team_id, enterprise_id=enterprise_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminAppsApprovedList(_api::AdminApi, response_stream::Channel; limit=nothing, cursor=nothing, team_id=nothing, enterprise_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsApprovedList(_api; limit=limit, cursor=cursor, team_id=team_id, enterprise_id=enterprise_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminAppsRequestsList(_api::AdminApi; limit=nothing, cursor=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.apps.requests.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List app requests for a team/workspace.
Param: limit::Int32
Param: cursor::String
Param: team_id::String
Return: Dict{String, Any}
"""
function adminAppsRequestsList(_api::AdminApi; limit=nothing, cursor=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsRequestsList(_api; limit=limit, cursor=cursor, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminAppsRequestsList(_api::AdminApi, response_stream::Channel; limit=nothing, cursor=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsRequestsList(_api; limit=limit, cursor=cursor, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminAppsRestrict(_api::AdminApi; app_id=nothing, request_id=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.apps.restrict", ["slackAuth"])
    Swagger.set_param(_ctx.form, "app_id", app_id)  # type String
    Swagger.set_param(_ctx.form, "request_id", request_id)  # type String
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Restrict an app for installation on a workspace.
Param: app_id::String
Param: request_id::String
Param: team_id::String
Return: Dict{String, Any}
"""
function adminAppsRestrict(_api::AdminApi; app_id=nothing, request_id=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsRestrict(_api; app_id=app_id, request_id=request_id, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminAppsRestrict(_api::AdminApi, response_stream::Channel; app_id=nothing, request_id=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsRestrict(_api; app_id=app_id, request_id=request_id, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminAppsRestrictedList(_api::AdminApi; limit=nothing, cursor=nothing, team_id=nothing, enterprise_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.apps.restricted.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "enterprise_id", enterprise_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List restricted apps for an org or workspace.
Param: limit::Int32
Param: cursor::String
Param: team_id::String
Param: enterprise_id::String
Return: Dict{String, Any}
"""
function adminAppsRestrictedList(_api::AdminApi; limit=nothing, cursor=nothing, team_id=nothing, enterprise_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsRestrictedList(_api; limit=limit, cursor=cursor, team_id=team_id, enterprise_id=enterprise_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminAppsRestrictedList(_api::AdminApi, response_stream::Channel; limit=nothing, cursor=nothing, team_id=nothing, enterprise_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminAppsRestrictedList(_api; limit=limit, cursor=cursor, team_id=team_id, enterprise_id=enterprise_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsArchive(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.archive", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Archive a public or private channel.
Param: channel_id::String (required)
Return: Dict{String, Any}
"""
function adminConversationsArchive(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsArchive(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsArchive(_api::AdminApi, response_stream::Channel, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsArchive(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsConvertToPrivate(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.convertToPrivate", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Convert a public channel to a private channel.
Param: channel_id::String (required)
Return: Dict{String, Any}
"""
function adminConversationsConvertToPrivate(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsConvertToPrivate(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsConvertToPrivate(_api::AdminApi, response_stream::Channel, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsConvertToPrivate(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsCreate(_api::AdminApi, name::String, is_private::Bool; description=nothing, org_wide=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.create", ["slackAuth"])
    Swagger.set_param(_ctx.form, "name", name)  # type String
    Swagger.set_param(_ctx.form, "description", description)  # type String
    Swagger.set_param(_ctx.form, "is_private", is_private)  # type Bool
    Swagger.set_param(_ctx.form, "org_wide", org_wide)  # type Bool
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Create a public or private channel-based conversation.
Param: name::String (required)
Param: is_private::Bool (required)
Param: description::String
Param: org_wide::Bool
Param: team_id::String
Return: Dict{String, Any}
"""
function adminConversationsCreate(_api::AdminApi, name::String, is_private::Bool; description=nothing, org_wide=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsCreate(_api, name, is_private; description=description, org_wide=org_wide, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsCreate(_api::AdminApi, response_stream::Channel, name::String, is_private::Bool; description=nothing, org_wide=nothing, team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsCreate(_api, name, is_private; description=description, org_wide=org_wide, team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsDelete(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.delete", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Delete a public or private channel.
Param: channel_id::String (required)
Return: Dict{String, Any}
"""
function adminConversationsDelete(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsDelete(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsDelete(_api::AdminApi, response_stream::Channel, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsDelete(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsDisconnectShared(_api::AdminApi, channel_id::String; leaving_team_ids=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.disconnectShared", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_param(_ctx.form, "leaving_team_ids", leaving_team_ids)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Disconnect a connected channel from one or more workspaces.
Param: channel_id::String (required)
Param: leaving_team_ids::String
Return: Dict{String, Any}
"""
function adminConversationsDisconnectShared(_api::AdminApi, channel_id::String; leaving_team_ids=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsDisconnectShared(_api, channel_id; leaving_team_ids=leaving_team_ids, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsDisconnectShared(_api::AdminApi, response_stream::Channel, channel_id::String; leaving_team_ids=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsDisconnectShared(_api, channel_id; leaving_team_ids=leaving_team_ids, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsEkmListOriginalConnectedChannelInfo(_api::AdminApi; channel_ids=nothing, team_ids=nothing, limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.conversations.ekm.listOriginalConnectedChannelInfo", ["slackAuth"])
    Swagger.set_param(_ctx.query, "channel_ids", channel_ids)  # type String
    Swagger.set_param(_ctx.query, "team_ids", team_ids)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.
Param: channel_ids::String
Param: team_ids::String
Param: limit::Int32
Param: cursor::String
Return: Dict{String, Any}
"""
function adminConversationsEkmListOriginalConnectedChannelInfo(_api::AdminApi; channel_ids=nothing, team_ids=nothing, limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsEkmListOriginalConnectedChannelInfo(_api; channel_ids=channel_ids, team_ids=team_ids, limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsEkmListOriginalConnectedChannelInfo(_api::AdminApi, response_stream::Channel; channel_ids=nothing, team_ids=nothing, limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsEkmListOriginalConnectedChannelInfo(_api; channel_ids=channel_ids, team_ids=team_ids, limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsGetConversationPrefs(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.conversations.getConversationPrefs", ["slackAuth"])
    Swagger.set_param(_ctx.query, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Get conversation preferences for a public or private channel.
Param: channel_id::String (required)
Return: Dict{String, Any}
"""
function adminConversationsGetConversationPrefs(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsGetConversationPrefs(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsGetConversationPrefs(_api::AdminApi, response_stream::Channel, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsGetConversationPrefs(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsGetTeams(_api::AdminApi, channel_id::String; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.conversations.getTeams", ["slackAuth"])
    Swagger.set_param(_ctx.query, "channel_id", channel_id)  # type String
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Get all the workspaces a given public or private channel is connected to within this Enterprise org.
Param: channel_id::String (required)
Param: cursor::String
Param: limit::Int32
Return: Dict{String, Any}
"""
function adminConversationsGetTeams(_api::AdminApi, channel_id::String; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsGetTeams(_api, channel_id; cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsGetTeams(_api::AdminApi, response_stream::Channel, channel_id::String; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsGetTeams(_api, channel_id; cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsInvite(_api::AdminApi, user_ids::String, channel_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.invite", ["slackAuth"])
    Swagger.set_param(_ctx.form, "user_ids", user_ids)  # type String
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Invite a user to a public or private channel.
Param: user_ids::String (required)
Param: channel_id::String (required)
Return: Dict{String, Any}
"""
function adminConversationsInvite(_api::AdminApi, user_ids::String, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsInvite(_api, user_ids, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsInvite(_api::AdminApi, response_stream::Channel, user_ids::String, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsInvite(_api, user_ids, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsRename(_api::AdminApi, channel_id::String, name::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.rename", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_param(_ctx.form, "name", name)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Rename a public or private channel.
Param: channel_id::String (required)
Param: name::String (required)
Return: Dict{String, Any}
"""
function adminConversationsRename(_api::AdminApi, channel_id::String, name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRename(_api, channel_id, name; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsRename(_api::AdminApi, response_stream::Channel, channel_id::String, name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRename(_api, channel_id, name; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsRestrictAccessAddGroup(_api::AdminApi, group_id::String, channel_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.restrictAccess.addGroup", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "group_id", group_id)  # type String
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Add an allowlist of IDP groups for accessing a channel
Param: group_id::String (required)
Param: channel_id::String (required)
Param: team_id::String
Return: Dict{String, Any}
"""
function adminConversationsRestrictAccessAddGroup(_api::AdminApi, group_id::String, channel_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRestrictAccessAddGroup(_api, group_id, channel_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsRestrictAccessAddGroup(_api::AdminApi, response_stream::Channel, group_id::String, channel_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRestrictAccessAddGroup(_api, group_id, channel_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsRestrictAccessListGroups(_api::AdminApi, channel_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.conversations.restrictAccess.listGroups", ["slackAuth"])
    Swagger.set_param(_ctx.query, "channel_id", channel_id)  # type String
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List all IDP Groups linked to a channel
Param: channel_id::String (required)
Param: team_id::String
Return: Dict{String, Any}
"""
function adminConversationsRestrictAccessListGroups(_api::AdminApi, channel_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRestrictAccessListGroups(_api, channel_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsRestrictAccessListGroups(_api::AdminApi, response_stream::Channel, channel_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRestrictAccessListGroups(_api, channel_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsRestrictAccessRemoveGroup(_api::AdminApi, team_id::String, group_id::String, channel_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.restrictAccess.removeGroup", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "group_id", group_id)  # type String
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Remove a linked IDP group linked from a private channel
Param: team_id::String (required)
Param: group_id::String (required)
Param: channel_id::String (required)
Return: Dict{String, Any}
"""
function adminConversationsRestrictAccessRemoveGroup(_api::AdminApi, team_id::String, group_id::String, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRestrictAccessRemoveGroup(_api, team_id, group_id, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsRestrictAccessRemoveGroup(_api::AdminApi, response_stream::Channel, team_id::String, group_id::String, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsRestrictAccessRemoveGroup(_api, team_id, group_id, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsSearch(_api::AdminApi; team_ids=nothing, query=nothing, limit=nothing, cursor=nothing, search_channel_types=nothing, sort=nothing, sort_dir=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.conversations.search", ["slackAuth"])
    Swagger.set_param(_ctx.query, "team_ids", team_ids)  # type String
    Swagger.set_param(_ctx.query, "query", query)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "search_channel_types", search_channel_types)  # type String
    Swagger.set_param(_ctx.query, "sort", sort)  # type String
    Swagger.set_param(_ctx.query, "sort_dir", sort_dir)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Search for public or private channels in an Enterprise organization.
Param: team_ids::String
Param: query::String
Param: limit::Int32
Param: cursor::String
Param: search_channel_types::String
Param: sort::String
Param: sort_dir::String
Return: Dict{String, Any}
"""
function adminConversationsSearch(_api::AdminApi; team_ids=nothing, query=nothing, limit=nothing, cursor=nothing, search_channel_types=nothing, sort=nothing, sort_dir=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsSearch(_api; team_ids=team_ids, query=query, limit=limit, cursor=cursor, search_channel_types=search_channel_types, sort=sort, sort_dir=sort_dir, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsSearch(_api::AdminApi, response_stream::Channel; team_ids=nothing, query=nothing, limit=nothing, cursor=nothing, search_channel_types=nothing, sort=nothing, sort_dir=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsSearch(_api; team_ids=team_ids, query=query, limit=limit, cursor=cursor, search_channel_types=search_channel_types, sort=sort, sort_dir=sort_dir, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsSetConversationPrefs(_api::AdminApi, channel_id::String, prefs::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.setConversationPrefs", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_param(_ctx.form, "prefs", prefs)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set the posting permissions for a public or private channel.
Param: channel_id::String (required)
Param: prefs::String (required)
Return: Dict{String, Any}
"""
function adminConversationsSetConversationPrefs(_api::AdminApi, channel_id::String, prefs::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsSetConversationPrefs(_api, channel_id, prefs; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsSetConversationPrefs(_api::AdminApi, response_stream::Channel, channel_id::String, prefs::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsSetConversationPrefs(_api, channel_id, prefs; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsSetTeams(_api::AdminApi, channel_id::String; team_id=nothing, target_team_ids=nothing, org_channel=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.setTeams", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "target_team_ids", target_team_ids)  # type String
    Swagger.set_param(_ctx.form, "org_channel", org_channel)  # type Bool
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set the workspaces in an Enterprise grid org that connect to a public or private channel.
Param: channel_id::String (required)
Param: team_id::String
Param: target_team_ids::String
Param: org_channel::Bool
Return: Dict{String, Any}
"""
function adminConversationsSetTeams(_api::AdminApi, channel_id::String; team_id=nothing, target_team_ids=nothing, org_channel=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsSetTeams(_api, channel_id; team_id=team_id, target_team_ids=target_team_ids, org_channel=org_channel, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsSetTeams(_api::AdminApi, response_stream::Channel, channel_id::String; team_id=nothing, target_team_ids=nothing, org_channel=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsSetTeams(_api, channel_id; team_id=team_id, target_team_ids=target_team_ids, org_channel=org_channel, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminConversationsUnarchive(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.conversations.unarchive", ["slackAuth"])
    Swagger.set_param(_ctx.form, "channel_id", channel_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Unarchive a public or private channel.
Param: channel_id::String (required)
Return: Dict{String, Any}
"""
function adminConversationsUnarchive(_api::AdminApi, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsUnarchive(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminConversationsUnarchive(_api::AdminApi, response_stream::Channel, channel_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminConversationsUnarchive(_api, channel_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminEmojiAdd(_api::AdminApi, name::String, url::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.emoji.add", ["slackAuth"])
    Swagger.set_param(_ctx.form, "name", name)  # type String
    Swagger.set_param(_ctx.form, "url", url)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Add an emoji.
Param: name::String (required)
Param: url::String (required)
Return: Dict{String, Any}
"""
function adminEmojiAdd(_api::AdminApi, name::String, url::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiAdd(_api, name, url; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminEmojiAdd(_api::AdminApi, response_stream::Channel, name::String, url::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiAdd(_api, name, url; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminEmojiAddAlias(_api::AdminApi, name::String, alias_for::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.emoji.addAlias", ["slackAuth"])
    Swagger.set_param(_ctx.form, "name", name)  # type String
    Swagger.set_param(_ctx.form, "alias_for", alias_for)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Add an emoji alias.
Param: name::String (required)
Param: alias_for::String (required)
Return: Dict{String, Any}
"""
function adminEmojiAddAlias(_api::AdminApi, name::String, alias_for::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiAddAlias(_api, name, alias_for; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminEmojiAddAlias(_api::AdminApi, response_stream::Channel, name::String, alias_for::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiAddAlias(_api, name, alias_for; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminEmojiList(_api::AdminApi; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.emoji.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List emoji for an Enterprise Grid organization.
Param: cursor::String
Param: limit::Int32
Return: Dict{String, Any}
"""
function adminEmojiList(_api::AdminApi; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiList(_api; cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminEmojiList(_api::AdminApi, response_stream::Channel; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiList(_api; cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminEmojiRemove(_api::AdminApi, name::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.emoji.remove", ["slackAuth"])
    Swagger.set_param(_ctx.form, "name", name)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Remove an emoji across an Enterprise Grid organization
Param: name::String (required)
Return: Dict{String, Any}
"""
function adminEmojiRemove(_api::AdminApi, name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiRemove(_api, name; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminEmojiRemove(_api::AdminApi, response_stream::Channel, name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiRemove(_api, name; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminEmojiRename(_api::AdminApi, name::String, new_name::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.emoji.rename", ["slackAuth"])
    Swagger.set_param(_ctx.form, "name", name)  # type String
    Swagger.set_param(_ctx.form, "new_name", new_name)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Rename an emoji.
Param: name::String (required)
Param: new_name::String (required)
Return: Dict{String, Any}
"""
function adminEmojiRename(_api::AdminApi, name::String, new_name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiRename(_api, name, new_name; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminEmojiRename(_api::AdminApi, response_stream::Channel, name::String, new_name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminEmojiRename(_api, name, new_name; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminInviteRequestsApprove(_api::AdminApi, invite_request_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.inviteRequests.approve", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "invite_request_id", invite_request_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Approve a workspace invite request.
Param: invite_request_id::String (required)
Param: team_id::String
Return: Dict{String, Any}
"""
function adminInviteRequestsApprove(_api::AdminApi, invite_request_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsApprove(_api, invite_request_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminInviteRequestsApprove(_api::AdminApi, response_stream::Channel, invite_request_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsApprove(_api, invite_request_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminInviteRequestsApprovedList(_api::AdminApi; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.inviteRequests.approved.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

List all approved workspace invite requests.
Param: team_id::String
Param: cursor::String
Param: limit::Int32
Return: Dict{String, Any}
"""
function adminInviteRequestsApprovedList(_api::AdminApi; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsApprovedList(_api; team_id=team_id, cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminInviteRequestsApprovedList(_api::AdminApi, response_stream::Channel; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsApprovedList(_api; team_id=team_id, cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminInviteRequestsDeniedList(_api::AdminApi; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.inviteRequests.denied.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

List all denied workspace invite requests.
Param: team_id::String
Param: cursor::String
Param: limit::Int32
Return: Dict{String, Any}
"""
function adminInviteRequestsDeniedList(_api::AdminApi; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsDeniedList(_api; team_id=team_id, cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminInviteRequestsDeniedList(_api::AdminApi, response_stream::Channel; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsDeniedList(_api; team_id=team_id, cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminInviteRequestsDeny(_api::AdminApi, invite_request_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.inviteRequests.deny", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "invite_request_id", invite_request_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Deny a workspace invite request.
Param: invite_request_id::String (required)
Param: team_id::String
Return: Dict{String, Any}
"""
function adminInviteRequestsDeny(_api::AdminApi, invite_request_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsDeny(_api, invite_request_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminInviteRequestsDeny(_api::AdminApi, response_stream::Channel, invite_request_id::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsDeny(_api, invite_request_id; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminInviteRequestsList(_api::AdminApi; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.inviteRequests.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

List all pending workspace invite requests.
Param: team_id::String
Param: cursor::String
Param: limit::Int32
Return: Dict{String, Any}
"""
function adminInviteRequestsList(_api::AdminApi; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsList(_api; team_id=team_id, cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminInviteRequestsList(_api::AdminApi, response_stream::Channel; team_id=nothing, cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminInviteRequestsList(_api; team_id=team_id, cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsAdminsList(_api::AdminApi, team_id::String; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.teams.admins.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List all of the admins on a given workspace.
Param: team_id::String (required)
Param: limit::Int32
Param: cursor::String
Return: Dict{String, Any}
"""
function adminTeamsAdminsList(_api::AdminApi, team_id::String; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsAdminsList(_api, team_id; limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsAdminsList(_api::AdminApi, response_stream::Channel, team_id::String; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsAdminsList(_api, team_id; limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsCreate(_api::AdminApi, team_domain::String, team_name::String; team_description=nothing, team_discoverability=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.teams.create", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_domain", team_domain)  # type String
    Swagger.set_param(_ctx.form, "team_name", team_name)  # type String
    Swagger.set_param(_ctx.form, "team_description", team_description)  # type String
    Swagger.set_param(_ctx.form, "team_discoverability", team_discoverability)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Create an Enterprise team.
Param: team_domain::String (required)
Param: team_name::String (required)
Param: team_description::String
Param: team_discoverability::String
Return: Dict{String, Any}
"""
function adminTeamsCreate(_api::AdminApi, team_domain::String, team_name::String; team_description=nothing, team_discoverability=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsCreate(_api, team_domain, team_name; team_description=team_description, team_discoverability=team_discoverability, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsCreate(_api::AdminApi, response_stream::Channel, team_domain::String, team_name::String; team_description=nothing, team_discoverability=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsCreate(_api, team_domain, team_name; team_description=team_description, team_discoverability=team_discoverability, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsList(_api::AdminApi; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.teams.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

List all teams on an Enterprise organization
Param: limit::Int32
Param: cursor::String
Return: Dict{String, Any}
"""
function adminTeamsList(_api::AdminApi; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsList(_api; limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsList(_api::AdminApi, response_stream::Channel; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsList(_api; limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsOwnersList(_api::AdminApi, team_id::String; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.teams.owners.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

List all of the owners on a given workspace.
Param: team_id::String (required)
Param: limit::Int32
Param: cursor::String
Return: Dict{String, Any}
"""
function adminTeamsOwnersList(_api::AdminApi, team_id::String; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsOwnersList(_api, team_id; limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsOwnersList(_api::AdminApi, response_stream::Channel, team_id::String; limit=nothing, cursor=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsOwnersList(_api, team_id; limit=limit, cursor=cursor, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsSettingsInfo(_api::AdminApi, team_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.teams.settings.info", ["slackAuth"])
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Fetch information about settings in a workspace
Param: team_id::String (required)
Return: Dict{String, Any}
"""
function adminTeamsSettingsInfo(_api::AdminApi, team_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsInfo(_api, team_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsSettingsInfo(_api::AdminApi, response_stream::Channel, team_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsInfo(_api, team_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsSettingsSetDefaultChannels(_api::AdminApi, team_id::String, channel_ids::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.teams.settings.setDefaultChannels", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "channel_ids", channel_ids)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Set the default channels of a workspace.
Param: team_id::String (required)
Param: channel_ids::String (required)
Return: Dict{String, Any}
"""
function adminTeamsSettingsSetDefaultChannels(_api::AdminApi, team_id::String, channel_ids::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetDefaultChannels(_api, team_id, channel_ids; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsSettingsSetDefaultChannels(_api::AdminApi, response_stream::Channel, team_id::String, channel_ids::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetDefaultChannels(_api, team_id, channel_ids; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsSettingsSetDescription(_api::AdminApi, team_id::String, description::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.teams.settings.setDescription", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "description", description)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set the description of a given workspace.
Param: team_id::String (required)
Param: description::String (required)
Return: Dict{String, Any}
"""
function adminTeamsSettingsSetDescription(_api::AdminApi, team_id::String, description::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetDescription(_api, team_id, description; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsSettingsSetDescription(_api::AdminApi, response_stream::Channel, team_id::String, description::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetDescription(_api, team_id, description; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsSettingsSetDiscoverability(_api::AdminApi, team_id::String, discoverability::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.teams.settings.setDiscoverability", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "discoverability", discoverability)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

An API method that allows admins to set the discoverability of a given workspace
Param: team_id::String (required)
Param: discoverability::String (required)
Return: Dict{String, Any}
"""
function adminTeamsSettingsSetDiscoverability(_api::AdminApi, team_id::String, discoverability::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetDiscoverability(_api, team_id, discoverability; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsSettingsSetDiscoverability(_api::AdminApi, response_stream::Channel, team_id::String, discoverability::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetDiscoverability(_api, team_id, discoverability; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsSettingsSetIcon(_api::AdminApi, image_url::String, team_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.teams.settings.setIcon", ["slackAuth"])
    Swagger.set_param(_ctx.form, "image_url", image_url)  # type String
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded"] : [_mediaType])
    return _ctx
end

"""

Sets the icon of a workspace.
Param: image_url::String (required)
Param: team_id::String (required)
Return: Dict{String, Any}
"""
function adminTeamsSettingsSetIcon(_api::AdminApi, image_url::String, team_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetIcon(_api, image_url, team_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsSettingsSetIcon(_api::AdminApi, response_stream::Channel, image_url::String, team_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetIcon(_api, image_url, team_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminTeamsSettingsSetName(_api::AdminApi, team_id::String, name::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.teams.settings.setName", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "name", name)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set the name of a given workspace.
Param: team_id::String (required)
Param: name::String (required)
Return: Dict{String, Any}
"""
function adminTeamsSettingsSetName(_api::AdminApi, team_id::String, name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetName(_api, team_id, name; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminTeamsSettingsSetName(_api::AdminApi, response_stream::Channel, team_id::String, name::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminTeamsSettingsSetName(_api, team_id, name; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsergroupsAddChannels(_api::AdminApi, usergroup_id::String, channel_ids::String; team_id=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.usergroups.addChannels", ["slackAuth"])
    Swagger.set_param(_ctx.form, "usergroup_id", usergroup_id)  # type String
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "channel_ids", channel_ids)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Add one or more default channels to an IDP group.
Param: usergroup_id::String (required)
Param: channel_ids::String (required)
Param: team_id::String
Return: Dict{String, Any}
"""
function adminUsergroupsAddChannels(_api::AdminApi, usergroup_id::String, channel_ids::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsAddChannels(_api, usergroup_id, channel_ids; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsergroupsAddChannels(_api::AdminApi, response_stream::Channel, usergroup_id::String, channel_ids::String; team_id=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsAddChannels(_api, usergroup_id, channel_ids; team_id=team_id, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsergroupsAddTeams(_api::AdminApi, usergroup_id::String, team_ids::String; auto_provision=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.usergroups.addTeams", ["slackAuth"])
    Swagger.set_param(_ctx.form, "usergroup_id", usergroup_id)  # type String
    Swagger.set_param(_ctx.form, "team_ids", team_ids)  # type String
    Swagger.set_param(_ctx.form, "auto_provision", auto_provision)  # type Bool
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Associate one or more default workspaces with an organization-wide IDP group.
Param: usergroup_id::String (required)
Param: team_ids::String (required)
Param: auto_provision::Bool
Return: Dict{String, Any}
"""
function adminUsergroupsAddTeams(_api::AdminApi, usergroup_id::String, team_ids::String; auto_provision=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsAddTeams(_api, usergroup_id, team_ids; auto_provision=auto_provision, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsergroupsAddTeams(_api::AdminApi, response_stream::Channel, usergroup_id::String, team_ids::String; auto_provision=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsAddTeams(_api, usergroup_id, team_ids; auto_provision=auto_provision, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsergroupsListChannels(_api::AdminApi, usergroup_id::String; team_id=nothing, include_num_members=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.usergroups.listChannels", ["slackAuth"])
    Swagger.set_param(_ctx.query, "usergroup_id", usergroup_id)  # type String
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "include_num_members", include_num_members)  # type Bool
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

List the channels linked to an org-level IDP group (user group).
Param: usergroup_id::String (required)
Param: team_id::String
Param: include_num_members::Bool
Return: Dict{String, Any}
"""
function adminUsergroupsListChannels(_api::AdminApi, usergroup_id::String; team_id=nothing, include_num_members=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsListChannels(_api, usergroup_id; team_id=team_id, include_num_members=include_num_members, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsergroupsListChannels(_api::AdminApi, response_stream::Channel, usergroup_id::String; team_id=nothing, include_num_members=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsListChannels(_api, usergroup_id; team_id=team_id, include_num_members=include_num_members, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsergroupsRemoveChannels(_api::AdminApi, usergroup_id::String, channel_ids::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.usergroups.removeChannels", ["slackAuth"])
    Swagger.set_param(_ctx.form, "usergroup_id", usergroup_id)  # type String
    Swagger.set_param(_ctx.form, "channel_ids", channel_ids)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Remove one or more default channels from an org-level IDP group (user group).
Param: usergroup_id::String (required)
Param: channel_ids::String (required)
Return: Dict{String, Any}
"""
function adminUsergroupsRemoveChannels(_api::AdminApi, usergroup_id::String, channel_ids::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsRemoveChannels(_api, usergroup_id, channel_ids; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsergroupsRemoveChannels(_api::AdminApi, response_stream::Channel, usergroup_id::String, channel_ids::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsergroupsRemoveChannels(_api, usergroup_id, channel_ids; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersAssign(_api::AdminApi, team_id::String, user_id::String; is_restricted=nothing, is_ultra_restricted=nothing, channel_ids=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.assign", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "user_id", user_id)  # type String
    Swagger.set_param(_ctx.form, "is_restricted", is_restricted)  # type Bool
    Swagger.set_param(_ctx.form, "is_ultra_restricted", is_ultra_restricted)  # type Bool
    Swagger.set_param(_ctx.form, "channel_ids", channel_ids)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Add an Enterprise user to a workspace.
Param: team_id::String (required)
Param: user_id::String (required)
Param: is_restricted::Bool
Param: is_ultra_restricted::Bool
Param: channel_ids::String
Return: Dict{String, Any}
"""
function adminUsersAssign(_api::AdminApi, team_id::String, user_id::String; is_restricted=nothing, is_ultra_restricted=nothing, channel_ids=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersAssign(_api, team_id, user_id; is_restricted=is_restricted, is_ultra_restricted=is_ultra_restricted, channel_ids=channel_ids, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersAssign(_api::AdminApi, response_stream::Channel, team_id::String, user_id::String; is_restricted=nothing, is_ultra_restricted=nothing, channel_ids=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersAssign(_api, team_id, user_id; is_restricted=is_restricted, is_ultra_restricted=is_ultra_restricted, channel_ids=channel_ids, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersInvite(_api::AdminApi, team_id::String, email::String, channel_ids::String; custom_message=nothing, real_name=nothing, resend=nothing, is_restricted=nothing, is_ultra_restricted=nothing, guest_expiration_ts=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.invite", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "email", email)  # type String
    Swagger.set_param(_ctx.form, "channel_ids", channel_ids)  # type String
    Swagger.set_param(_ctx.form, "custom_message", custom_message)  # type String
    Swagger.set_param(_ctx.form, "real_name", real_name)  # type String
    Swagger.set_param(_ctx.form, "resend", resend)  # type Bool
    Swagger.set_param(_ctx.form, "is_restricted", is_restricted)  # type Bool
    Swagger.set_param(_ctx.form, "is_ultra_restricted", is_ultra_restricted)  # type Bool
    Swagger.set_param(_ctx.form, "guest_expiration_ts", guest_expiration_ts)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Invite a user to a workspace.
Param: team_id::String (required)
Param: email::String (required)
Param: channel_ids::String (required)
Param: custom_message::String
Param: real_name::String
Param: resend::Bool
Param: is_restricted::Bool
Param: is_ultra_restricted::Bool
Param: guest_expiration_ts::String
Return: Dict{String, Any}
"""
function adminUsersInvite(_api::AdminApi, team_id::String, email::String, channel_ids::String; custom_message=nothing, real_name=nothing, resend=nothing, is_restricted=nothing, is_ultra_restricted=nothing, guest_expiration_ts=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersInvite(_api, team_id, email, channel_ids; custom_message=custom_message, real_name=real_name, resend=resend, is_restricted=is_restricted, is_ultra_restricted=is_ultra_restricted, guest_expiration_ts=guest_expiration_ts, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersInvite(_api::AdminApi, response_stream::Channel, team_id::String, email::String, channel_ids::String; custom_message=nothing, real_name=nothing, resend=nothing, is_restricted=nothing, is_ultra_restricted=nothing, guest_expiration_ts=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersInvite(_api, team_id, email, channel_ids; custom_message=custom_message, real_name=real_name, resend=resend, is_restricted=is_restricted, is_ultra_restricted=is_ultra_restricted, guest_expiration_ts=guest_expiration_ts, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersList(_api::AdminApi, team_id::String; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "GET", Dict{String, Any}, "/admin.users.list", ["slackAuth"])
    Swagger.set_param(_ctx.query, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.query, "cursor", cursor)  # type String
    Swagger.set_param(_ctx.query, "limit", limit)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

List users on a workspace
Param: team_id::String (required)
Param: cursor::String
Param: limit::Int32
Return: Dict{String, Any}
"""
function adminUsersList(_api::AdminApi, team_id::String; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersList(_api, team_id; cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersList(_api::AdminApi, response_stream::Channel, team_id::String; cursor=nothing, limit=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersList(_api, team_id; cursor=cursor, limit=limit, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersRemove(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.remove", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "user_id", user_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Remove a user from a workspace.
Param: team_id::String (required)
Param: user_id::String (required)
Return: Dict{String, Any}
"""
function adminUsersRemove(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersRemove(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersRemove(_api::AdminApi, response_stream::Channel, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersRemove(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersSessionInvalidate(_api::AdminApi, team_id::String, session_id::Int32; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.session.invalidate", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "session_id", session_id)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Invalidate a single session for a user by session_id
Param: team_id::String (required)
Param: session_id::Int32 (required)
Return: Dict{String, Any}
"""
function adminUsersSessionInvalidate(_api::AdminApi, team_id::String, session_id::Int32; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSessionInvalidate(_api, team_id, session_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersSessionInvalidate(_api::AdminApi, response_stream::Channel, team_id::String, session_id::Int32; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSessionInvalidate(_api, team_id, session_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersSessionReset(_api::AdminApi, user_id::String; mobile_only=nothing, web_only=nothing, _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.session.reset", ["slackAuth"])
    Swagger.set_param(_ctx.form, "user_id", user_id)  # type String
    Swagger.set_param(_ctx.form, "mobile_only", mobile_only)  # type Bool
    Swagger.set_param(_ctx.form, "web_only", web_only)  # type Bool
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Wipes all valid sessions on all devices for a given user
Param: user_id::String (required)
Param: mobile_only::Bool
Param: web_only::Bool
Return: Dict{String, Any}
"""
function adminUsersSessionReset(_api::AdminApi, user_id::String; mobile_only=nothing, web_only=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSessionReset(_api, user_id; mobile_only=mobile_only, web_only=web_only, _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersSessionReset(_api::AdminApi, response_stream::Channel, user_id::String; mobile_only=nothing, web_only=nothing, _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSessionReset(_api, user_id; mobile_only=mobile_only, web_only=web_only, _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersSetAdmin(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.setAdmin", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "user_id", user_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set an existing guest, regular user, or owner to be an admin user.
Param: team_id::String (required)
Param: user_id::String (required)
Return: Dict{String, Any}
"""
function adminUsersSetAdmin(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetAdmin(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersSetAdmin(_api::AdminApi, response_stream::Channel, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetAdmin(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersSetExpiration(_api::AdminApi, team_id::String, user_id::String, expiration_ts::Int32; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.setExpiration", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "user_id", user_id)  # type String
    Swagger.set_param(_ctx.form, "expiration_ts", expiration_ts)  # type Int32
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set an expiration for a guest user
Param: team_id::String (required)
Param: user_id::String (required)
Param: expiration_ts::Int32 (required)
Return: Dict{String, Any}
"""
function adminUsersSetExpiration(_api::AdminApi, team_id::String, user_id::String, expiration_ts::Int32; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetExpiration(_api, team_id, user_id, expiration_ts; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersSetExpiration(_api::AdminApi, response_stream::Channel, team_id::String, user_id::String, expiration_ts::Int32; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetExpiration(_api, team_id, user_id, expiration_ts; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersSetOwner(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.setOwner", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "user_id", user_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set an existing guest, regular user, or admin user to be a workspace owner.
Param: team_id::String (required)
Param: user_id::String (required)
Return: Dict{String, Any}
"""
function adminUsersSetOwner(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetOwner(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersSetOwner(_api::AdminApi, response_stream::Channel, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetOwner(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

function _swaggerinternal_adminUsersSetRegular(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = Swagger.Ctx(_api.client, "POST", Dict{String, Any}, "/admin.users.setRegular", ["slackAuth"])
    Swagger.set_param(_ctx.form, "team_id", team_id)  # type String
    Swagger.set_param(_ctx.form, "user_id", user_id)  # type String
    Swagger.set_header_accept(_ctx, ["application/json"])
    Swagger.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/x-www-form-urlencoded", "application/json"] : [_mediaType])
    return _ctx
end

"""

Set an existing guest user, admin user, or owner to be a regular user.
Param: team_id::String (required)
Param: user_id::String (required)
Return: Dict{String, Any}
"""
function adminUsersSetRegular(_api::AdminApi, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetRegular(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx)
end

function adminUsersSetRegular(_api::AdminApi, response_stream::Channel, team_id::String, user_id::String; _mediaType=nothing)
    _ctx = _swaggerinternal_adminUsersSetRegular(_api, team_id, user_id; _mediaType=_mediaType)
    Swagger.exec(_ctx, response_stream)
end

export adminAppsApprove, adminAppsApprovedList, adminAppsRequestsList, adminAppsRestrict, adminAppsRestrictedList, adminConversationsArchive, adminConversationsConvertToPrivate, adminConversationsCreate, adminConversationsDelete, adminConversationsDisconnectShared, adminConversationsEkmListOriginalConnectedChannelInfo, adminConversationsGetConversationPrefs, adminConversationsGetTeams, adminConversationsInvite, adminConversationsRename, adminConversationsRestrictAccessAddGroup, adminConversationsRestrictAccessListGroups, adminConversationsRestrictAccessRemoveGroup, adminConversationsSearch, adminConversationsSetConversationPrefs, adminConversationsSetTeams, adminConversationsUnarchive, adminEmojiAdd, adminEmojiAddAlias, adminEmojiList, adminEmojiRemove, adminEmojiRename, adminInviteRequestsApprove, adminInviteRequestsApprovedList, adminInviteRequestsDeniedList, adminInviteRequestsDeny, adminInviteRequestsList, adminTeamsAdminsList, adminTeamsCreate, adminTeamsList, adminTeamsOwnersList, adminTeamsSettingsInfo, adminTeamsSettingsSetDefaultChannels, adminTeamsSettingsSetDescription, adminTeamsSettingsSetDiscoverability, adminTeamsSettingsSetIcon, adminTeamsSettingsSetName, adminUsergroupsAddChannels, adminUsergroupsAddTeams, adminUsergroupsListChannels, adminUsergroupsRemoveChannels, adminUsersAssign, adminUsersInvite, adminUsersList, adminUsersRemove, adminUsersSessionInvalidate, adminUsersSessionReset, adminUsersSetAdmin, adminUsersSetExpiration, adminUsersSetOwner, adminUsersSetRegular


text:
using JSON,Images,ArgParse

const IMGH  = 90
const IMGW  = 60
const RIGHT = "mr"
const LEFT  = "ml"
const UP    = "up"
const DOWN  = "down"
const NOOP  = -78
const EOF   = -2 # eof for reverse data
const OUTDIR ="outdir/"
function parsedoc(fname)
    inf = JSON.parsefile(fname)
    global taskname = inf["task"]
    global input    = inf["input"]
    global actions  = inf["actions"]
    global output   = inf["output"]
    global spos     = inf["startpos"]
end

function makegrids(input,output)
    name(x)=string("img/n",x,".png")
    ri = Any[]
    if length(input) > 1
        # input side is 2d grid
        maxlen = maximum(map(y->length(y),input))
        for i = 1:length(input)
            if length(input[i]) != maxlen
                input[i] = [[10 for i=1:maxlen-length(input[i])]...,input[i]...]
            end
        end
    end
    for i=1:length(input)
        singlerow = load(name(input[i][1]))
        for j=2:length(input[i])
            if input[i][j] == EOF;break; end # reverse task case
            singlerow = hcat(singlerow,load(name(input[i][j])))
        end
        push!(ri,singlerow)
    end
    ri   = vcat(ri...)
    outs = [zeros(similar(load(name(input[1][1])))) for i=1:length(output)]
    ro   = hcat(outs...)
    ro = ro .+ RGBA(1,1,1,1)
    return ri,ro
end

function makegridadd(input,output)
    maxlen = ndigits(maximum(input))
    minlen = ndigits(input[2])
    ri = Any[]
    push!(ri,reverse(digits(input[1])))
    push!(ri,[[10 for i=1:maxlen-minlen]...,reverse(digits(input[2]))...])

    return makegrids(ri,digits(input[1]+input[2]))
end

# input grid
function modifygrid(ipos,igrid,frame,counter)
    println("input grid modify",ipos)
    if ipos[1] != -1
        xstart = (ipos[1]-1) * IMGH + 1
    else
        xstart = 1
    end
    ystart = (ipos[2]-1) * IMGW + 1
    igridtmp = convert(Array{Float32},rawview(channelview(igrid)))
    if ystart > size(igridtmp,3)
        ystart = (ipos[2] -2) * IMGW + 1
    end
    igridtmp[1:3,xstart:(xstart+IMGH-1),ystart:(ystart+IMGW-1)] += frame
    # small correction
#    igridtmp[2:3,xstart:(xstart+IMGH-1),ystart:(ystart+IMGW-1)] = 0
    igridtmp[igridtmp .> 255] = 255
    igrid = colorview(RGBA,igridtmp./255)
    save(string(OUTDIR,"itape",counter,".png"),igrid)
end

# output grid
function modifygrid(img::String,opos,ogrid,counter,frame)
    if img == "NOOP"
        if taskname == "reverse"
            noopimg =  ones(RGBA{N0f8}, 90, 300)
            save(string(OUTDIR,"otape",counter,".png"),noopimg)
            return noopimg,opos
        else
            noopimg = convert(Array{Float32},rawview(channelview(ogrid)))
            zaa  = colorview(RGBA,noopimg./255)
            save(string(OUTDIR,"otape",counter,".png"),zaa)
            return noopimg,opos
        end
    end
    ystart = (opos[2]-1)*IMGW + 1
    ogridtmp = convert(Array{Float32},rawview(channelview(ogrid)))
    outnum = convert(Array{Float32},rawview(channelview(load(img))))
    ogridtmp[:,:,ystart:(ystart+IMGW-1)] = outnum
    result = copy(ogridtmp)
    ogridtmp[1:3,:,ystart:(ystart+IMGW-1)] += frame
    ogridtmp[ogridtmp .> 255] = 255
    ogrid = colorview(RGBA,ogridtmp./255)
    save(string(OUTDIR,"otape",counter,".png"),ogrid)
    if taskname == "add"
        return result,[opos[1],opos[2]-1]
    else
        return result,[opos[1],opos[2]+1]
    end
end

function run(igrid,ogrid,actions,outputs,spos,frame)
    name(x)=(x == NOOP ? "NOOP":string("img/n",x,".png"))
    oldi   = igrid
    oldo   = ogrid
    ipos   = spos
    if taskname in ["copy","reverse"]
        opos = (-1,1)
    else
        opos = (-1,length(outputs) - length(find(x->x==NOOP,outputs)))
    end
    counter = 10
    modifygrid(ipos,igrid,frame,counter)
    for (index,action) in enumerate(actions)
        # modify output tape
        ogrid,opos  = modifygrid(name(outputs[index]),opos,ogrid,counter,frame)
        counter +=1
        igrid = oldi
        ipos = move(action,ipos,Int(size(oldi,1)/IMGH),Int(size(oldi,2)/IMGW))
        modifygrid(ipos,igrid,frame,counter)
    end
end

function main()
    opts = parse_commandline()
    parsedoc(opts[:jsonfile])
    println("actions:",actions)
    println("input:",input)
    println("output:",output)
    println("spos:",spos)
    println("taskname:",taskname)
    if taskname == "add"
        igrid,ogrid = makegridadd(input,output)
    else
        igrid,ogrid = makegrids(input,output)
    end

    frame = makeframe()
    # spos     -> copy,reverse (-1,1)
    # addition/mul -> (-1,k)
    run(igrid,ogrid,actions,output,spos,frame)
end

function makeframe()
    fr = zeros(Float32,3,IMGH,IMGW)
    fr[1,1:3,:]   = 255
    fr[1,IMGH-2:IMGH,:] = 255
    fr[1,:,1:3]   = 255
    fr[1,:,IMGW-2:IMGW] = 255
    return fr
end

# rn : rownumber, cn:columnnumber
function move(a,p,rn,cn)
    if a == RIGHT
        p  = [p[1],min(p[2]+1,cn)]
    elseif a == LEFT
        p = [p[1],max(p[2]-1,1)]
    elseif a == UP
        p = [max(p[1]-1,1),p[2]]
    elseif a == DOWN
        p = [min(p[1]+1,rn),p[2]]
    else
        println(" asdada")
    end
    return p
end

function parse_commandline()
    s = ArgParseSettings()
    @add_arg_table s begin
        ("--jsonfile";default="testinput1d.json")
        ("--outpath";default="outdir/copy/")
    end
    return parse_args(s;as_symbols=true)
end

main()

ext: jl

max_stars_repo_name: ereday/algorithm-learning

max_issues_repo_name: ereday/algorithm-learning

max_forks_repo_name: ereday/algorithm-learning


text:
function minsort(A,b)
    A1 = (eltype(A))[]
    A2 = (eltype(A))[]
    A3 = (eltype(A))[]
    for i in firstindex(A):lastindex(A)
        if A[i]<b
            push!(A1,A[i])
        elseif A[i]==b
            push!(A2,A[i])
        else
            push!(A3,A[i])
        end
    end
    A=vcat(A1,A2,A3)
    return A
end

function minsort2(A,b)
    A1 = Array{eltype(A)}(undef,length(A))
    A2 = Array{eltype(A)}(undef,length(A))
    A3 = Array{eltype(A)}(undef,length(A))
    j  = 1
    k  = 1
    l  = 1
    for i in firstindex(A):lastindex(A)
        if A[i]<b
            A1[j]=A[i]
            j=j+1
        elseif A[i]==b
            A2[k]=A[i]
            k=k+1
        else
            A3[l]=A[i]
            l=l+1
        end
    end
    A[1:j-1]=A1[1:j-1]
    A[j:j+k-2]=A2[1:k-1]
    A[j+k-1:j+k+l-3]=A3[1:l-1]
    return A
end

function minsort3(A,b)
    i = 1
    j = 1
    l = lastindex(A)
    k = 2
    while k<l
        while A[i]>=b && k<l
            if A[i]==b
                A[k],A[i]=A[i],A[k]
                k=k+1
            end
            if A[i]>b
                A[l],A[i]=A[i],A[l]
                l=l-1
            end
        end
        if j>k
            k=j+1
        end
        j=j+1
        i=i+1
    end
    return A
end


text:
using Callsite

@callsite lowered function inline(body, args)
    out = Any[Expr(:meta, :inline)]
    for elem in body
        elem != Expr(:meta, :noinline) && push!(out, elem)
    end
    return out
end

@noinline function kernel(a,b)
    x = sqrt(a^2+b^2)
    y = a*b
    (x+y)
end
function test(a, b)
    return _call(inline, kernel, (a, b))
end
function test2(a, b)
    return kernel(a, b)
end
@show test(1.0, 3.0)
@code_llvm test(1.0, 3.0)
@show test2(1.0, 3.0)
@code_llvm test2(1.0, 3.0)


text:
import Base: inv

@doc raw"""
"""
abstract type AbstractTransform end

@doc raw"""
"""
struct BoxCox <: AbstractTransform end

(::BoxCox)(λ, y) = λ == 0 ? log(y) : expm1(log(y) * λ) / λ
inv(::BoxCox, λ, z) = λ == 0 ? exp(z) : exp(log(λ * z + 1) / λ)

partial_x(::BoxCox, λ, x) = x ^ (λ - 1)
partial_xx(::BoxCox, λ, x) = (λ - 1) * x ^ (λ - 2)
partial_xλ(::BoxCox, λ, x) = x ^ (λ - 1) * log(x)

partial_λ(::BoxCox, λ, y) = λ == 0 ? 0 : (λ * x ^ λ - x ^ λ + 1) / λ ^ 2
function partial_λλ(::BoxCox, λ, x)
    if λ == 0
        return 0
    end
    num = λ ^ 2 * x ^ λ * log(x) ^ 2 + 2 * x ^ λ - 2 * λ * x ^ λ * log(x) - 2
    return num / λ ^ 3
end

@doc raw"""
    TODO Unimplimented
"""
struct YeoJohnson <: AbstractTransform end

@doc raw"""
    TODO Unimplimented
"""
struct ArandaOrdaz <: AbstractTransform end

max_stars_repo_name: dbindel/btg

max_issues_repo_name: dbindel/btg

max_forks_repo_name: dbindel/btg


text:
include("twostep_utils.jl")
using Flux, Statistics, Random, Distributions, StatsFuns, Zygote, BSON

### initialize model ###
m = Chain(LSTM(Nin, Nhidden), Dense(Nhidden, Nout))

### check that our evaluation functions work ###
L, ys, rews, as, ps, hs, states = run_episode(m)
model_loss((), ())
model_eval()

### set training parameters ###
data = repeat([((), ())], 100); #100 episodes per epoch
prms = Flux.params(m);
opt= ADAM(5e-4)
evalcb = () -> @show model_eval()

### train model ###
t0 = time()
for i = 1:100
    println("epoch ", i, "  t=", round(time()-t0, digits = 1))
    Flux.train!(model_loss, prms, data, opt, cb = Flux.throttle(evalcb, 3))
end

### save model ###
using BSON: @save
@save "models/twostep.bson" m

max_stars_repo_name: KrisJensen/metaRL

max_issues_repo_name: KrisJensen/metaRL

max_forks_repo_name: KrisJensen/metaRL


text:
using GAIO

# the Lorenz system
const σ, ρ, β = 10.0, 28.0, 0.4
v((x,y,z)) = (σ*(y-x), ρ*x-y-x*z, x*y-β*z)
f(x) = rk4_flow_map(v, x)

center, radius = (0,0,25), (30,30,30)
P = BoxPartition(Box(center, radius), (128,128,128))
F = BoxMap(f, P)

x = (sqrt(β*(ρ-1)), sqrt(β*(ρ-1)), ρ-1)         # equilibrium
W = unstable_set!(F, P[x])

plot(W)


text:
struct Partials{N,V} <: AbstractVector{V}
    values::NTuple{N,V}
end

##############################
# Utility/Accessor Functions #
##############################

@generated function single_seed(::Type{Partials{N,V}}, ::Val{i}) where {N,V,i}
    ex = Expr(:tuple, [ifelse(i === j, :(one(V)), :(zero(V))) for j in 1:N]...)
    return :(Partials($(ex)))
end

@inline valtype(::Partials{N,V}) where {N,V} = V
@inline valtype(::Type{Partials{N,V}}) where {N,V} = V

@inline npartials(::Partials{N}) where {N} = N
@inline npartials(::Type{Partials{N,V}}) where {N,V} = N

@inline Base.length(::Partials{N}) where {N} = N
@inline Base.size(::Partials{N}) where {N} = (N,)

@inline Base.@propagate_inbounds Base.getindex(partials::Partials, I...) = partials.values[I...]

Base.iterate(partials::Partials) = iterate(partials.values)
Base.iterate(partials::Partials, i) = iterate(partials.values, i)

Base.IndexStyle(::Type{<:Partials}) = IndexLinear()

#####################
# Generic Functions #
#####################

@inline iszero(partials::Partials) = iszero_tuple(partials.values)

@inline Base.zero(partials::Partials) = zero(typeof(partials))
@inline Base.zero(::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(zero_tuple(NTuple{N,V}))

@inline Base.one(partials::Partials) = one(typeof(partials))
@inline Base.one(::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(one_tuple(NTuple{N,V}))

@inline Random.rand(partials::Partials) = rand(typeof(partials))
@inline Random.rand(::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(rand_tuple(NTuple{N,V}))
@inline Random.rand(rng::AbstractRNG, partials::Partials) = rand(rng, typeof(partials))
@inline Random.rand(rng::AbstractRNG, ::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(rand_tuple(rng, NTuple{N,V}))

Base.isequal(a::Partials{N}, b::Partials{N}) where {N} = isequal(a.values, b.values)
Base.:(==)(a::Partials{N}, b::Partials{N}) where {N} = a.values == b.values

const PARTIALS_HASH = hash(Partials)

Base.hash(partials::Partials) = hash(partials.values, PARTIALS_HASH)
Base.hash(partials::Partials, hsh::UInt64) = hash(hash(partials), hsh)

@inline Base.copy(partials::Partials) = partials

Base.read(io::IO, ::Type{Partials{N,V}}) where {N,V} = Partials{N,V}(ntuple(i->read(io, V), N))

function Base.write(io::IO, partials::Partials)
    for p in partials
        write(io, p)
    end
end

########################
# Conversion/Promotion #
########################

Base.promote_rule(::Type{Partials{N,A}}, ::Type{Partials{N,B}}) where {N,A,B} = Partials{N,promote_type(A, B)}

Base.convert(::Type{Partials{N,V}}, partials::Partials) where {N,V} = Partials{N,V}(partials.values)
Base.convert(::Type{Partials{N,V}}, partials::Partials{N,V}) where {N,V} = partials

########################
# Arithmetic Functions #
########################

@inline Base.:+(a::Partials{N}, b::Partials{N}) where {N} = Partials(add_tuples(a.values, b.values))
@inline Base.:-(a::Partials{N}, b::Partials{N}) where {N} = Partials(sub_tuples(a.values, b.values))
@inline Base.:-(partials::Partials) = Partials(minus_tuple(partials.values))
@inline Base.:*(x::Real, partials::Partials) = partials*x

@inline function _div_partials(a::Partials, b::Partials, aval, bval)
    return _mul_partials(a, b, inv(bval), -(aval / (bval*bval)))
end

# NaN/Inf-safe methods #
#----------------------#

if NANSAFE_MODE_ENABLED
    @inline function Base.:*(partials::Partials, x::Real)
        x = ifelse(!isfinite(x) && iszero(partials), one(x), x)
        return Partials(scale_tuple(partials.values, x))
    end

    @inline function Base.:/(partials::Partials, x::Real)
        x = ifelse(x == zero(x) && iszero(partials), one(x), x)
        return Partials(div_tuple_by_scalar(partials.values, x))
    end

    @inline function _mul_partials(a::Partials{N}, b::Partials{N}, x_a, x_b) where N
        x_a = ifelse(!isfinite(x_a) && iszero(a), one(x_a), x_a)
        x_b = ifelse(!isfinite(x_b) && iszero(b), one(x_b), x_b)
        return Partials(mul_tuples(a.values, b.values, x_a, x_b))
    end
else
    @inline function Base.:*(partials::Partials, x::Real)
        return Partials(scale_tuple(partials.values, x))
    end

    @inline function Base.:/(partials::Partials, x::Real)
        return Partials(div_tuple_by_scalar(partials.values, x))
    end

    @inline function _mul_partials(a::Partials{N}, b::Partials{N}, x_a, x_b) where N
        return Partials(mul_tuples(a.values, b.values, x_a, x_b))
    end
end

# edge cases where N == 0 #
#-------------------------#

@inline Base.:+(a::Partials{0,A}, b::Partials{0,B}) where {A,B} = Partials{0,promote_type(A,B)}(tuple())
@inline Base.:+(a::Partials{0,A}, b::Partials{N,B}) where {N,A,B} = convert(Partials{N,promote_type(A,B)}, b)
@inline Base.:+(a::Partials{N,A}, b::Partials{0,B}) where {N,A,B} = convert(Partials{N,promote_type(A,B)}, a)

@inline Base.:-(a::Partials{0,A}, b::Partials{0,B}) where {A,B} = Partials{0,promote_type(A,B)}(tuple())
@inline Base.:-(a::Partials{0,A}, b::Partials{N,B}) where {N,A,B} = -(convert(Partials{N,promote_type(A,B)}, b))
@inline Base.:-(a::Partials{N,A}, b::Partials{0,B}) where {N,A,B} = convert(Partials{N,promote_type(A,B)}, a)
@inline Base.:-(partials::Partials{0,V}) where {V} = partials

@inline Base.:*(partials::Partials{0,V}, x::Real) where {V} = Partials{0,promote_type(V,typeof(x))}(tuple())
@inline Base.:*(x::Real, partials::Partials{0,V}) where {V} = Partials{0,promote_type(V,typeof(x))}(tuple())

@inline Base.:/(partials::Partials{0,V}, x::Real) where {V} = Partials{0,promote_type(V,typeof(x))}(tuple())

@inline _mul_partials(a::Partials{0,A}, b::Partials{0,B}, afactor, bfactor) where {A,B} = Partials{0,promote_type(A,B)}(tuple())
@inline _mul_partials(a::Partials{0,A}, b::Partials{N,B}, afactor, bfactor) where {N,A,B} = bfactor * b
@inline _mul_partials(a::Partials{N,A}, b::Partials{0,B}, afactor, bfactor) where {N,A,B} = afactor * a

##################################
# Generated Functions on NTuples #
##################################
# The below functions are generally
# equivalent to directly mapping over
# tuples using `map`, but run a bit
# faster since they generate inline code
# that doesn't rely on closures.

function tupexpr(f, N)
    ex = Expr(:tuple, [f(i) for i=1:N]...)
    return quote
        $(Expr(:meta, :inline))
        @inbounds return $ex
    end
end

@inline iszero_tuple(::Tuple{}) = true
@inline zero_tuple(::Type{Tuple{}}) = tuple()
@inline one_tuple(::Type{Tuple{}}) = tuple()
@inline rand_tuple(::AbstractRNG, ::Type{Tuple{}}) = tuple()
@inline rand_tuple(::Type{Tuple{}}) = tuple()

@generated function iszero_tuple(tup::NTuple{N,V}) where {N,V}
    ex = Expr(:&&, [:(z == tup[$i]) for i=1:N]...)
    return quote
        z = zero(V)
        $(Expr(:meta, :inline))
        @inbounds return $ex
    end
end

@generated function zero_tuple(::Type{NTuple{N,V}}) where {N,V}
    ex = tupexpr(i -> :(z), N)
    return quote
        z = zero(V)
        return $ex
    end
end

@generated function one_tuple(::Type{NTuple{N,V}}) where {N,V}
    ex = tupexpr(i -> :(z), N)
    return quote
        z = one(V)
        return $ex
    end
end

@generated function rand_tuple(rng::AbstractRNG, ::Type{NTuple{N,V}}) where {N,V}
    return tupexpr(i -> :(rand(rng, V)), N)
end

@generated function rand_tuple(::Type{NTuple{N,V}}) where {N,V}
    return tupexpr(i -> :(rand(V)), N)
end

@generated function scale_tuple(tup::NTuple{N}, x) where N
    return tupexpr(i -> :(tup[$i] * x), N)
end

@generated function div_tuple_by_scalar(tup::NTuple{N}, x) where N
    return tupexpr(i -> :(tup[$i] / x), N)
end

@generated function add_tuples(a::NTuple{N}, b::NTuple{N})  where N
    return tupexpr(i -> :(a[$i] + b[$i]), N)
end

@generated function sub_tuples(a::NTuple{N}, b::NTuple{N})  where N
    return tupexpr(i -> :(a[$i] - b[$i]), N)
end

@generated function minus_tuple(tup::NTuple{N}) where N
    return tupexpr(i -> :(-tup[$i]), N)
end

@generated function mul_tuples(a::NTuple{N}, b::NTuple{N}, afactor, bfactor) where N
    return tupexpr(i -> :((afactor * a[$i]) + (bfactor * b[$i])), N)
end

###################
# Pretty Printing #
###################

Base.show(io::IO, p::Partials{N}) where {N} = print(io, "Partials", p.values)