main
1module Scim
2 module Shady
3 class EnterpriseUser < ::Scim::Kit::V2::Resource
4 def initialize(attributes = {})
5 super(schemas: [User.schema, self.class.schema], attributes: attributes)
6 end
7
8 def self.schema(location: "/v2/Schemas/urn:ietf:params:scim:schemas:extension:enterprise:2.0:User")
9 schema = ::Scim::Kit::V2::Schema.new(id: "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", name: 'EnterpriseUser', location: location)
10 schema.add_attribute(name: :employee_number, type: :string) do |x|
11 x.multi_valued = false
12 x.description = "Numeric or alphanumeric identifier assigned to a person, typically based on order of hire or association with an organization."
13 x.required = false
14 x.case_exact = false
15 x.mutability = :read_write
16 x.returned = :default
17 x.uniqueness = :none
18 end
19 schema.add_attribute(name: :cost_center, type: :string) do |x|
20 x.multi_valued = false
21 x.description = "Identifies the name of a cost center."
22 x.required = false
23 x.case_exact = false
24 x.mutability = :read_write
25 x.returned = :default
26 x.uniqueness = :none
27 end
28 schema.add_attribute(name: :organization, type: :string) do |x|
29 x.multi_valued = false
30 x.description = "Identifies the name of an organization."
31 x.required = false
32 x.case_exact = false
33 x.mutability = :read_write
34 x.returned = :default
35 x.uniqueness = :none
36 end
37 schema.add_attribute(name: :division, type: :string) do |x|
38 x.multi_valued = false
39 x.description = "Identifies the name of a division."
40 x.required = false
41 x.case_exact = false
42 x.mutability = :read_write
43 x.returned = :default
44 x.uniqueness = :none
45 end
46 schema.add_attribute(name: :department, type: :string) do |x|
47 x.multi_valued = false
48 x.description = "Identifies the name of a department."
49 x.required = false
50 x.case_exact = false
51 x.mutability = :read_write
52 x.returned = :default
53 x.uniqueness = :none
54 end
55 schema.add_attribute(name: :manager, type: :complex) do |x|
56 x.multi_valued = false
57 x.description = ""
58 x.required = false
59 x.mutability = :read_write
60 x.returned = :default
61 x.add_attribute(name: :value, type: :string) do |y|
62 y.multi_valued = false
63 y.description = ""
64 y.required = false
65 y.case_exact = false
66 y.mutability = :read_write
67 y.returned = :default
68 y.uniqueness = :none
69 end
70 x.add_attribute(name: '$ref', type: :reference) do |y|
71 y.multi_valued = false
72 y.description = ""
73 y.required = false
74 y.case_exact = false
75 y.mutability = :read_write
76 y.returned = :default
77 y.uniqueness = :none
78 end
79 x.add_attribute(name: :display_name, type: :string) do |y|
80 y.multi_valued = false
81 y.description = ""
82 y.required = false
83 y.case_exact = false
84 y.mutability = :read_only
85 y.returned = :default
86 y.uniqueness = :none
87 end
88 end
89 schema
90 end
91 end
92 end
93end