main
1# frozen_string_literal: true
2
3module Scim
4 module Kit
5 module V2
6 # Represents a SCIM Error
7 class Error < Resource
8 SCIM_TYPES = %w[
9 invalidFilter
10 invalidPath
11 invalidSyntax
12 invalidValue
13 invalidVers
14 mutability
15 noTarget
16 sensitive
17 tooMany
18 uniqueness
19 ].freeze
20
21 def initialize(schemas: [self.class.default_schema])
22 super(schemas: schemas)
23 end
24
25 def template_name
26 'resource.json.jbuilder'
27 end
28
29 def self.default_schema
30 Schema.new(id: Messages::ERROR, name: 'Error', location: nil) do |x|
31 x.add_attribute(name: :scim_type) do |attribute|
32 attribute.canonical_values = SCIM_TYPES
33 end
34 x.add_attribute(name: :detail)
35 x.add_attribute(name: :status, type: :string)
36 end
37 end
38 end
39 end
40 end
41end