File Coverage

blib/lib/STIX/Observable/DomainName.pm
Criterion Covered Total %
statement 35 35 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod n/a
total 47 47 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::DomainName;
2              
3 24     24   569 use 5.010001;
  24         105  
4 24     24   174 use strict;
  24         85  
  24         723  
5 24     24   148 use warnings;
  24         58  
  24         1524  
6 24     24   161 use utf8;
  24         56  
  24         212  
7              
8 24     24   1408 use Types::Standard qw(Str InstanceOf);
  24         56  
  24         298  
9 24     24   88458 use Types::TypeTiny qw(ArrayLike);
  24         69  
  24         228  
10              
11 24     24   13722 use Moo;
  24         71  
  24         215  
12 24     24   11537 use namespace::autoclean;
  24         65  
  24         308  
13              
14             extends 'STIX::Observable';
15              
16 24         2655 use constant SCHEMA =>
17 24     24   2850 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/domain-name.json';
  24         66  
18              
19 24         1642 use constant PROPERTIES => (
20             qw(type id),
21             qw(spec_version object_marking_refs granular_markings defanged extensions),
22             qw(value resolves_to_refs)
23 24     24   162 );
  24         53  
24              
25 24     24   147 use constant STIX_OBJECT => 'SCO';
  24         52  
  24         1291  
26 24     24   195 use constant STIX_OBJECT_TYPE => 'domain-name';
  24         59  
  24         4341  
27              
28             has value => (is => 'rw', isa => Str, required => 1);
29              
30             has resolves_to_refs => (
31             is => 'rw',
32             isa => ArrayLike [
33             InstanceOf [
34             'STIX::Cbservable::IPv4Addr', 'STIX::Observable::IPv6Addr',
35             'STIX::Observable::DomainName', 'STIX::Common::Identifier'
36             ]
37             ],
38             default => sub { STIX::Common::List->new }
39             );
40              
41             1;
42              
43             =encoding utf-8
44              
45             =head1 NAME
46              
47             STIX::Observable::DomainName - STIX Cyber-observable Object (SCO) - Domain Name
48              
49             =head1 SYNOPSIS
50              
51             use STIX::Observable::DomainName;
52              
53             my $domain_name = STIX::Observable::DomainName->new();
54              
55              
56             =head1 DESCRIPTION
57              
58             The Domain Name represents the properties of a network domain name.
59              
60              
61             =head2 METHODS
62              
63             L inherits all methods from L
64             and implements the following new ones.
65              
66             =over
67              
68             =item STIX::Observable::DomainName->new(%properties)
69              
70             Create a new instance of L.
71              
72             =item $domain_name->id
73              
74             =item $domain_name->resolves_to_refs
75              
76             Specifies a list of references to one or more IP addresses or domain names
77             that the domain name resolves to.
78              
79             =item $domain_name->type
80              
81             The value of this property MUST be C.
82              
83             =item $domain_name->value
84              
85             Specifies the value of the domain name.
86              
87             =back
88              
89              
90             =head2 HELPERS
91              
92             =over
93              
94             =item $domain_name->TO_JSON
95              
96             Encode the object in JSON.
97              
98             =item $domain_name->to_hash
99              
100             Return the object HASH.
101              
102             =item $domain_name->to_string
103              
104             Encode the object in JSON.
105              
106             =item $domain_name->validate
107              
108             Validate the object using JSON Schema
109             (see L).
110              
111             =back
112              
113              
114             =head1 SUPPORT
115              
116             =head2 Bugs / Feature Requests
117              
118             Please report any bugs or feature requests through the issue tracker
119             at L.
120             You will be notified automatically of any progress on your issue.
121              
122             =head2 Source Code
123              
124             This is open source software. The code repository is available for
125             public review and contribution under the terms of the license.
126              
127             L
128              
129             git clone https://github.com/giterlizzi/perl-STIX.git
130              
131              
132             =head1 AUTHOR
133              
134             =over 4
135              
136             =item * Giuseppe Di Terlizzi
137              
138             =back
139              
140              
141             =head1 LICENSE AND COPYRIGHT
142              
143             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
144              
145             This is free software; you can redistribute it and/or modify it under
146             the same terms as the Perl 5 programming language system itself.
147              
148             =cut