-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathAuthenticationV1Api.pm
222 lines (184 loc) · 5.96 KB
/
AuthenticationV1Api.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
=begin comment
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: v1.13.7
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 Kubernetes::AuthenticationV1Api;
require 5.6.0;
use strict;
use warnings;
use utf8;
use Exporter;
use Carp qw( croak );
use Log::Any qw($log);
use Kubernetes::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 'Kubernetes::ApiClient' ) {
$api_client = $_[0];
}
else {
$api_client = Kubernetes::ApiClient->new(@_);
}
bless { api_client => $api_client }, $class;
}
#
# create_token_review
#
#
#
# @param V1TokenReview $body (required)
# @param string $dry_run When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional)
# @param boolean $include_uninitialized If IncludeUninitialized is specified, the object may be returned without completing initialization. (optional)
# @param string $pretty If 'true', then the output is pretty printed. (optional)
{
my $params = {
'body' => {
data_type => 'V1TokenReview',
description => '',
required => '1',
},
'dry_run' => {
data_type => 'string',
description =>
'When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed',
required => '0',
},
'include_uninitialized' => {
data_type => 'boolean',
description =>
'If IncludeUninitialized is specified, the object may be returned without completing initialization.',
required => '0',
},
'pretty' => {
data_type => 'string',
description =>
'If 'true', then the output is pretty printed.',
required => '0',
},
};
__PACKAGE__->method_documentation->{'create_token_review'} = {
summary => '',
params => $params,
returns => 'V1TokenReview',
};
}
# @return V1TokenReview
#
sub create_token_review {
my ( $self, %args ) = @_;
# verify the required parameter 'body' is set
unless ( exists $args{'body'} ) {
croak(
"Missing the required parameter 'body' when calling create_token_review"
);
}
# parse inputs
my $_resource_path = '/apis/authentication.k8s.io/v1/tokenreviews';
my $_method = 'POST';
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', 'application/yaml',
'application/vnd.kubernetes.protobuf' );
if ($_header_accept) {
$header_params->{'Accept'} = $_header_accept;
}
$header_params->{'Content-Type'} =
$self->{api_client}->select_header_content_type();
# query params
if ( exists $args{'dry_run'} ) {
$query_params->{'dryRun'} =
$self->{api_client}->to_query_value( $args{'dry_run'} );
}
# query params
if ( exists $args{'include_uninitialized'} ) {
$query_params->{'includeUninitialized'} =
$self->{api_client}->to_query_value( $args{'include_uninitialized'} );
}
# query params
if ( exists $args{'pretty'} ) {
$query_params->{'pretty'} =
$self->{api_client}->to_query_value( $args{'pretty'} );
}
my $_body_data;
# body params
if ( exists $args{'body'} ) {
$_body_data = $args{'body'};
}
# authentication setting, if any
my $auth_settings = [qw(BearerToken )];
# 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( 'V1TokenReview', $response );
return $_response_object;
}
#
# get_api_resources
#
#
#
{
my $params = {};
__PACKAGE__->method_documentation->{'get_api_resources'} = {
summary => '',
params => $params,
returns => 'V1APIResourceList',
};
}
# @return V1APIResourceList
#
sub get_api_resources {
my ( $self, %args ) = @_;
# parse inputs
my $_resource_path = '/apis/authentication.k8s.io/v1/';
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', 'application/yaml',
'application/vnd.kubernetes.protobuf' );
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(BearerToken )];
# 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( 'V1APIResourceList', $response );
return $_response_object;
}
1;