File Coverage

blib/lib/STIX/CourseOfAction.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::CourseOfAction;
2              
3 24     24   600 use 5.010001;
  24         195  
4 24     24   172 use strict;
  24         51  
  24         935  
5 24     24   130 use warnings;
  24         46  
  24         1500  
6 24     24   151 use utf8;
  24         45  
  24         194  
7              
8 24     24   1181 use Types::Standard qw(Str);
  24         68  
  24         258  
9              
10 24     24   86923 use Moo;
  24         59  
  24         210  
11 24     24   12827 use namespace::autoclean;
  24         129  
  24         281  
12              
13             extends 'STIX::Common::Properties';
14              
15 24         2601 use constant SCHEMA =>
16 24     24   2747 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sdos/course-of-action.json';
  24         56  
17              
18 24         1926 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 action)
22 24     24   172 );
  24         58  
23              
24 24     24   160 use constant STIX_OBJECT => 'SDO';
  24         49  
  24         1343  
25 24     24   139 use constant STIX_OBJECT_TYPE => 'course-of-action';
  24         82  
  24         4421  
26              
27             has name => (is => 'rw', isa => Str, required => 1);
28             has description => (is => 'rw', isa => Str);
29             has action => (is => 'ro', isa => sub { Carp::croak 'RESERVED' });
30              
31             1;
32              
33              
34             =encoding utf-8
35              
36             =head1 NAME
37              
38             STIX::CourseOfAction - STIX Domain Object (SDO) - Course of Action
39              
40             =head1 SYNOPSIS
41              
42             use STIX::CourseOfAction;
43              
44             my $course_of_action = STIX::CourseOfAction->new();
45              
46              
47             =head1 DESCRIPTION
48              
49             A Course of Action is an action taken either to prevent an attack or to
50             respond to an attack that is in progress.
51              
52              
53             =head2 METHODS
54              
55             L inherits all methods from L
56             and implements the following new ones.
57              
58             =over
59              
60             =item STIX::CourseOfAction->new(%properties)
61              
62             Create a new instance of L.
63              
64             =item $course_of_action->description
65              
66             A description that provides more details and context about this object,
67             potentially including its purpose and its key characteristics.
68              
69             =item $course_of_action->action
70              
71             =item $course_of_action->id
72              
73             =item $course_of_action->name
74              
75             The name used to identify the Course of Action.
76              
77             =item $course_of_action->type
78              
79             The type of this object, which MUST be the literal C.
80              
81             =back
82              
83              
84             =head2 HELPERS
85              
86             =over
87              
88             =item $course_of_action->TO_JSON
89              
90             Encode the object in JSON.
91              
92             =item $course_of_action->to_hash
93              
94             Return the object HASH.
95              
96             =item $course_of_action->to_string
97              
98             Encode the object in JSON.
99              
100             =item $course_of_action->validate
101              
102             Validate the object using JSON Schema (see L).
103              
104             =back
105              
106              
107             =head1 SUPPORT
108              
109             =head2 Bugs / Feature Requests
110              
111             Please report any bugs or feature requests through the issue tracker
112             at L.
113             You will be notified automatically of any progress on your issue.
114              
115             =head2 Source Code
116              
117             This is open source software. The code repository is available for
118             public review and contribution under the terms of the license.
119              
120             L
121              
122             git clone https://github.com/giterlizzi/perl-STIX.git
123              
124              
125             =head1 AUTHOR
126              
127             =over 4
128              
129             =item * Giuseppe Di Terlizzi
130              
131             =back
132              
133              
134             =head1 LICENSE AND COPYRIGHT
135              
136             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
137              
138             This is free software; you can redistribute it and/or modify it under
139             the same terms as the Perl 5 programming language system itself.
140              
141             =cut