class MediaWiktory::Wikipedia::Actions::Clientlogin

Log in to the wiki using the interactive flow.

Usage:

“`ruby api.clientlogin.requests(value).perform # returns string with raw output # or api.clientlogin.requests(value).response # returns output parsed and wrapped into Response object “`

See {Base} for generic explanation of working with MediaWiki actions and {MediaWiktory::Wikipedia::Response} for working with action responses.

All action's parameters are documented as its public methods, see below.

Public Instance Methods

_messageformat(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 44
def _messageformat(value)
  defined?(super) && super || ["html", "wikitext", "raw", "none"].include?(value.to_s) && merge(loginmessageformat: value.to_s)
end
_requests(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 31
def _requests(value)
  merge(loginrequests: value.to_s, replace: false)
end
continue() click to toggle source

This request is a continuation after an earlier UI or REDIRECT response. Either this or loginreturnurl is required.

@return [self]

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 73
def continue()
  merge(logincontinue: 'true')
end
mergerequestfields() click to toggle source

Merge field information for all authentication requests into one array.

@return [self]

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 51
def mergerequestfields()
  merge(loginmergerequestfields: 'true')
end
messageformat(value) click to toggle source

Format to use for returning messages.

@param value [String] One of “html”, “wikitext”, “raw”, “none”. @return [self]

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 39
def messageformat(value)
  _messageformat(value) or fail ArgumentError, "Unknown value for messageformat: #{value}"
end
preservestate() click to toggle source

Preserve state from a previous failed login attempt, if possible.

@return [self]

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 58
def preservestate()
  merge(loginpreservestate: 'true')
end
requests(*values) click to toggle source

Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=login or from a previous response from this module.

@param values [Array<String>] @return [self]

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 26
def requests(*values)
  values.inject(self) { |res, val| res._requests(val) }
end
returnurl(value) click to toggle source

Return URL for third-party authentication flows, must be absolute. Either this or logincontinue is required.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 66
def returnurl(value)
  merge(loginreturnurl: value.to_s)
end
token(value) click to toggle source

A “login” token retrieved from action=query&meta=tokens

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/clientlogin.rb, line 81
def token(value)
  merge(logintoken: value.to_s)
end