Class: MediaWiktory::Wikipedia::Actions::Linkaccount
- Defined in:
- lib/mediawiktory/wikipedia/actions/linkaccount.rb
Overview
Link an account from a third-party provider to the current user.
Usage:
api.linkaccount.requests(value).perform # returns string with raw output
# or
api.linkaccount.requests(value).response # returns output parsed and wrapped into Response object
See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#continue ⇒ self
This request is a continuation after an earlier UI or REDIRECT response.
-
#mergerequestfields ⇒ self
Merge field information for all authentication requests into one array.
-
#messageformat(value) ⇒ self
Format to use for returning messages.
-
#requests(*values) ⇒ self
Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=link or from a previous response from this module.
-
#returnurl(value) ⇒ self
Return URL for third-party authentication flows, must be absolute.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
Methods inherited from Post
Methods inherited from Base
#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url
Methods included from GlobalParams
#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang
Instance Method Details
#continue ⇒ self
This request is a continuation after an earlier UI or REDIRECT response. Either this or linkreturnurl is required.
66 67 68 |
# File 'lib/mediawiktory/wikipedia/actions/linkaccount.rb', line 66 def continue() merge(linkcontinue: 'true') end |
#mergerequestfields ⇒ self
Merge field information for all authentication requests into one array.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/actions/linkaccount.rb', line 51 def mergerequestfields() merge(linkmergerequestfields: 'true') end |
#messageformat(value) ⇒ self
Format to use for returning messages.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/linkaccount.rb', line 39 def (value) (value) or fail ArgumentError, "Unknown value for messageformat: #{value}" end |
#requests(*values) ⇒ self
Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=link or from a previous response from this module.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/linkaccount.rb', line 26 def requests(*values) values.inject(self) { |res, val| res._requests(val) } end |
#returnurl(value) ⇒ self
Return URL for third-party authentication flows, must be absolute. Either this or linkcontinue is required.
59 60 61 |
# File 'lib/mediawiktory/wikipedia/actions/linkaccount.rb', line 59 def returnurl(value) merge(linkreturnurl: value.to_s) end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
74 75 76 |
# File 'lib/mediawiktory/wikipedia/actions/linkaccount.rb', line 74 def token(value) merge(linktoken: value.to_s) end |