Sha256: 55b8a789eadedfeb54b55c91db33e86d739e38e001c7939ece0fb431b063a6c1

Contents?: true

Size: 967 Bytes

Versions: 5

Compression:

Stored size: 967 Bytes

Contents

# frozen_string_literal: true

module Scim
  module Kit
    module V2
      # Represents a SCIM Error
      class Error < Resource
        SCIM_TYPES = %w[
          invalidFilter
          invalidPath
          invalidSyntax
          invalidValue
          invalidVers
          mutability
          noTarget
          sensitive
          tooMany
          uniqueness
        ].freeze

        def initialize(schemas: [self.class.default_schema])
          super(schemas: schemas)
        end

        def template_name
          'resource.json.jbuilder'
        end

        def self.default_schema
          Schema.new(id: Messages::ERROR, name: 'Error', location: nil) do |x|
            x.add_attribute(name: :scim_type) do |attribute|
              attribute.canonical_values = SCIM_TYPES
            end
            x.add_attribute(name: :detail)
            x.add_attribute(name: :status, type: :string)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scim-kit-0.7.2 lib/scim/kit/v2/error.rb
scim-kit-0.7.1 lib/scim/kit/v2/error.rb
scim-kit-0.7.0 lib/scim/kit/v2/error.rb
scim-kit-0.6.0 lib/scim/kit/v2/error.rb
scim-kit-0.5.3 lib/scim/kit/v2/error.rb