File Coverage

blib/lib/STIX/Observable/AutonomousSystem.pm
Criterion Covered Total %
statement 32 32 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod n/a
total 43 43 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::AutonomousSystem;
2              
3 24     24   557 use 5.010001;
  24         105  
4 24     24   156 use strict;
  24         53  
  24         887  
5 24     24   133 use warnings;
  24         89  
  24         1599  
6 24     24   216 use utf8;
  24         71  
  24         237  
7              
8 24     24   1261 use Types::Standard qw(Str Int);
  24         77  
  24         277  
9              
10 24     24   49859 use Moo;
  24         59  
  24         220  
11 24     24   11684 use namespace::autoclean;
  24         62  
  24         268  
12              
13             extends 'STIX::Observable';
14              
15 24         2986 use constant SCHEMA =>
16 24     24   2823 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/autonomous-system.json';
  24         54  
17              
18 24         1966 use constant PROPERTIES =>
19 24     24   269 (qw(type id), qw(spec_version object_marking_refs granular_markings defanged extensions), qw(number name rir),);
  24         68  
20              
21 24     24   208 use constant STIX_OBJECT => 'SCO';
  24         67  
  24         1712  
22 24     24   170 use constant STIX_OBJECT_TYPE => 'autonomous-system';
  24         46  
  24         3899  
23              
24             has number => (is => 'rw', required => 1, isa => Int);
25             has name => (is => 'rw', isa => Str);
26             has rir => (is => 'rw', isa => Str);
27              
28             1;
29              
30             =encoding utf-8
31              
32             =head1 NAME
33              
34             STIX::Observable::AutonomousSystem - STIX Cyber-observable Object (SCO) - Autonomous System
35              
36             =head1 SYNOPSIS
37              
38             use STIX::Observable::AutonomousSystem;
39              
40             my $autonomous_system = STIX::Observable::AutonomousSystem->new();
41              
42              
43             =head1 DESCRIPTION
44              
45             The AS object represents the properties of an Autonomous Systems (AS).
46              
47              
48             =head2 METHODS
49              
50             L inherits all methods from L
51             and implements the following new ones.
52              
53             =over
54              
55             =item STIX::Observable::AutonomousSystem->new(%properties)
56              
57             Create a new instance of L.
58              
59             =item $autonomous_system->id
60              
61             =item $autonomous_system->name
62              
63             Specifies the name of the AS.
64              
65             =item $autonomous_system->number
66              
67             Specifies the number assigned to the AS. Such assignments are typically
68             performed by a Regional Internet Registries (RIR).
69              
70             =item $autonomous_system->rir
71              
72             Specifies the name of the Regional Internet Registry (RIR) that assigned
73             the number to the AS.
74              
75             =item $autonomous_system->type
76              
77             The value of this property MUST be C.
78              
79             =back
80              
81              
82             =head2 HELPERS
83              
84             =over
85              
86             =item $autonomous_system->TO_JSON
87              
88             Encode the object in JSON.
89              
90             =item $autonomous_system->to_hash
91              
92             Return the object HASH.
93              
94             =item $autonomous_system->to_string
95              
96             Encode the object in JSON.
97              
98             =item $autonomous_system->validate
99              
100             Validate the object using JSON Schema
101             (see L).
102              
103             =back
104              
105              
106             =head1 SUPPORT
107              
108             =head2 Bugs / Feature Requests
109              
110             Please report any bugs or feature requests through the issue tracker
111             at L.
112             You will be notified automatically of any progress on your issue.
113              
114             =head2 Source Code
115              
116             This is open source software. The code repository is available for
117             public review and contribution under the terms of the license.
118              
119             L
120              
121             git clone https://github.com/giterlizzi/perl-STIX.git
122              
123              
124             =head1 AUTHOR
125              
126             =over 4
127              
128             =item * Giuseppe Di Terlizzi
129              
130             =back
131              
132              
133             =head1 LICENSE AND COPYRIGHT
134              
135             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
136              
137             This is free software; you can redistribute it and/or modify it under
138             the same terms as the Perl 5 programming language system itself.
139              
140             =cut