Why not adopt me?
NAME
mk_methods.pl - generate UltraDNS::Methods module by parsing the specification
SYNOPSYS
mk_methods.pl NUS_API_XML.txt
DESCRIPTION
Parses a plain text version of the UltraDNS Transaction Protocol document (derived from http://www.ultradns.net/api/NUS_API_XML.pdf) and rewrites the UltraDNS::Methods module with descriptions of the methods and their arguments.
You do not need to run this unless you need to update the code to handle a newer version of the API.
Converting PDF To Text
The NUS_API_XML.txt isn't included in the distribution for copyright reasons. This is the procedure I used to generate the current UltraDNS::Methods module:
- Open http://www.ultradns.net/api/NUS_API_XML.pdf using Preview on Mac OSX
- Select and copy all the text
- Paste the text into the TextEdit application
- Select "Make Plain Text" from the Format menu
- Save as NUS_API_XML.txt
- Run mk_methods.pl NUS_API_XML.txt in the top directory of the distribution
If you use a different method to perform the conversion then it's likely that you'll need to make slight changes to this script.
$methname
$res\$udns->$methname$args;
EOS if (@$arg_info) { for my $arg (@$arg_info) { my $example = $arg->{example}; if ($arg->{type} eq 'array') { $example = sprintf '[ $%s, ... ]', $arg->{elem_type}; } $example = "($example, ...)" if $arg->{sigil} eq '@'; printf $pm_fh qq{ %s%s = %s\n}, $arg->{sigil}, $arg->{type}, $example; } print $pm_fh "\n"; }
} print $pm_fh "\n=cut\n";
# finish up close $pm_fh or die "Error writing $pm_filename: $!";
# sanity check the generated file system("perl -c $pm_filename") == 0 or die "Error in generated $pm_filename code";
warn Dumper(\%arg_type_usage) if $opt_trace >= 2; warn Dumper([ keys %arg_type_usage ]) if $opt_trace;
__DATA__ package UltraDNS::Methods;
NAME
UltraDNS::Methods - Available UltraDNS Transaction Protocol Methods
SYNOPSYS
use UltraDNS;
$udns = UltraDNS->connect(...);
$udns->...any of these methods...(...);
$udns->...any of these methods...(...);
$udns->...any of these methods...(...);
$udns->commit;
$udns->...any of these methods...(...);
$udns->...any of these methods...(...);
$udns->...any of these methods...(...);
$udns->commit;
# etc
DESCRIPTION
This module contains details of the UltraDNS methods defined by the UltraDNS Transaction Protocol documentation.
Refer to UltraDNS for more details.