AgentPushKit-Client

 view release on metacpan or  search on metacpan

lib/AgentPushKit/Client/AccountApi.pm  view on Meta::CPAN

#
package AgentPushKit::Client::AccountApi;

require 5.6.0;
use strict;
use warnings;
use utf8;
use Exporter;
use Carp qw( croak );
use Log::Any qw($log);

use AgentPushKit::Client::ApiClient;

use base "Class::Data::Inheritable";

__PACKAGE__->mk_classdata('method_documentation' => {});

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(@_);
    }

    bless { api_client => $api_client }, $class;

}


#
# delete_current_account
#
# Delete the current user and customer accounts they own
#
{
    my $params = {
    };
    __PACKAGE__->method_documentation->{ 'delete_current_account' } = {
        summary => 'Delete the current user and customer accounts they own',
        params => $params,
        returns => 'DeletedResponse',
        };
}
# @return DeletedResponse
#
sub delete_current_account {
    my ($self, %args) = @_;

    # parse inputs
    my $_resource_path = '/me';

    my $_method = 'DELETE';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();

    my $_body_data;
    # authentication setting, if any
    my $auth_settings = [qw(UserOrAgent )];

    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $auth_settings);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('DeletedResponse', $response);
    return $_response_object;
}

#
# get_current_account
#
# Get the current user and customer accounts
#
{
    my $params = {
    };
    __PACKAGE__->method_documentation->{ 'get_current_account' } = {
        summary => 'Get the current user and customer accounts',
        params => $params,
        returns => 'CurrentAccount',
        };
}
# @return CurrentAccount
#
sub get_current_account {
    my ($self, %args) = @_;

    # parse inputs
    my $_resource_path = '/me';

    my $_method = 'GET';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();

    my $_body_data;
    # authentication setting, if any
    my $auth_settings = [qw(UserOrAgent )];

    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $auth_settings);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('CurrentAccount', $response);
    return $_response_object;
}

1;



( run in 0.908 second using v1.01-cache-2.11-cpan-e623d60df62 )