Group
Extension

Matches 35358

Perinci-CmdLine ( P/PE/PERLANCAR/Perinci-CmdLine-2.000.1.tar.gz, PERLANCAR, 2024; MetaCPAN )
Perinci-CmdLine/lib/Perinci/CmdLine/Manual/Explanation/ArgumentValidation.pod ( view source; MetaCPAN )
it
will get set the default from schema during argument validation:

 # via CLI
 % progname --baz-json 'null'

 # via wrapped function call
 funcname(baz=>undef)

Function will receive C<bar> key in i
SQL-Translator ( V/VE/VEESH/SQL-Translator-1.66.tar.gz, VEESH, 2024; MetaCPAN )
SQL-Translator/lib/SQL/Translator/Parser/PostgreSQL.pm ( view source; MetaCPAN )
(bit|box|cidr|circle|date|inet|line|lseg|macaddr|money|numeric|decimal|path|point|polygon|varchar|json|hstore|uuid)/i
        {
            $return = { type => $item[1] };
        }

parens_value_list
Locale-Maketext-Utils ( D/DM/DMUEY/Locale-Maketext-Utils-0.43.tar.gz, DMUEY, 2024; MetaCPAN )
Locale-Maketext-Utils/lib/Locale/Maketext/Utils.pod ( view source; MetaCPAN )
oluted like:

    [%- SET item_list = [] -%]
    [%- FOREACH i IN api_mt_result; item_list.push(i.json); END -%]
    [% '\[% locale.makevar(' _ item_list.join(", ") _ ') %\]' | evaltt %]

=head2 $lh->
Perinci-CmdLine ( P/PE/PERLANCAR/Perinci-CmdLine-2.000.1.tar.gz, PERLANCAR, 2024; MetaCPAN )
Perinci-CmdLine/lib/Perinci/CmdLine/Manual/Examples.pod ( view source; MetaCPAN )
as some common options like C<--format> to return the result in a
different format:

 % ./hello --json
 [200,"OK","Hello, world!"]

 % ./hello --format perl; # only in PC::Classic, not available in PC
ame Jimmy --name Sion --name Habil
 Hello, Jimmy!
 Hello, Sion!
 Hello, Habil!

 % ./hello --name-json '["Jimmy","Sion","Habil"]' --gender m
 Hello, Mr. Jimmy!
 Hello, Mr. Sion!
 Hello, Mr. Habil!

So
ither specify multiple times (e.g. C<--name
NAME1 --name NAME2 ...>) or specify using JSON (i.e. C<--name-json JSONSTR>).

Second, the C<name> argument specifies the C<slurpy> property. This is used i
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Common/Hashes.pm ( view source; MetaCPAN )
package STIX::Common::Hashes;

use 5.010001;
use strict;
use warnings;
use utf8;

use Cpanel::JSON::XS;
use Types::Standard qw(Str);

use Moo;
use namespace::autoclean;

extends 'STIX::Object';

use c
Str);
has ssdeep   => (is => 'rw', isa => Str);
has tlsh     => (is => 'rw', isa => Str);

sub TO_JSON {

    my $self   = shift;
    my $hashes = {};

    $hashes->{'md5'}      = $self->md5      if (
$self->tlsh);

    return $hashes;

}

sub to_hash { shift->TO_JSON }

sub to_string {

    my $self = shift;

    my $json = Cpanel::JSON::XS->new->utf8->canonical->allow_nonref->allow_unknown->allow
Perinci-CmdLine ( P/PE/PERLANCAR/Perinci-CmdLine-2.000.1.tar.gz, PERLANCAR, 2024; MetaCPAN )
Perinci-CmdLine/lib/Perinci/CmdLine/Manual/FAQ.pod ( view source; MetaCPAN )
 scalars (check at most 5 elements), print
as table.

7) otherwise print as JSON (after cleaning it with L<Data::Clean::JSON>).

YAML and the other formats are not supported.

Table is printed using t
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Incident.pm ( view source; MetaCPAN )
onstant SCHEMA =>
    'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sdos/incident.json';

use constant PROPERTIES => (
    qw(type spec_version id created modifie
_JSON

Encode the object in JSON.

=item $incident->to_hash

Return the object HASH.

=item $incident->to_string

Encode the object in JSON.

=item $incident->validate

Validate the object using JSON 
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Observable/Type/AlternateDataStream.pm ( view source; MetaCPAN )
stream_ext->TO_JSON

Helper for JSON encoders.

=item $alternate_data_stream_ext->to_hash

Return the object HASH.

=item $alternate_data_stream_ext->to_string

Encode the object in JSON.

=item $alte
rnate_data_stream_ext->validate

Validate the object using JSON Schema (see L<STIX::Schema>).

=back


=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs or feature requests throug
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Common/KillChainPhase.pm ( view source; MetaCPAN )
nt SCHEMA =>
    'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/common/kill-chain-phase.json';

use constant PROPERTIES => qw(kill_chain_name phase_name);

has kil
m $kill_chain_phase->TO_JSON

Helper for JSON encoders.

=item $kill_chain_phase->to_hash

Return the object HASH.

=item $kill_chain_phase->to_string

Encode the object in JSON.

=item $kill_chain_ph
ase->validate

Validate the object using JSON Schema (see L<STIX::Schema>).

=back


=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracke
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Note.pm ( view source; MetaCPAN )
 constant SCHEMA =>
    'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sdos/note.json';

use constant PROPERTIES => (
    qw(type spec_version id created modified)
te->TO_JSON

Encode the object in JSON.

=item $note->to_hash

Return the object HASH.

=item $note->to_string

Encode the object in JSON.

=item $note->validate

Validate the object using JSON Schema
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Schema.pm ( view source; MetaCPAN )
rter 'import';

use File::Basename        qw(dirname);
use File::Spec::Functions qw(catfile);
use JSON::Validator;

use Moo;

use constant DEBUG => $ENV{STIX_DEBUG} || 0;

has object => (is => 'ro');
path { catfile(dirname(__FILE__), 'cache') }

sub validator {

    my ($self) = @_;

    my $jv = JSON::Validator->new;

    DEBUG and say sprintf('-- Load validator and use %s schema', $self->object-
rn $self->validator->validate($self->object);
}

1;

=encoding utf-8

=head1 NAME

STIX::Schema - JSON Schema Validator

=head1 SYNOPSIS

    use STIX::Schema;

    my $validator = STIX::Schema->new(o
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Common/Timestamp.pm ( view source; MetaCPAN )
/$regexp/);
    }

    Carp::carp 'Malformed timestamp';

    return Time::Piece->new;

}

sub TO_JSON { shift->value->datetime . '.000Z' }

1;

=encoding utf-8

=head1 NAME

STIX::Common::Timestamp -
lue

=back

=head2 HELPERS

=over

=item $timestamp->TO_JSON

Encode the object in JSON.

=item $timestamp->to_string

Encode the object in JSON.

=back


=head1 SUPPORT

=head2 Bugs / Feature Request
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Common/List.pm ( view source; MetaCPAN )
}[0] }

