Module: Shikimori::API::V2::AbuseRequests

Included in:
Shikimori::API::V2
Defined in:
lib/shikimori/api/v2/abuse_requests.rb

Overview

Methods for the Abuse requests API

Instance Method Summary collapse

Instance Method Details

#abuse_offtopic_request(abuse_request, headers: nil, **query) ⇒ Hash

Abuse offtopic request

Examples:

client = Shikimori::API::Client.new(
           app_name: 'Api Test',
           aceess_token: '****',
           refresh_token: '****'
         )
client.v2.abuse_offtopic_request({ comment_id: 1, topic_id: 1, reason: 'Nani?!' })

Parameters:

  • abuse_request (Hash)

    Abuse request data for creating

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Options Hash (abuse_request):

  • :comment_id (Integer)

    Comment id

Returns:

  • (Hash)

    Hash representing abuse request

See Also:



27
28
29
# File 'lib/shikimori/api/v2/abuse_requests.rb', line 27

def abuse_offtopic_request(abuse_request, headers: nil, **query)
  rest.post base_url.join('abuse_requests', 'offtopic').url, abuse_request.to_h, headers: headers, query: query
end

#abuse_request(abuse_request, headers: nil, **query) ⇒ Hash

Abuse abuse request

Examples:

client = Shikimori::API::Client.new(
           app_name: 'Api Test',
           aceess_token: '****',
           refresh_token: '****'
         )
client.v2.abuse_request({ topic_id: 1, reason: 'Nani?!' })

Parameters:

  • abuse_request (Hash)

    Abuse request data for creating

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Options Hash (abuse_request):

  • :comment_id (Integer)

    Comment id

  • :topic_id (Integer)

    Comment id

  • :reason (String)

    Reason to abuse

Returns:

  • (Hash)

    Hash representing abuse request

See Also:



74
75
76
# File 'lib/shikimori/api/v2/abuse_requests.rb', line 74

def abuse_request(abuse_request, headers: nil, **query)
  rest.post base_url.join('abuse_requests', 'abuse').url, abuse_request.to_h, headers: headers, query: query
end

#abuse_review_request(abuse_request, headers: nil, **query) ⇒ Hash

Abuse review request

Examples:

client = Shikimori::API::Client.new(
           app_name: 'Api Test',
           aceess_token: '****',
           refresh_token: '****'
         )
client.v2.abuse_review_request({ topic_id: 1 })

Parameters:

  • abuse_request (Hash)

    Abuse request data for creating

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Options Hash (abuse_request):

  • :comment_id (Integer)

    Comment id

  • :topic_id (Integer)

    Comment id

Returns:

  • (Hash)

    Hash representing abuse request

See Also:



49
50
51
52
53
# File 'lib/shikimori/api/v2/abuse_requests.rb', line 49

def abuse_review_request(abuse_request, headers: nil, **query)
  rest.post base_url.join('abuse_requests', 'convert_review').url,
            abuse_request.to_h,
            headers: headers, query: query
end

#abuse_spoiler_request(abuse_request, headers: nil, **query) ⇒ Hash

Abuse spoiler request

Examples:

client = Shikimori::API::Client.new(
           app_name: 'Api Test',
           aceess_token: '****',
           refresh_token: '****'
         )
client.v2.abuse_spoiler_request({ comment_id: 1, reason: 'Nani?!' })

Parameters:

  • abuse_request (Hash)

    Abuse request data for creating

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Options Hash (abuse_request):

  • :comment_id (Integer)

    Comment id

  • :topic_id (Integer)

    Comment id

  • :reason (String)

    Reason to abuse

Returns:

  • (Hash)

    Hash representing abuse request

See Also:



97
98
99
# File 'lib/shikimori/api/v2/abuse_requests.rb', line 97

def abuse_spoiler_request(abuse_request, headers: nil, **query)
  rest.post base_url.join('abuse_requests', 'spoiler').url, abuse_request.to_h, headers: headers, query: query
end