File Coverage

lib/Smartcat/Client/DirectoriesApi.pm
Criterion Covered Total %
statement 29 68 42.6
branch 1 14 7.1
condition 2 6 33.3
subroutine 9 11 81.8
pod 0 3 0.0
total 41 102 40.2


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::DirectoriesApi;
22              
23             require 5.6.0;
24 1     1   726 use strict;
  1         2  
  1         30  
25 1     1   5 use warnings;
  1         2  
  1         26  
26 1     1   569 use utf8;
  1         14  
  1         5  
27 1     1   31 use Exporter;
  1         1  
  1         38  
28 1     1   4 use Carp qw( croak );
  1         2  
  1         46  
29 1     1   457 use Log::Any qw($log);
  1         8462  
  1         5  
30              
31 1     1   2817 use Smartcat::Client::ApiClient;
  1         3  
  1         52  
32              
33 1     1   8 use base "Class::Data::Inheritable";
  1         2  
  1         483  
34              
35             __PACKAGE__->mk_classdata( 'method_documentation' => {} );
36              
37             sub new {
38 1     1 0 575 my $class = shift;
39 1         2 my $api_client;
40              
41 1 50 33     7 if ( $_[0] && ref $_[0] && ref $_[0] eq 'Smartcat::Client::ApiClient' ) {
      33        
42 0         0 $api_client = $_[0];
43             }
44             else {
45 1         6 $api_client = Smartcat::Client::ApiClient->new(@_);
46             }
47              
48 1         5 bless { api_client => $api_client }, $class;
49              
50             }
51              
52             #
53             # directories_get
54             #
55             #
56             #
57             # @param string $type (required)
58             {
59             my $params = {
60             'type' => {
61             data_type => 'string',
62             description => '',
63             required => '1',
64             },
65             };
66             __PACKAGE__->method_documentation->{'directories_get'} = {
67             summary => '',
68             params => $params,
69             returns => 'DirectoryModel',
70             };
71             }
72              
73             # @return DirectoryModel
74             #
75             sub directories_get {
76 0     0 0   my ( $self, %args ) = @_;
77              
78             # verify the required parameter 'type' is set
79 0 0         unless ( exists $args{'type'} ) {
80 0           croak(
81             "Missing the required parameter 'type' when calling directories_get"
82             );
83             }
84              
85             # parse inputs
86 0           my $_resource_path = '/api/integration/v1/directory';
87              
88 0           my $_method = 'GET';
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'} =
100 0           $self->{api_client}->select_header_content_type();
101              
102             # query params
103 0 0         if ( exists $args{'type'} ) {
104             $query_params->{'type'} =
105 0           $self->{api_client}->to_query_value( $args{'type'} );
106             }
107              
108 0           my $_body_data;
109              
110             # authentication setting, if any
111 0           my $auth_settings = [qw()];
112              
113             # make the API Call
114             my $response = $self->{api_client}->call_api(
115 0           $_resource_path, $_method, $query_params, $form_params,
116             $header_params, $_body_data, $auth_settings
117             );
118 0 0         if ( !$response ) {
119 0           return;
120             }
121             my $_response_object =
122 0           $self->{api_client}->deserialize( 'DirectoryModel', $response );
123 0           return $_response_object;
124             }
125              
126             #
127             # directories_get_supported_formats_for_account
128             #
129             # Receive parsing formats supported by the account
130             #
131             {
132             my $params = {};
133             __PACKAGE__->method_documentation->{
134             'directories_get_supported_formats_for_account'} = {
135             summary => 'Receive parsing formats supported by the account',
136             params => $params,
137             returns => 'ARRAY[FileFormatModel]',
138             };
139             }
140              
141             # @return ARRAY[FileFormatModel]
142             #
143             sub directories_get_supported_formats_for_account {
144 0     0 0   my ( $self, %args ) = @_;
145              
146             # parse inputs
147 0           my $_resource_path = '/api/integration/v1/directory/formats';
148              
149 0           my $_method = 'GET';
150 0           my $query_params = {};
151 0           my $header_params = {};
152 0           my $form_params = {};
153              
154             # 'Accept' and 'Content-Type' header
155             my $_header_accept = $self->{api_client}
156 0           ->select_header_accept( 'application/json', 'text/json' );
157 0 0         if ($_header_accept) {
158 0           $header_params->{'Accept'} = $_header_accept;
159             }
160             $header_params->{'Content-Type'} =
161 0           $self->{api_client}->select_header_content_type();
162              
163 0           my $_body_data;
164              
165             # authentication setting, if any
166 0           my $auth_settings = [qw()];
167              
168             # make the API Call
169             my $response = $self->{api_client}->call_api(
170 0           $_resource_path, $_method, $query_params, $form_params,
171             $header_params, $_body_data, $auth_settings
172             );
173 0 0         if ( !$response ) {
174 0           return;
175             }
176             my $_response_object =
177 0           $self->{api_client}->deserialize( 'ARRAY[FileFormatModel]', $response );
178 0           return $_response_object;
179             }
180              
181             1;