Sha256: 8dcbec71f9d5bee8531e0e5352d2d49605f0f0e005b7746a55ee59f66a695a6d

Contents?: true

Size: 1021 Bytes

Versions: 19

Compression:

Stored size: 1021 Bytes

Contents

# typed: true
module Mangadex
  class ReportReason < MangadexObject
    has_attributes \
      :reason,
      :details_required,
      :category,
      :version

    class << self
      def list(category)
        args = Mangadex::Internal::Definition.validate({category: category}, {
          category: { accepts: %w(manga chapter scanlation_group user), required: true },
        })

        Mangadex::Internal::Request.get(
          '/report/reasons/%{category}' % args,
        )
      end

      def create(**args)
        Mangadex::Internal::Request.post(
          '/report',
          payload: Mangadex::Internal::Definition.validate(args, {
            category: { accepts: %w(manga chapter scanlation_group user), required: true },
            reason: { accepts: String, required: true },
            object_id: { accepts: String, required: true },
            details: { accepts: String },
          }),
        )
      end
    end

    def self.attributes_to_inspect
      self.attributes
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
mangadex-5.5.8 lib/mangadex/report_reason.rb
mangadex-5.5.6 lib/mangadex/report_reason.rb
mangadex-5.4.16 lib/mangadex/report_reason.rb
mangadex-5.4.11.3 lib/mangadex/report_reason.rb
mangadex-5.4.11.2 lib/mangadex/report_reason.rb
mangadex-5.4.11.1 lib/mangadex/report_reason.rb
mangadex-5.4.11 lib/mangadex/report_reason.rb
mangadex-5.4.9 lib/mangadex/report_reason.rb
mangadex-5.3.3.4 lib/mangadex/report_reason.rb
mangadex-5.3.3.3 lib/mangadex/report_reason.rb
mangadex-5.3.3.2 lib/mangadex/report_reason.rb
mangadex-5.3.3.1 lib/mangadex/report_reason.rb
mangadex-5.3.3 lib/mangadex/report_reason.rb
mangadex-5.3.2 lib/mangadex/report_reason.rb
mangadex-5.3.1.3 lib/mangadex/report_reason.rb
mangadex-5.3.1.2 lib/mangadex/report_reason.rb
mangadex-5.3.1.1 lib/mangadex/report_reason.rb
mangadex-5.3.1 lib/mangadex/report_reason.rb
mangadex-5.3.0 lib/mangadex/report_reason.rb