Class: EppXml::Domain

Inherits:
Object
  • Object
show all
Includes:
ClientTransactionId
Defined in:
lib/epp-xml/domain.rb

Instance Attribute Summary

Attributes included from ClientTransactionId

#cl_trid, #cl_trid_prefix

Instance Method Summary collapse

Methods included from ClientTransactionId

#clTRID, #initialize

Instance Method Details

#check(xml_params = {}, custom_params = {}) ⇒ Object



11
12
13
# File 'lib/epp-xml/domain.rb', line 11

def check(xml_params = {}, custom_params = {})
  build('check', xml_params, custom_params)
end

#create(xml_params = {}, dnssec_params = {}, custom_params = {}) ⇒ Object



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
49
# File 'lib/epp-xml/domain.rb', line 23

def create(xml_params = {}, dnssec_params = {}, custom_params = {})
  xml = Builder::XmlMarkup.new

  xml.instruct!(:xml, standalone: 'no')
  xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
    xml.command do
      xml.create do
        xml.tag!('domain:create', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
          EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
        end
      end

      xml.extension do
        xml.tag!('secDNS:create', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
          EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
        end if dnssec_params.any?

        xml.tag!('eis:extdata',
          'xmlns:eis' => 'https://epp.tld.ee/schema/eis-1.0.xsd') do
          EppXml.generate_xml_from_hash(custom_params, xml, 'eis:')
        end if custom_params.any?
      end if dnssec_params.any? || custom_params.any?

      xml.clTRID(clTRID) if clTRID
    end
  end
end

#delete(xml_params = {}, custom_params = {}) ⇒ Object



15
16
17
# File 'lib/epp-xml/domain.rb', line 15

def delete(xml_params = {}, custom_params = {})
  build('delete', xml_params, custom_params)
end

#info(xml_params = {}, custom_params = {}) ⇒ Object



7
8
9
# File 'lib/epp-xml/domain.rb', line 7

def info(xml_params = {}, custom_params = {})
  build('info', xml_params, custom_params)
end

#renew(xml_params = {}, custom_params = {}) ⇒ Object



19
20
21
# File 'lib/epp-xml/domain.rb', line 19

def renew(xml_params = {}, custom_params = {})
  build('renew', xml_params, custom_params)
end

#transfer(xml_params = {}, op = 'query', custom_params = {}) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/epp-xml/domain.rb', line 79

def transfer(xml_params = {}, op = 'query', custom_params = {})
  xml = Builder::XmlMarkup.new

  xml.instruct!(:xml, standalone: 'no')
  xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
    xml.command do
      xml.transfer('op' => op) do
        xml.tag!('domain:transfer', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
          EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
        end
      end

      EppXml.custom_ext(xml, custom_params)
      xml.clTRID(clTRID) if clTRID
    end
  end
end

#update(xml_params = {}, dnssec_params = {}, custom_params = {}) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/epp-xml/domain.rb', line 51

def update(xml_params = {}, dnssec_params = {}, custom_params = {})
  xml = Builder::XmlMarkup.new

  xml.instruct!(:xml, standalone: 'no')
  xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
    xml.command do
      xml.update do
        xml.tag!('domain:update', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
          EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
        end
      end

      xml.extension do
        xml.tag!('secDNS:update', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
          EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
        end

        xml.tag!('eis:extdata',
          'xmlns:eis' => 'https://epp.tld.ee/schema/eis-1.0.xsd') do
          EppXml.generate_xml_from_hash(custom_params, xml, 'eis:')
        end if custom_params.any?
      end if dnssec_params.any? || custom_params.any?

      xml.clTRID(clTRID) if clTRID
    end
  end
end