Class: GetStream::Generated::Models::Policy

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/policy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #inspect, omit_empty_fields, #to_h, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ Policy

Initialize with attributes



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/getstream_ruby/generated/models/policy.rb', line 38

def initialize(attributes = {})
  super(attributes)
  @action = attributes[:action] || attributes['action']
  @created_at = attributes[:created_at] || attributes['created_at']
  @name = attributes[:name] || attributes['name']
  @owner = attributes[:owner] || attributes['owner']
  @priority = attributes[:priority] || attributes['priority']
  @updated_at = attributes[:updated_at] || attributes['updated_at']
  @resources = attributes[:resources] || attributes['resources']
  @roles = attributes[:roles] || attributes['roles']
end

Instance Attribute Details

#action ⇒ Integer

Returns:

  • (Integer)


14
15
16
# File 'lib/getstream_ruby/generated/models/policy.rb', line 14

def action
  @action
end

#created_at ⇒ DateTime

Returns:

  • (DateTime)


17
18
19
# File 'lib/getstream_ruby/generated/models/policy.rb', line 17

def created_at
  @created_at
end

#name ⇒ String

Returns:

  • (String)


20
21
22
# File 'lib/getstream_ruby/generated/models/policy.rb', line 20

def name
  @name
end

#owner ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/getstream_ruby/generated/models/policy.rb', line 23

def owner
  @owner
end

#priority ⇒ Integer

Returns:

  • (Integer)


26
27
28
# File 'lib/getstream_ruby/generated/models/policy.rb', line 26

def priority
  @priority
end

#resources ⇒ Array<String>

Returns:

  • (Array<String>)


32
33
34
# File 'lib/getstream_ruby/generated/models/policy.rb', line 32

def resources
  @resources
end

#roles ⇒ Array<String>

Returns:

  • (Array<String>)


35
36
37
# File 'lib/getstream_ruby/generated/models/policy.rb', line 35

def roles
  @roles
end

#updated_at ⇒ DateTime

Returns:

  • (DateTime)


29
30
31
# File 'lib/getstream_ruby/generated/models/policy.rb', line 29

def updated_at
  @updated_at
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/getstream_ruby/generated/models/policy.rb', line 51

def self.json_field_mappings
  {
    action: 'action',
    created_at: 'created_at',
    name: 'name',
    owner: 'owner',
    priority: 'priority',
    updated_at: 'updated_at',
    resources: 'resources',
    roles: 'roles'
  }
end