DigitalOcean

 view release on metacpan or  search on metacpan

lib/DigitalOcean/Domain/Record.pm  view on Meta::CPAN


has DigitalOcean => (
    is => 'rw',
    isa => 'DigitalOcean',
);

has Domain => (
    is => 'rw',
    isa => 'DigitalOcean::Domain',
);


has id => ( 
    is => 'ro',
    isa => 'Num',
);


has type => ( 
    is => 'ro',
    isa => 'Str|Undef',
);


has name => ( 
    is => 'ro',
    isa => 'Str|Undef',
);


has data => ( 
    is => 'ro',
    isa => 'Str|Undef',
);


has priority => ( 
    is => 'ro',
    isa => 'Num|Undef',
);


has port => ( 
    is => 'ro',
    isa => 'Num|Undef',
);


has weight => ( 
    is => 'ro',
    isa => 'Num|Undef',
);


sub path {
    my ($self) = @_;
    return $self->Domain->path . '/' . $self->id;
}


sub update { 
    my $self = shift;
    my (%args) = @_;

    return $self->DigitalOcean->_put_object($self->path, 'DigitalOcean::Domain::Record', 'domain_record', \%args);
}


sub delete { 
    my ($self) = @_;
    return $self->DigitalOcean->_delete(path => $self->path);
}


__PACKAGE__->meta->make_immutable();

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

DigitalOcean::Domain::Record - Represents a Domain object in the DigitalOcean API

=head1 VERSION

version 0.17

=head1 SYNOPSIS

    FILL ME IN   

=head1 DESCRIPTION

FILL ME IN

=head1 METHODS

=head2 id

A unique identifier for each domain record.

=head2 type

The type of the DNS record (ex: A, CNAME, TXT, ...).

=head2 name

The name to use for the DNS record.

=head2 data

The value to use for the DNS record.

=head2 priority

The priority for SRV and MX records.



( run in 2.361 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )