Class: Appwrite::Models::Domain

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, domain:, registrar:, nameservers:, expire:, renewal:, auto_renewal:, renewal_price:, transfer_status: nil, team_id:, dns_records:) ⇒ Domain

Returns a new instance of Domain.



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

def initialize(
    id:,
    created_at:,
    updated_at:,
    domain:,
    registrar:,
    nameservers:,
    expire:,
    renewal:,
    auto_renewal:,
    renewal_price:,
    transfer_status: nil,
    team_id:,
    dns_records:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @domain = domain
    @registrar = registrar
    @nameservers = nameservers
    @expire = expire
    @renewal = renewal
    @auto_renewal = auto_renewal
    @renewal_price = renewal_price
    @transfer_status = transfer_status.nil? ? transfer_status : validate_transfer_status(transfer_status)
    @team_id = team_id
    @dns_records = dns_records
end

Instance Attribute Details

#auto_renewal ⇒ Object (readonly)

Returns the value of attribute auto_renewal.



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

def auto_renewal
  @auto_renewal
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#dns_records ⇒ Object (readonly)

Returns the value of attribute dns_records.



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

def dns_records
  @dns_records
end

#domain ⇒ Object (readonly)

Returns the value of attribute domain.



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

def domain
  @domain
end

#expire ⇒ Object (readonly)

Returns the value of attribute expire.



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

def expire
  @expire
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameservers ⇒ Object (readonly)

Returns the value of attribute nameservers.



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

def nameservers
  @nameservers
end

#registrar ⇒ Object (readonly)

Returns the value of attribute registrar.



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

def registrar
  @registrar
end

#renewal ⇒ Object (readonly)

Returns the value of attribute renewal.



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

def renewal
  @renewal
end

#renewal_price ⇒ Object (readonly)

Returns the value of attribute renewal_price.



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

def renewal_price
  @renewal_price
end

#team_id ⇒ Object (readonly)

Returns the value of attribute team_id.



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

def team_id
  @team_id
end

#transfer_status ⇒ Object (readonly)

Returns the value of attribute transfer_status.



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

def transfer_status
  @transfer_status
end

#updated_at ⇒ Object (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

Class Method Details

.from(map:) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/appwrite/models/domain.rb', line 50

def self.from(map:)
    map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "domain" => "", "registrar" => "", "nameservers" => "", "expire" => "", "renewal" => "", "autoRenewal" => false, "renewalPrice" => 0, "teamId" => "", "dnsRecords" => [] }.merge(map)
    Domain.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        domain: map["domain"],
        registrar: map["registrar"],
        nameservers: map["nameservers"],
        expire: map["expire"],
        renewal: map["renewal"],
        auto_renewal: map["autoRenewal"],
        renewal_price: map["renewalPrice"],
        transfer_status: map["transferStatus"],
        team_id: map["teamId"],
        dns_records: map["dnsRecords"].map { |it| DnsRecord.from(map: it) }
    )
end

Instance Method Details

#to_map ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/appwrite/models/domain.rb', line 69

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "domain": @domain,
        "registrar": @registrar,
        "nameservers": @nameservers,
        "expire": @expire,
        "renewal": @renewal,
        "autoRenewal": @auto_renewal,
        "renewalPrice": @renewal_price,
        "transferStatus": @transfer_status,
        "teamId": @team_id,
        "dnsRecords": @dns_records.map { |it| it.to_map }
    }
end