File Coverage

lib/Smartcat/Client/PlaceholderFormatApiApi.pm
Criterion Covered Total %
statement 29 83 34.9
branch 1 18 5.5
condition 2 6 33.3
subroutine 9 12 75.0
pod 0 4 0.0
total 41 123 33.3


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::PlaceholderFormatApiApi;
22              
23             require 5.6.0;
24 1     1   655 use strict;
  1         2  
  1         24  
25 1     1   4 use warnings;
  1         2  
  1         25  
26 1     1   511 use utf8;
  1         13  
  1         5  
27 1     1   25 use Exporter;
  1         2  
  1         33  
28 1     1   4 use Carp qw( croak );
  1         1  
  1         42  
29 1     1   392 use Log::Any qw($log);
  1         7250  
  1         5  
30              
31 1     1   2388 use Smartcat::Client::ApiClient;
  1         2  
  1         35  
32              
33 1     1   6 use base "Class::Data::Inheritable";
  1         2  
  1         426  
34              
35             __PACKAGE__->mk_classdata( 'method_documentation' => {} );
36              
37             sub new {
38 1     1 0 515 my $class = shift;
39 1         1 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         6 $api_client = Smartcat::Client::ApiClient->new(@_);
46             }
47              
48 1         5 bless { api_client => $api_client }, $class;
49              
50             }
51              
52             #
53             # placeholder_format_api_get_placeholder_formats
54             #
55             #
56             #
57             {
58             my $params = {};
59             __PACKAGE__->method_documentation->{
60             'placeholder_format_api_get_placeholder_formats'} = {
61             summary => '',
62             params => $params,
63             returns => 'ARRAY[PlaceholderFormatModel]',
64             };
65             }
66              
67             # @return ARRAY[PlaceholderFormatModel]
68             #
69             sub placeholder_format_api_get_placeholder_formats {
70 0     0 0   my ( $self, %args ) = @_;
71              
72             # parse inputs
73 0           my $_resource_path = '/api/integration/v1/placeholders';
74              
75 0           my $_method = 'GET';
76 0           my $query_params = {};
77 0           my $header_params = {};
78 0           my $form_params = {};
79              
80             # 'Accept' and 'Content-Type' header
81             my $_header_accept = $self->{api_client}
82 0           ->select_header_accept( 'application/json', 'text/json' );
83 0 0         if ($_header_accept) {
84 0           $header_params->{'Accept'} = $_header_accept;
85             }
86             $header_params->{'Content-Type'} =
87 0           $self->{api_client}->select_header_content_type();
88              
89 0           my $_body_data;
90              
91             # authentication setting, if any
92 0           my $auth_settings = [qw()];
93              
94             # make the API Call
95             my $response = $self->{api_client}->call_api(
96 0           $_resource_path, $_method, $query_params, $form_params,
97             $header_params, $_body_data, $auth_settings
98             );
99 0 0         if ( !$response ) {
100 0           return;
101             }
102             my $_response_object = $self->{api_client}
103 0           ->deserialize( 'ARRAY[PlaceholderFormatModel]', $response );
104 0           return $_response_object;
105             }
106              
107             #
108             # placeholder_format_api_update_placeholder_formats
109             #
110             #
111             #
112             # @param ARRAY[PlaceholderFormatModel] $formats (required)
113             {
114             my $params = {
115             'formats' => {
116             data_type => 'ARRAY[PlaceholderFormatModel]',
117             description => '',
118             required => '1',
119             },
120             };
121             __PACKAGE__->method_documentation->{
122             'placeholder_format_api_update_placeholder_formats'} = {
123             summary => '',
124             params => $params,
125             returns => undef,
126             };
127             }
128              
129             # @return void
130             #
131             sub placeholder_format_api_update_placeholder_formats {
132 0     0 0   my ( $self, %args ) = @_;
133              
134             # verify the required parameter 'formats' is set
135 0 0         unless ( exists $args{'formats'} ) {
136 0           croak(
137             "Missing the required parameter 'formats' when calling placeholder_format_api_update_placeholder_formats"
138             );
139             }
140              
141             # parse inputs
142 0           my $_resource_path = '/api/integration/v1/placeholders';
143              
144 0           my $_method = 'PUT';
145 0           my $query_params = {};
146 0           my $header_params = {};
147 0           my $form_params = {};
148              
149             # 'Accept' and 'Content-Type' header
150 0           my $_header_accept = $self->{api_client}->select_header_accept();
151 0 0         if ($_header_accept) {
152 0           $header_params->{'Accept'} = $_header_accept;
153             }
154             $header_params->{'Content-Type'} = $self->{api_client}
155 0           ->select_header_content_type( 'application/json', 'text/json' );
156              
157 0           my $_body_data;
158              
159             # body params
160 0 0         if ( exists $args{'formats'} ) {
161 0           $_body_data = $args{'formats'};
162             }
163              
164             # authentication setting, if any
165 0           my $auth_settings = [qw()];
166              
167             # make the API Call
168             $self->{api_client}->call_api(
169 0           $_resource_path, $_method, $query_params, $form_params,
170             $header_params, $_body_data, $auth_settings
171             );
172 0           return;
173             }
174              
175             #
176             # placeholder_format_api_validate_placeholder_format
177             #
178             #
179             #
180             # @param string $format (required)
181             {
182             my $params = {
183             'format' => {
184             data_type => 'string',
185             description => '',
186             required => '1',
187             },
188             };
189             __PACKAGE__->method_documentation->{
190             'placeholder_format_api_validate_placeholder_format'} = {
191             summary => '',
192             params => $params,
193             returns => undef,
194             };
195             }
196              
197             # @return void
198             #
199             sub placeholder_format_api_validate_placeholder_format {
200 0     0 0   my ( $self, %args ) = @_;
201              
202             # verify the required parameter 'format' is set
203 0 0         unless ( exists $args{'format'} ) {
204 0           croak(
205             "Missing the required parameter 'format' when calling placeholder_format_api_validate_placeholder_format"
206             );
207             }
208              
209             # parse inputs
210 0           my $_resource_path = '/api/integration/v1/placeholders/validate';
211              
212 0           my $_method = 'GET';
213 0           my $query_params = {};
214 0           my $header_params = {};
215 0           my $form_params = {};
216              
217             # 'Accept' and 'Content-Type' header
218 0           my $_header_accept = $self->{api_client}->select_header_accept();
219 0 0         if ($_header_accept) {
220 0           $header_params->{'Accept'} = $_header_accept;
221             }
222             $header_params->{'Content-Type'} =
223 0           $self->{api_client}->select_header_content_type();
224              
225             # query params
226 0 0         if ( exists $args{'format'} ) {
227             $query_params->{'format'} =
228 0           $self->{api_client}->to_query_value( $args{'format'} );
229             }
230              
231 0           my $_body_data;
232              
233             # authentication setting, if any
234 0           my $auth_settings = [qw()];
235              
236             # make the API Call
237             $self->{api_client}->call_api(
238 0           $_resource_path, $_method, $query_params, $form_params,
239             $header_params, $_body_data, $auth_settings
240             );
241 0           return;
242             }
243              
244             1;