File Coverage

blib/lib/STIX/Incident.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::Incident;
2              
3 24     24   593 use 5.010001;
  24         111  
4 24     24   200 use strict;
  24         60  
  24         1119  
5 24     24   139 use warnings;
  24         46  
  24         1740  
6 24     24   155 use utf8;
  24         52  
  24         214  
7              
8 24     24   1141 use Types::Standard qw(Str);
  24         64  
  24         279  
9              
10 24     24   77841 use Moo;
  24         61  
  24         208  
11 24     24   10618 use namespace::autoclean;
  24         51  
  24         283  
12              
13             extends 'STIX::Common::Properties';
14              
15 24         2757 use constant SCHEMA =>
16 24     24   2886 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sdos/incident.json';
  24         73  
17              
18 24         1716 use constant PROPERTIES => (
19             qw(type spec_version id created modified),
20             qw(created_by_ref revoked labels confidence lang external_references object_marking_refs granular_markings extensions),
21             qw(name description)
22 24     24   156 );
  24         55  
23              
24 24     24   144 use constant STIX_OBJECT => 'SDO';
  24         53  
  24         1239  
25 24     24   127 use constant STIX_OBJECT_TYPE => 'incident';
  24         48  
  24         3287  
26              
27             has name => (is => 'rw', isa => Str, required => 1);
28             has description => (is => 'rw', isa => Str);
29              
30             1;
31              
32              
33             =encoding utf-8
34              
35             =head1 NAME
36              
37             STIX::Incident - STIX Domain Object (SDO) - Incident
38              
39             =head1 SYNOPSIS
40              
41             use STIX::Incident;
42              
43             my $incident = STIX::Incident->new();
44              
45              
46             =head1 DESCRIPTION
47              
48             The Incident object in STIX 2.1 is a stub, to be expanded in future STIX 2
49             releases.
50              
51              
52             =head2 METHODS
53              
54             L inherits all methods from L
55             and implements the following new ones.
56              
57             =over
58              
59             =item STIX::Incident->new(%properties)
60              
61             Create a new instance of L.
62              
63             =item $incident->description
64              
65             A description that provides more details and context about the Incident.
66              
67             =item $incident->id
68              
69             =item $incident->name
70              
71             The name used to identify the Incident.
72              
73             =item $incident->type
74              
75             The type of this object, which MUST be the literal C.
76              
77             =back
78              
79              
80             =head2 HELPERS
81              
82             =over
83              
84             =item $incident->TO_JSON
85              
86             Encode the object in JSON.
87              
88             =item $incident->to_hash
89              
90             Return the object HASH.
91              
92             =item $incident->to_string
93              
94             Encode the object in JSON.
95              
96             =item $incident->validate
97              
98             Validate the object using JSON Schema (see L).
99              
100             =back
101              
102              
103             =head1 SUPPORT
104              
105             =head2 Bugs / Feature Requests
106              
107             Please report any bugs or feature requests through the issue tracker
108             at L.
109             You will be notified automatically of any progress on your issue.
110              
111             =head2 Source Code
112              
113             This is open source software. The code repository is available for
114             public review and contribution under the terms of the license.
115              
116             L
117              
118             git clone https://github.com/giterlizzi/perl-STIX.git
119              
120              
121             =head1 AUTHOR
122              
123             =over 4
124              
125             =item * Giuseppe Di Terlizzi
126              
127             =back
128              
129              
130             =head1 LICENSE AND COPYRIGHT
131              
132             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
133              
134             This is free software; you can redistribute it and/or modify it under
135             the same terms as the Perl 5 programming language system itself.
136              
137             =cut