AgentPushKit-Client
view release on metacpan or search on metacpan
lib/AgentPushKit/Client/ApiFactory.pm view on Meta::CPAN
=begin comment
Agent Push Kit API
The complete Agent Push Kit REST API. Application event ingestion uses an organization key beginning with `apk_`. Authenticated user operations accept either an Agent Push Kit login JWT or an agent access token beginning with `apt_`.
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
=end comment
=cut
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# Do not edit the class manually.
# Ref: https://openapi-generator.tech
#
package AgentPushKit::Client::ApiFactory;
use strict;
use warnings;
use utf8;
use Carp;
use Module::Find;
usesub AgentPushKit::Client::Object;
use AgentPushKit::Client::ApiClient;
=head1 Name
AgentPushKit::Client::ApiFactory - constructs APIs to retrieve AgentPushKit::Client objects
=head1 Synopsis
package My::Petstore::App;
use AgentPushKit::Client::ApiFactory;
my $api_factory = AgentPushKit::Client::ApiFactory->new( ... ); # any args for ApiClient constructor
# later...
my $pet_api = $api_factory->get_api('Pet');
# $pet_api isa AgentPushKit::Client::PetApi
my $pet = $pet_api->get_pet_by_id(pet_id => $pet_id);
# object attributes have proper accessors:
printf "Pet's name is %s", $pet->name;
# change the value stored on the object:
$pet->name('Dave');
=cut
# Load all the API classes and construct a lookup table at startup time
my %_apis = map { $_ =~ /^AgentPushKit::Client::(.*)$/; $1 => $_ }
grep {$_ =~ /Api$/}
usesub 'AgentPushKit::Client';
=head1 new($api_client)
create a new AgentPushKit::Client::ApiFactory instance with the given AgentPushKit::Client::ApiClient instance.
=head1 new(%parameters)
Any parameters are optional, and are passed to and stored on the api_client object.
See L<AgentPushKit::Client::ApiClient> and L<AgentPushKit::Client::Configuration> for valid parameters
=cut
sub new {
my ($class) = shift;
my $api_client;
if ($_[0] && ref $_[0] && ref $_[0] eq 'AgentPushKit::Client::ApiClient' ) {
$api_client = $_[0];
} else {
$api_client = AgentPushKit::Client::ApiClient->new(@_);
( run in 1.702 second using v1.01-cache-2.11-cpan-364913b4093 )