File Coverage

lib/Smartcat/Client/InvoiceApi.pm
Criterion Covered Total %
statement 29 51 56.8
branch 1 10 10.0
condition 2 6 33.3
subroutine 9 10 90.0
pod 0 2 0.0
total 41 79 51.9


line stmt bran cond sub pod time code
1              
2             =begin comment
3              
4             Smartcat Integration API
5              
6             No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
7              
8             OpenAPI spec version: v1
9              
10             Generated by: https://github.com/swagger-api/swagger-codegen.git
11              
12             =end comment
13              
14             =cut
15              
16             #
17             # NOTE: This class is auto generated by the swagger code generator program.
18             # Do not edit the class manually.
19             # Ref: https://github.com/swagger-api/swagger-codegen
20             #
21             package Smartcat::Client::InvoiceApi;
22              
23             require 5.6.0;
24 1     1   692 use strict;
  1         2  
  1         30  
25 1     1   5 use warnings;
  1         2  
  1         35  
26 1     1   656 use utf8;
  1         15  
  1         5  
27 1     1   32 use Exporter;
  1         2  
  1         38  
28 1     1   5 use Carp qw( croak );
  1         2  
  1         46  
29 1     1   478 use Log::Any qw($log);
  1         8617  
  1         5  
30              
31 1     1   2681 use Smartcat::Client::ApiClient;
  1         3  
  1         39  
32              
33 1     1   6 use base "Class::Data::Inheritable";
  1         2  
  1         566  
34              
35             __PACKAGE__->mk_classdata( 'method_documentation' => {} );
36              
37             sub new {
38 1     1 0 564 my $class = shift;
39 1         2 my $api_client;
40              
41 1 50 33     6 if ( $_[0] && ref $_[0] && ref $_[0] eq 'Smartcat::Client::ApiClient' ) {
      33        
42 0         0 $api_client = $_[0];
43             }
44             else {
45 1         8 $api_client = Smartcat::Client::ApiClient->new(@_);
46             }
47              
48 1         5 bless { api_client => $api_client }, $class;
49              
50             }
51              
52             #
53             # invoice_import_job
54             #
55             #
56             #
57             # @param ImportJobModel $model (required)
58             {
59             my $params = {
60             'model' => {
61             data_type => 'ImportJobModel',
62             description => '',
63             required => '1',
64             },
65             };
66             __PACKAGE__->method_documentation->{'invoice_import_job'} = {
67             summary => '',
68             params => $params,
69             returns => 'string',
70             };
71             }
72              
73             # @return string
74             #
75             sub invoice_import_job {
76 0     0 0   my ( $self, %args ) = @_;
77              
78             # verify the required parameter 'model' is set
79 0 0         unless ( exists $args{'model'} ) {
80 0           croak(
81             "Missing the required parameter 'model' when calling invoice_import_job"
82             );
83             }
84              
85             # parse inputs
86 0           my $_resource_path = '/api/integration/v1/invoice/job';
87              
88 0           my $_method = 'POST';
89 0           my $query_params = {};
90 0           my $header_params = {};
91 0           my $form_params = {};
92              
93             # 'Accept' and 'Content-Type' header
94             my $_header_accept = $self->{api_client}
95 0           ->select_header_accept( 'application/json', 'text/json' );
96 0 0         if ($_header_accept) {
97 0           $header_params->{'Accept'} = $_header_accept;
98             }
99             $header_params->{'Content-Type'} = $self->{api_client}
100 0           ->select_header_content_type( 'application/json', 'text/json' );
101              
102 0           my $_body_data;
103              
104             # body params
105 0 0         if ( exists $args{'model'} ) {
106 0           $_body_data = $args{'model'};
107             }
108              
109             # authentication setting, if any
110 0           my $auth_settings = [qw()];
111              
112             # make the API Call
113             my $response = $self->{api_client}->call_api(
114 0           $_resource_path, $_method, $query_params, $form_params,
115             $header_params, $_body_data, $auth_settings
116             );
117 0 0         if ( !$response ) {
118 0           return;
119             }
120             my $_response_object =
121 0           $self->{api_client}->deserialize( 'string', $response );
122 0           return $_response_object;
123             }
124              
125             1;