Class: Appwrite::Models::WafRuleRedirect

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/models/waf_rule_redirect.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, name:, description:, team_id:, project_id:, resource_type:, resource_id:, action:, priority:, enabled:, conditions:, config:, schedule: nil, location:, status_code:) ⇒ WafRuleRedirect

Returns a new instance of WafRuleRedirect.



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
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 24

def initialize(
    id:,
    created_at:,
    updated_at:,
    name:,
    description:,
    team_id:,
    project_id:,
    resource_type:,
    resource_id:,
    action:,
    priority:,
    enabled:,
    conditions:,
    config:,
    schedule: nil,
    location:,
    status_code:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @name = name
    @description = description
    @team_id = team_id
    @project_id = project_id
    @resource_type = resource_type
    @resource_id = resource_id
    @action = validate_action(action)
    @priority = priority
    @enabled = enabled
    @conditions = conditions
    @config = config
    @schedule = schedule
    @location = location
    @status_code = status_code
end

Instance Attribute Details

#action ⇒ Object (readonly)

Returns the value of attribute action.



15
16
17
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 15

def action
  @action
end

#conditions ⇒ Object (readonly)

Returns the value of attribute conditions.



18
19
20
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 18

def conditions
  @conditions
end

#config ⇒ Object (readonly)

Returns the value of attribute config.



19
20
21
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 19

def config
  @config
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 7

def created_at
  @created_at
end

#description ⇒ Object (readonly)

Returns the value of attribute description.



10
11
12
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 10

def description
  @description
end

#enabled ⇒ Object (readonly)

Returns the value of attribute enabled.



17
18
19
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 17

def enabled
  @enabled
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 6

def id
  @id
end

#location ⇒ Object (readonly)

Returns the value of attribute location.



21
22
23
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 21

def location
  @location
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 9

def name
  @name
end

#priority ⇒ Object (readonly)

Returns the value of attribute priority.



16
17
18
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 16

def priority
  @priority
end

#project_id ⇒ Object (readonly)

Returns the value of attribute project_id.



12
13
14
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 12

def project_id
  @project_id
end

#resource_id ⇒ Object (readonly)

Returns the value of attribute resource_id.



14
15
16
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 14

def resource_id
  @resource_id
end

#resource_type ⇒ Object (readonly)

Returns the value of attribute resource_type.



13
14
15
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 13

def resource_type
  @resource_type
end

#schedule ⇒ Object (readonly)

Returns the value of attribute schedule.



20
21
22
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 20

def schedule
  @schedule
end

#status_code ⇒ Object (readonly)

Returns the value of attribute status_code.



22
23
24
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 22

def status_code
  @status_code
end

#team_id ⇒ Object (readonly)

Returns the value of attribute team_id.



11
12
13
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 11

def team_id
  @team_id
end

#updated_at ⇒ Object (readonly)

Returns the value of attribute updated_at.



8
9
10
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 8

def updated_at
  @updated_at
end

Class Method Details

.from(map:) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 62

def self.from(map:)
    map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "name" => "", "description" => "", "teamId" => "", "projectId" => "", "resourceType" => "api", "resourceId" => "", "priority" => 0, "enabled" => true, "conditions" => [], "config" => {}, "location" => "/", "statusCode" => 302 }.merge(map)
    WafRuleRedirect.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        name: map["name"],
        description: map["description"],
        team_id: map["teamId"],
        project_id: map["projectId"],
        resource_type: map["resourceType"],
        resource_id: map["resourceId"],
        action: map["action"],
        priority: map["priority"],
        enabled: map["enabled"],
        conditions: map["conditions"],
        config: map["config"],
        schedule: map["schedule"],
        location: map["location"],
        status_code: map["statusCode"]
    )
end

Instance Method Details

#to_map ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/appwrite/models/waf_rule_redirect.rb', line 85

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "name": @name,
        "description": @description,
        "teamId": @team_id,
        "projectId": @project_id,
        "resourceType": @resource_type,
        "resourceId": @resource_id,
        "action": @action,
        "priority": @priority,
        "enabled": @enabled,
        "conditions": @conditions,
        "config": @config,
        "schedule": @schedule,
        "location": @location,
        "statusCode": @status_code
    }
end