Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
OpenXPKI::Server::API2UsersContributedePerl:DocumenEasyPluginMetaClassTrait(3)

NAME
       OpenXPKI::Server::API2::EasyPluginMetaClassTrait	- Moose	metaclass role
       (aka.  "trait") for API plugins

   DESCRIPTION
       Not intended for	direct use. Please "use
       OpenXPKI::Server::API2::EasyPlugin;" instead.

       This role manages API parameters	and their specifications for the API
       plugin classes.	It will	be applied when	you say	"use
       OpenXPKI::Server::API2::EasyPlugin".

ATTRIBUTES
   param_classes
       Returns a HashRef: keys are the API command names and values the	auto-
       generated parameter classes of type Moose::Meta::Class.

METHODS
   command_list
       Returns a list with all API command names defined by the	API plugin.

   add_param_specs
       Adds parameter specifications for the given API command.

       A new Moose::Meta::Class	is created with	the name
       ${command}_ParamObject.	Attributes are added to	the class that will
       hold the	API command parameters.	 Type constraints specified via
       'matching' are created and attached to the attributes.

       Parameters

       o   $command - API command name

       o   $param_specs	- parameter specification HashRef

	   Keys	are parameter names that will be turned	into Moose attributes
	   of a	newly generated	container class	(type Moose::Meta::Class).

	   Values are HashRefs with the	attribute options (extended version of
	   Moose's has keyword options).

	   For more details please see "command" in
	   OpenXPKI::Server::API2::EasyPlugin.

   new_param_object
       Wraps the given command parameters into an instance of an auto-
       generated parameter class.

       All parameters will be available	as Moose attributes.

       Example:

	   my $po = $plugin->meta->new_param_object("doit", { fish => 'cod', size => 55	});
	   printf "%s: %s\n", $po->fish, $po->size;

       A Moose::Exception::ValidationFailedForTypeConstraint will be thrown if
       a parameter does	not fulfill the	type constraints specified in the call
       to add_param_specs.

       Parameters

       o   $command - API command name

       o   $params - parameter HashRef

perl v5.32.0		   OpenXPKI::Server::API2::EasyPluginMetaClassTrait(3)

NAME | ATTRIBUTES | METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=OpenXPKI::Server::API2::EasyPluginMetaClassTrait&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help