Class: Appwrite::Models::Block

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(created_at:, resource_type:, resource_id:, reason:, expired_at:, project_name:, region:, organization_name:, organization_id:, billing_plan:) ⇒ Block

Returns a new instance of Block.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/appwrite/models/block.rb', line 17

def initialize(
    created_at:,
    resource_type:,
    resource_id:,
    reason: ,
    expired_at: ,
    project_name:,
    region:,
    organization_name:,
    organization_id:,
    billing_plan:
)
    @created_at = created_at
    @resource_type = resource_type
    @resource_id = resource_id
    @reason = reason
    @expired_at = expired_at
    @project_name = project_name
    @region = region
    @organization_name = organization_name
    @organization_id = organization_id
    @billing_plan = billing_plan
end

Instance Attribute Details

#billing_planObject (readonly)

Returns the value of attribute billing_plan.



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

def billing_plan
  @billing_plan
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#expired_atObject (readonly)

Returns the value of attribute expired_at.



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

def expired_at
  @expired_at
end

#organization_idObject (readonly)

Returns the value of attribute organization_id.



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

def organization_id
  @organization_id
end

#organization_nameObject (readonly)

Returns the value of attribute organization_name.



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

def organization_name
  @organization_name
end

#project_nameObject (readonly)

Returns the value of attribute project_name.



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

def project_name
  @project_name
end

#reasonObject (readonly)

Returns the value of attribute reason.



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

def reason
  @reason
end

#regionObject (readonly)

Returns the value of attribute region.



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

def region
  @region
end

#resource_idObject (readonly)

Returns the value of attribute resource_id.



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

def resource_id
  @resource_id
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type.



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

def resource_type
  @resource_type
end

Class Method Details

.from(map:) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/appwrite/models/block.rb', line 41

def self.from(map:)
    Block.new(
        created_at: map["$createdAt"],
        resource_type: map["resourceType"],
        resource_id: map["resourceId"],
        reason: map["reason"],
        expired_at: map["expiredAt"],
        project_name: map["projectName"],
        region: map["region"],
        organization_name: map["organizationName"],
        organization_id: map["organizationId"],
        billing_plan: map["billingPlan"]
    )
end

Instance Method Details

#to_mapObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/appwrite/models/block.rb', line 56

def to_map
    {
        "$createdAt": @created_at,
        "resourceType": @resource_type,
        "resourceId": @resource_id,
        "reason": @reason,
        "expiredAt": @expired_at,
        "projectName": @project_name,
        "region": @region,
        "organizationName": @organization_name,
        "organizationId": @organization_id,
        "billingPlan": @billing_plan
    }
end