File Coverage

blib/lib/STIX/Common/MarkingDefinition.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::Common::MarkingDefinition;
2              
3 24     24   560 use 5.010001;
  24         133  
4 24     24   163 use strict;
  24         112  
  24         829  
5 24     24   158 use warnings;
  24         71  
  24         1527  
6 24     24   211 use utf8;
  24         78  
  24         282  
7              
8 24     24   1395 use Types::Standard qw(Str HashRef);
  24         92  
  24         307  
9              
10 24     24   55951 use Moo;
  24         69  
  24         200  
11 24     24   12149 use namespace::autoclean;
  24         83  
  24         273  
12              
13             extends 'STIX::Common::Properties';
14              
15 24         3016 use constant SCHEMA =>
16 24     24   3188 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/common/marking-definition.json';
  24         92  
17              
18 24         2122 use constant PROPERTIES => (
19             qw(type spec_version id created),
20             qw(created_by_ref external_references object_marking_refs granular_markings extensions),
21             qw(name definition_type definition)
22 24     24   207 );
  24         60  
23              
24 24     24   172 use constant STIX_OBJECT => 'SMO';
  24         61  
  24         1943  
25 24     24   171 use constant STIX_OBJECT_TYPE => 'marking-definition';
  24         54  
  24         4085  
26              
27             has name => (is => 'rw', isa => Str);
28             has definition_type => (is => 'rw', isa => Str);
29             has definition => (is => 'rw');
30              
31              
32             1;
33              
34             =encoding utf-8
35              
36             =head1 NAME
37              
38             STIX::Common::MarkingDefinition - STIX Marking Definition
39              
40             =head1 SYNOPSIS
41              
42             use STIX::Common::MarkingDefinition;
43              
44             my $marking_definition = STIX::Common::MarkingDefinition->new();
45              
46              
47             =head1 DESCRIPTION
48              
49             The marking-definition object represents a specific marking.
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::Common::MarkingDefinition->new(%properties)
60              
61             Create a new instance of L.
62              
63             =item $marking_definition->created
64              
65             The created property represents the time at which the first version of this
66             Marking Definition object was created.
67              
68             =item $marking_definition->created_by_ref
69              
70             The created_by_ref property specifies the ID of the identity object that
71             describes the entity that created this Marking Definition.
72              
73             =item $marking_definition->extensions
74              
75             Specifies any extensions of the object, as a dictionary.
76              
77             =item $marking_definition->external_references
78              
79             A list of external references which refers to non-STIX information.
80              
81             =item $marking_definition->granular_markings
82              
83             The granular_markings property specifies a list of granular markings
84             applied to this object.
85              
86             =item $marking_definition->name
87              
88             A name used to identify the Marking Definition.
89              
90             =item $marking_definition->object_marking_refs
91              
92             The object_marking_refs property specifies a list of IDs of
93             marking-definition objects that apply to this Marking Definition.
94              
95             =item $marking_definition->spec_version
96              
97             The version of the STIX specification used to represent this object.
98              
99             =item $marking_definition->type
100              
101             The type of this object, which MUST be the literal C.
102              
103             =item $marking_definition->definition
104              
105             The definition property contains the marking object itself.
106              
107             =item $marking_definition->definition_type
108              
109             The definition_type property identifies the type of Marking Definition.
110              
111             =back
112              
113              
114             =head2 HELPERS
115              
116             =over
117              
118             =item $marking_definition->TO_JSON
119              
120             Helper for JSON encoders.
121              
122             =item $marking_definition->to_hash
123              
124             Return the object HASH.
125              
126             =item $marking_definition->to_string
127              
128             Encode the object in JSON.
129              
130             =item $marking_definition->validate
131              
132             Validate the object using JSON Schema (see L).
133              
134             =back
135              
136              
137             =head1 SUPPORT
138              
139             =head2 Bugs / Feature Requests
140              
141             Please report any bugs or feature requests through the issue tracker
142             at L.
143             You will be notified automatically of any progress on your issue.
144              
145             =head2 Source Code
146              
147             This is open source software. The code repository is available for
148             public review and contribution under the terms of the license.
149              
150             L
151              
152             git clone https://github.com/giterlizzi/perl-STIX.git
153              
154              
155             =head1 AUTHOR
156              
157             =over 4
158              
159             =item * Giuseppe Di Terlizzi
160              
161             =back
162              
163              
164             =head1 LICENSE AND COPYRIGHT
165              
166             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
167              
168             This is free software; you can redistribute it and/or modify it under
169             the same terms as the Perl 5 programming language system itself.
170              
171             =cut
172