Class: Scim::Shady::EnterpriseUser

Inherits:
Kit::V2::Resource
  • Object
show all
Defined in:
lib/scim/shady/enterprise_user.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EnterpriseUser

Returns a new instance of EnterpriseUser.



4
5
6
# File 'lib/scim/shady/enterprise_user.rb', line 4

def initialize(attributes = {})
  super(schemas: [User.schema, self.class.schema], attributes: attributes)
end

Class Method Details

.schema(location: "/v2/Schemas/urn:ietf:params:scim:schemas:extension:enterprise:2.0:User") ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/scim/shady/enterprise_user.rb', line 8

def self.schema(location: "/v2/Schemas/urn:ietf:params:scim:schemas:extension:enterprise:2.0:User")
  schema = ::Scim::Kit::V2::Schema.new(id: "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", name: 'EnterpriseUser', location: location)
  schema.add_attribute(name: :employee_number, type: :string) do |x|
    x.multi_valued = false
    x.description = "Numeric or alphanumeric identifier assigned to a person, typically based on order of hire or association with an organization."
    x.required = false
    x.case_exact = false
    x.mutability = :read_write
    x.returned = :default
    x.uniqueness = :none
  end
  schema.add_attribute(name: :cost_center, type: :string) do |x|
    x.multi_valued = false
    x.description = "Identifies the name of a cost center."
    x.required = false
    x.case_exact = false
    x.mutability = :read_write
    x.returned = :default
    x.uniqueness = :none
  end
  schema.add_attribute(name: :organization, type: :string) do |x|
    x.multi_valued = false
    x.description = "Identifies the name of an organization."
    x.required = false
    x.case_exact = false
    x.mutability = :read_write
    x.returned = :default
    x.uniqueness = :none
  end
  schema.add_attribute(name: :division, type: :string) do |x|
    x.multi_valued = false
    x.description = "Identifies the name of a division."
    x.required = false
    x.case_exact = false
    x.mutability = :read_write
    x.returned = :default
    x.uniqueness = :none
  end
  schema.add_attribute(name: :department, type: :string) do |x|
    x.multi_valued = false
    x.description = "Identifies the name of a department."
    x.required = false
    x.case_exact = false
    x.mutability = :read_write
    x.returned = :default
    x.uniqueness = :none
  end
  schema.add_attribute(name: :manager, type: :complex) do |x|
    x.multi_valued = false
    x.description = ""
    x.required = false
    x.mutability = :read_write
    x.returned = :default
    x.add_attribute(name: :value, type: :string) do |y|
      y.multi_valued = false
      y.description = ""
      y.required = false
      y.case_exact = false
      y.mutability = :read_write
      y.returned = :default
      y.uniqueness = :none
    end
    x.add_attribute(name: '$ref', type: :reference) do |y|
      y.multi_valued = false
      y.description = ""
      y.required = false
      y.case_exact = false
      y.mutability = :read_write
      y.returned = :default
      y.uniqueness = :none
    end
    x.add_attribute(name: :display_name, type: :string) do |y|
      y.multi_valued = false
      y.description = ""
      y.required = false
      y.case_exact = false
      y.mutability = :read_only
      y.returned = :default
      y.uniqueness = :none
    end
  end
  schema
end