sub last { $_[0]->{collections}[-1] }

sub to_array { [@{$_[0]->{collections}}] }

sub TO_JSON { [@{$_[0]->{collections}}] }

1;

__END__

=encoding utf-8

=head1 NAME

STIX::Common::List - Co
->unshift('baz');

=item $c->to_array

Return the collection ARRAY.

=item $c->TO_JSON

Convert the collenction in JSON.

=back


=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Observable/EmailAddr.pm ( view source; MetaCPAN )
nt SCHEMA =>
    'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/email-addr.json';

use constant PROPERTIES => (
    qw(type id),
    qw(spec_version ob
=over

=item $email_addr->TO_JSON

Encode the object in JSON.

=item $email_addr->to_hash

Return the object HASH.

=item $email_addr->to_string

Encode the object in JSON.

=item $email_addr->validat
e

Validate the object using JSON Schema
(see L<STIX::Schema>).

=back


=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker
at L<https
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Observable/MACAddr.pm ( view source; MetaCPAN )
ant SCHEMA =>
    'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/mac-addr.json';

use constant PROPERTIES =>
    (qw(type id), qw(spec_version object_m
_JSON

Encode the object in JSON.

=item $mac_addr->to_hash

Return the object HASH.

=item $mac_addr->to_string

Encode the object in JSON.

=item $mac_addr->validate

Validate the object using JSON 
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Observable/Extension/HTTPRequest.pm ( view source; MetaCPAN )
m $http_request_ext->TO_JSON

Helper for JSON encoders.

=item $http_request_ext->to_hash

Return the object HASH.

=item $http_request_ext->to_string

Encode the object in JSON.

=item $http_request_
ext->validate

Validate the object using JSON Schema (see L<STIX::Schema>).

=back


=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracke
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Sighting.pm ( view source; MetaCPAN )
onstant SCHEMA =>
    'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sros/sighting.json';

use constant PROPERTIES => (
    qw(type spec_version id created modifie
_JSON

Encode the object in JSON.

=item $sighting->to_hash

Return the object HASH.

=item $sighting->to_string

Encode the object in JSON.

=item $sighting->validate

Validate the object using JSON 
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Observable/Extension/ICMP.pm ( view source; MetaCPAN )
O_JSON

Helper for JSON encoders.

=item $icmp_ext->to_hash

Return the object HASH.

=item $icmp_ext->to_string

Encode the object in JSON.

=item $icmp_ext->validate

Validate the object using JSON 
STIX ( G/GD/GDT/STIX-1.01.tar.gz, GDT, 2024; MetaCPAN )
STIX/lib/STIX/Observable/Extension/WindowsService.pm ( view source; MetaCPAN )
dows_service_ext->TO_JSON

Helper for JSON encoders.

=item $windows_service_ext->to_hash

Return the object HASH.

=item $windows_service_ext->to_string

Encode the object in JSON.

=item $windows_se
rvice_ext->validate

Validate the object using JSON Schema (see L<STIX::Schema>).

=back


=head1 SUPPORT

=head2 Bugs / Feature Requests

Please report any bugs or feature requests through the issue 
Perinci-CmdLine ( P/PE/PERLANCAR/Perinci-CmdLine-2.000.1.tar.gz, PERLANCAR, 2024; MetaCPAN )
Perinci-CmdLine/lib/Perinci/CmdLine/Manual/HowTo/99Examples.pod ( view source; MetaCPAN )
as some common options like C<--format> to return the result in a
different format:

 % ./hello --json
 [200,"OK","Hello, world!"]

 % ./hello --format perl; # only in PC::Classic, not available in PC
ame Jimmy --name Sion --name Habil
 Hello, Jimmy!
 Hello, Sion!
 Hello, Habil!

 % ./hello --name-json '["Jimmy","Sion","Habil"]' --gender m
 Hello, Mr. Jimmy!
 Hello, Mr. Sion!
 Hello, Mr. Habil!

So
ither specify multiple times (e.g. C<--name
NAME1 --name NAME2 ...>) or specify using JSON (i.e. C<--name-json JSONSTR>).

Second, the C<name> argument specifies the C<slurpy> property. This is used i

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.