Class: Appwrite::Models::WafRuleRateLimit

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/models/waf_rule_rate_limit.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, limit:, interval:, key:, strategy:, max_bucket_size:) ⇒ WafRuleRateLimit

Returns a new instance of WafRuleRateLimit.



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

def initialize(
    id:,
    created_at:,
    updated_at:,
    name:,
    description:,
    team_id:,
    project_id:,
    resource_type:,
    resource_id:,
    action:,
    priority:,
    enabled:,
    conditions:,
    config:,
    schedule: nil,
    limit:,
    interval:,
    key:,
    strategy:,
    max_bucket_size:
)
    @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
    @limit = limit
    @interval = interval
    @key = key
    @strategy = strategy
    @max_bucket_size = max_bucket_size
end

Instance Attribute Details

#action ⇒ Object (readonly)

Returns the value of attribute action.



15
16
17
# File 'lib/appwrite/models/waf_rule_rate_limit.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_rate_limit.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_rate_limit.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_rate_limit.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_rate_limit.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_rate_limit.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_rate_limit.rb', line 6

def id
  @id
end

#interval ⇒ Object (readonly)

Returns the value of attribute interval.



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

def interval
  @interval
end

#key ⇒ Object (readonly)

Returns the value of attribute key.



23
24
25
# File 'lib/appwrite/models/waf_rule_rate_limit.rb', line 23

def key
  @key
end

#limit ⇒ Object (readonly)

Returns the value of attribute limit.



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

def limit
  @limit
end

#max_bucket_size ⇒ Object (readonly)

Returns the value of attribute max_bucket_size.



25
26
27
# File 'lib/appwrite/models/waf_rule_rate_limit.rb', line 25

def max_bucket_size
  @max_bucket_size
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/appwrite/models/waf_rule_rate_limit.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_rate_limit.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_rate_limit.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_rate_limit.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_rate_limit.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_rate_limit.rb', line 20

def schedule
  @schedule
end

#strategy ⇒ Object (readonly)

Returns the value of attribute strategy.



24
25
26
# File 'lib/appwrite/models/waf_rule_rate_limit.rb', line 24

def strategy
  @strategy
end

#team_id ⇒ Object (readonly)

Returns the value of attribute team_id.



11
12
13
# File 'lib/appwrite/models/waf_rule_rate_limit.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_rate_limit.rb', line 8

def updated_at
  @updated_at
end

Class Method Details

.from(map:) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/appwrite/models/waf_rule_rate_limit.rb', line 71

def self.from(map:)
    map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "name" => "", "description" => "", "teamId" => "", "projectId" => "", "resourceType" => "api", "resourceId" => "", "priority" => 0, "enabled" => true, "conditions" => [], "config" => {}, "limit" => 100, "interval" => 3600, "key" => "ip", "strategy" => "fixedWindow", "maxBucketSize" => 0 }.merge(map)
    WafRuleRateLimit.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"],
        limit: map["limit"],
        interval: map["interval"],
        key: map["key"],
        strategy: map["strategy"],
        max_bucket_size: map["maxBucketSize"]
    )
end

Instance Method Details

#to_map ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/appwrite/models/waf_rule_rate_limit.rb', line 97

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,
        "limit": @limit,
        "interval": @interval,
        "key": @key,
        "strategy": @strategy,
        "maxBucketSize": @max_bucket_size
    }
end