├── .openapi-generator ├── VERSION ├── swagger.json.sha256 └── COMMIT ├── OWNERS ├── code-of-conduct.md ├── hack └── update-fmt.sh ├── .gitignore ├── cpanfile ├── SECURITY_CONTACTS ├── examples └── load_kubeconfig.pl ├── README.md ├── settings ├── .openapi-generator-ignore ├── CONTRIBUTING.md ├── git_push.sh └── lib └── Kubernetes ├── VersionApi.pm ├── AppsApi.pm ├── BatchApi.pm ├── PolicyApi.pm ├── ApisApi.pm ├── CoreApi.pm ├── EventsApi.pm ├── StorageApi.pm ├── AutoscalingApi.pm ├── ExtensionsApi.pm ├── SettingsApi.pm ├── NetworkingApi.pm ├── SchedulingApi.pm ├── CertificatesApi.pm ├── CoordinationApi.pm ├── ApiextensionsApi.pm ├── AuthorizationApi.pm ├── ApiregistrationApi.pm ├── AuthenticationApi.pm ├── AuditregistrationApi.pm ├── RbacAuthorizationApi.pm ├── AdmissionregistrationApi.pm ├── ApiFactory.pm ├── Util └── KubeConfig.pm ├── LogsApi.pm ├── Configuration.pm └── Object ├── V1SelfSubjectRulesReviewSpec.pm ├── V1beta1SelfSubjectRulesReviewSpec.pm ├── AppsV1beta1RollbackConfig.pm ├── ExtensionsV1beta1RollbackConfig.pm ├── V1DaemonEndpoint.pm ├── V1ScaleSpec.pm ├── V1beta2ScaleSpec.pm ├── V1Preconditions.pm ├── AppsV1beta1ScaleSpec.pm ├── V1Initializer.pm ├── ExtensionsV1beta1ScaleSpec.pm ├── V1ContainerStateRunning.pm ├── V1ServiceStatus.pm ├── PolicyV1beta1AllowedFlexVolume.pm ├── V1PodReadinessGate.pm ├── V1beta1IngressStatus.pm ├── V1SessionAffinityConfig.pm ├── V1NamespaceStatus.pm ├── V1NodeDaemonEndpoints.pm ├── V1VolumeNodeAffinity.pm ├── V1NamespaceSpec.pm └── V1APIServiceStatus.pm /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 4.0.0 -------------------------------------------------------------------------------- /.openapi-generator/swagger.json.sha256: -------------------------------------------------------------------------------- 1 | 0f55173caf075d6a063f6ab524c6b52114e8bba600b154b3f40cb4f403fbc7a6 -------------------------------------------------------------------------------- /.openapi-generator/COMMIT: -------------------------------------------------------------------------------- 1 | Requested Commit: v4.0.0 2 | Actual Commit: 37442733120ca60a5a28e765e377871da20d37d0 3 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | approvers: 4 | - yue9944882 5 | emeritus_approvers: 6 | - mbohlool 7 | -------------------------------------------------------------------------------- /code-of-conduct.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Community Code of Conduct 2 | 3 | Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) 4 | -------------------------------------------------------------------------------- /hack/update-fmt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | perltidy -b -bext="/" lib/Kubernetes/*.pm 4 | perltidy -b -bext="/" lib/Kubernetes/Object/*.pm 5 | perltidy -b -bext="/" lib/Kubernetes/Util/*.pm 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /blib/ 2 | /.build/ 3 | _build/ 4 | cover_db/ 5 | inc/ 6 | Build 7 | !Build/ 8 | Build.bat 9 | .last_cover_stats 10 | /Makefile 11 | /Makefile.old 12 | /MANIFEST.bak 13 | /META.yml 14 | /META.json 15 | /MYMETA.* 16 | nytprof.out 17 | /pm_to_blib 18 | *.o 19 | *.bs 20 | /_eumm/ 21 | swagger.json 22 | swagger.json.unprocessed 23 | bin/* 24 | .idea/** 25 | docs/** 26 | -------------------------------------------------------------------------------- /cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Carp'; 2 | requires 'JSON'; 3 | requires 'YAML::XS'; 4 | requires 'DateTime'; 5 | requires 'Log::Any'; 6 | requires 'Module::Runtime'; 7 | requires 'URI::Query'; 8 | requires 'Module::Find'; 9 | requires 'LWP::UserAgent'; 10 | requires 'LWP::Protocol::https'; 11 | requires 'Class::Accessor'; 12 | requires 'MIME::Base64'; 13 | 14 | on 'test' => sub { 15 | requires 'Test::Simple'; 16 | requires 'Test::More'; 17 | requires 'Test::Exception'; 18 | requires 'Test::Class::Moose::Load'; 19 | }; 20 | -------------------------------------------------------------------------------- /SECURITY_CONTACTS: -------------------------------------------------------------------------------- 1 | # Defined below are the security contacts for this repo. 2 | # 3 | # They are the contact point for the Product Security Committee to reach out 4 | # to for triaging and handling of incoming issues. 5 | # 6 | # The below names agree to abide by the 7 | # [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) 8 | # and will be removed and replaced if they violate that agreement. 9 | # 10 | # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE 11 | # INSTRUCTIONS AT https://kubernetes.io/security/ 12 | 13 | yue9944882 14 | -------------------------------------------------------------------------------- /examples/load_kubeconfig.pl: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings FATAL => 'all'; 3 | 4 | use Kubernetes::Util::KubeConfig; 5 | 6 | use Log::Any::Adapter ('Stdout'); 7 | use Log::Any::Adapter ('Stderr'); 8 | 9 | use Net::SSLeay; 10 | $Net::SSLeay::trace = 2; 11 | 12 | my $kubeconfig = Kubernetes::Util::KubeConfig->load_yaml_file(); 13 | 14 | my $api_factory = $kubeconfig->new_api_factory(); 15 | 16 | my $corev1_api = $api_factory->get_api('CoreV1'); 17 | 18 | my $namespaceList = $corev1_api->list_namespace(); 19 | 20 | printf "found %d namespaces:\n", scalar @{$namespaceList->items}; 21 | printf "=====================\n"; 22 | foreach my $namespace (@{$namespaceList->items}) { 23 | printf "%s\n", $namespace->metadata->name; 24 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Perl Client 2 | 3 | ![Client Support Level](https://img.shields.io/badge/kubernetes%20client-alpha-green.svg?style=plastic&colorA=306CE8) 4 | 5 | Perl client for the [Kubernetes](http://kubernetes.io/) API. 6 | 7 | ## Community, discussion, contribution, and support 8 | 9 | Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/). 10 | 11 | You can reach the maintainers of this project at: 12 | 13 | - [Slack channel](https://kubernetes.slack.com/messages/kubernetes-client) 14 | - [Mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-api-machinery) 15 | 16 | ### Code of conduct 17 | 18 | Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md). 19 | -------------------------------------------------------------------------------- /settings: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2015 The Kubernetes Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Kubernetes branch to get the OpenAPI spec from. 18 | export KUBERNETES_BRANCH="release-1.13" 19 | 20 | # client version for packaging and releasing. It can 21 | # be different than SPEC_VERSION. 22 | export CLIENT_VERSION="1.0-SNAPSHOT" 23 | 24 | # Name of the release package 25 | export PACKAGE_NAME="Kubernetes" 26 | 27 | -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | 25 | .gitignore 26 | lib/Kubernetes/ApiClient.pm 27 | lib/Kubernetes/Util/** 28 | README.md 29 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://git.k8s.io/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt: 4 | 5 | _As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._ 6 | 7 | ## Getting Started 8 | 9 | We have full documentation on how to get started contributing here: 10 | 11 | 14 | 15 | - [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests 16 | - [Kubernetes Contributor Guide](https://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](https://git.k8s.io/community/contributors/guide#contributing) 17 | - [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers 18 | 19 | ## Mentorship 20 | 21 | - [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! 22 | 23 | ## Contact Information 24 | 25 | - [Slack channel](https://kubernetes.slack.com/messages/kubernetes-client) 26 | - [Mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-api-machinery) 27 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | 10 | if [ "$git_user_id" = "" ]; then 11 | git_user_id="kubernetes-client" 12 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 13 | fi 14 | 15 | if [ "$git_repo_id" = "" ]; then 16 | git_repo_id="perl" 17 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 18 | fi 19 | 20 | if [ "$release_note" = "" ]; then 21 | release_note="Minor update" 22 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 23 | fi 24 | 25 | # Initialize the local directory as a Git repository 26 | git init 27 | 28 | # Adds the files in the local repository and stages them for commit. 29 | git add . 30 | 31 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 32 | git commit -m "$release_note" 33 | 34 | # Sets the new remote 35 | git_remote=`git remote` 36 | if [ "$git_remote" = "" ]; then # git remote not defined 37 | 38 | if [ "$GIT_TOKEN" = "" ]; then 39 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 40 | git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git 41 | else 42 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git 43 | fi 44 | 45 | fi 46 | 47 | git pull origin master 48 | 49 | # Pushes (Forces) the changes in the local repository up to the remote repository 50 | echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" 51 | git push origin master 2>&1 | grep -v 'To https' 52 | 53 | -------------------------------------------------------------------------------- /lib/Kubernetes/VersionApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::VersionApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_code 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_code'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'VersionInfo', 63 | }; 64 | } 65 | 66 | # @return VersionInfo 67 | # 68 | sub get_code { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/version/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client}->select_header_accept('application/json'); 82 | if ($_header_accept) { 83 | $header_params->{'Accept'} = $_header_accept; 84 | } 85 | $header_params->{'Content-Type'} = 86 | $self->{api_client}->select_header_content_type(); 87 | 88 | my $_body_data; 89 | 90 | # authentication setting, if any 91 | my $auth_settings = [qw(BearerToken )]; 92 | 93 | # make the API Call 94 | my $response = $self->{api_client}->call_api( 95 | $_resource_path, $_method, $query_params, $form_params, 96 | $header_params, $_body_data, $auth_settings 97 | ); 98 | if ( !$response ) { 99 | return; 100 | } 101 | my $_response_object = 102 | $self->{api_client}->deserialize( 'VersionInfo', $response ); 103 | return $_response_object; 104 | } 105 | 106 | 1; 107 | -------------------------------------------------------------------------------- /lib/Kubernetes/AppsApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::AppsApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/apps/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/BatchApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::BatchApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/batch/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/PolicyApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::PolicyApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/policy/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/ApisApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::ApisApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_versions 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_versions'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroupList', 63 | }; 64 | } 65 | 66 | # @return V1APIGroupList 67 | # 68 | sub get_api_versions { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroupList', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/CoreApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::CoreApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_versions 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_versions'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIVersions', 63 | }; 64 | } 65 | 66 | # @return V1APIVersions 67 | # 68 | sub get_api_versions { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/api/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIVersions', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/EventsApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::EventsApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/events.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/StorageApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::StorageApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/storage.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/AutoscalingApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::AutoscalingApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/autoscaling/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/ExtensionsApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::ExtensionsApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/extensions/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/SettingsApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::SettingsApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/settings.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/NetworkingApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::NetworkingApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/networking.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/SchedulingApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::SchedulingApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/scheduling.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/CertificatesApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::CertificatesApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/certificates.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/CoordinationApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::CoordinationApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/coordination.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/ApiextensionsApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::ApiextensionsApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/apiextensions.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/AuthorizationApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::AuthorizationApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/authorization.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/ApiregistrationApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::ApiregistrationApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/apiregistration.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/AuthenticationApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::AuthenticationApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/authentication.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/AuditregistrationApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::AuditregistrationApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/auditregistration.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/RbacAuthorizationApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::RbacAuthorizationApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/rbac.authorization.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/AdmissionregistrationApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::AdmissionregistrationApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # get_api_group 54 | # 55 | # 56 | # 57 | { 58 | my $params = {}; 59 | __PACKAGE__->method_documentation->{'get_api_group'} = { 60 | summary => '', 61 | params => $params, 62 | returns => 'V1APIGroup', 63 | }; 64 | } 65 | 66 | # @return V1APIGroup 67 | # 68 | sub get_api_group { 69 | my ( $self, %args ) = @_; 70 | 71 | # parse inputs 72 | my $_resource_path = '/apis/admissionregistration.k8s.io/'; 73 | 74 | my $_method = 'GET'; 75 | my $query_params = {}; 76 | my $header_params = {}; 77 | my $form_params = {}; 78 | 79 | # 'Accept' and 'Content-Type' header 80 | my $_header_accept = 81 | $self->{api_client} 82 | ->select_header_accept( 'application/json', 'application/yaml', 83 | 'application/vnd.kubernetes.protobuf' ); 84 | if ($_header_accept) { 85 | $header_params->{'Accept'} = $_header_accept; 86 | } 87 | $header_params->{'Content-Type'} = 88 | $self->{api_client}->select_header_content_type(); 89 | 90 | my $_body_data; 91 | 92 | # authentication setting, if any 93 | my $auth_settings = [qw(BearerToken )]; 94 | 95 | # make the API Call 96 | my $response = $self->{api_client}->call_api( 97 | $_resource_path, $_method, $query_params, $form_params, 98 | $header_params, $_body_data, $auth_settings 99 | ); 100 | if ( !$response ) { 101 | return; 102 | } 103 | my $_response_object = 104 | $self->{api_client}->deserialize( 'V1APIGroup', $response ); 105 | return $_response_object; 106 | } 107 | 108 | 1; 109 | -------------------------------------------------------------------------------- /lib/Kubernetes/ApiFactory.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::ApiFactory; 22 | 23 | use strict; 24 | use warnings; 25 | use utf8; 26 | 27 | use Carp; 28 | use Module::Find; 29 | 30 | usesub Kubernetes::Object; 31 | 32 | use Kubernetes::ApiClient; 33 | 34 | =head1 Name 35 | 36 | Kubernetes::ApiFactory - constructs APIs to retrieve Kubernetes objects 37 | 38 | =head1 Synopsis 39 | 40 | package My::Petstore::App; 41 | 42 | use Kubernetes::ApiFactory; 43 | 44 | my $api_factory = Kubernetes::ApiFactory->new( ... ); # any args for ApiClient constructor 45 | 46 | # later... 47 | my $pet_api = $api_factory->get_api('Pet'); 48 | 49 | # $pet_api isa Kubernetes::PetApi 50 | 51 | my $pet = $pet_api->get_pet_by_id(pet_id => $pet_id); 52 | 53 | # object attributes have proper accessors: 54 | printf "Pet's name is %s", $pet->name; 55 | 56 | # change the value stored on the object: 57 | $pet->name('Dave'); 58 | 59 | =cut 60 | 61 | # Load all the API classes and construct a lookup table at startup time 62 | my %_apis = map { $_ =~ /^Kubernetes::(.*)$/; $1 => $_ } 63 | grep { $_ =~ /Api$/ } usesub 'Kubernetes'; 64 | 65 | =head1 new($api_client) 66 | 67 | create a new Kubernetes::ApiFactory instance with the given Kubernetes::ApiClient instance. 68 | 69 | =head1 new(%parameters) 70 | 71 | Any parameters are optional, and are passed to and stored on the api_client object. 72 | 73 | See L and L for valid parameters 74 | 75 | =cut 76 | 77 | sub new { 78 | my ($class) = shift; 79 | 80 | my $api_client; 81 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 82 | $api_client = $_[0]; 83 | } 84 | else { 85 | $api_client = Kubernetes::ApiClient->new(@_); 86 | } 87 | bless { api_client => $api_client }, $class; 88 | } 89 | 90 | =head1 get_api($which) 91 | 92 | Returns an API object of the requested type. 93 | 94 | $which is a nickname for the class: 95 | 96 | FooBarClient::BazApi has nickname 'Baz' 97 | 98 | =cut 99 | 100 | sub get_api { 101 | my ( $self, $which ) = @_; 102 | croak "API not specified" unless $which; 103 | my $api_class = $_apis{"${which}Api"} || croak "No known API for '$which'"; 104 | return $api_class->new( $self->api_client ); 105 | } 106 | 107 | =head1 api_client() 108 | 109 | Returns the api_client object, should you ever need it. 110 | 111 | =cut 112 | 113 | sub api_client { $_[0]->{api_client} } 114 | 115 | =head1 apis_available() 116 | =cut 117 | 118 | sub apis_available { 119 | return map { $_ =~ s/Api$//; $_ } sort keys %_apis; 120 | } 121 | 122 | =head1 classname_for() 123 | =cut 124 | 125 | sub classname_for { 126 | my ( $self, $api_name ) = @_; 127 | return $_apis{"${api_name}Api"}; 128 | } 129 | 130 | 1; 131 | -------------------------------------------------------------------------------- /lib/Kubernetes/Util/KubeConfig.pm: -------------------------------------------------------------------------------- 1 | package Kubernetes::Util::KubeConfig; 2 | 3 | use strict; 4 | use warnings FATAL => 'all'; 5 | use Carp; 6 | 7 | use YAML::XS qw(Load LoadFile); 8 | use MIME::Base64; 9 | use Kubernetes::ApiClient; 10 | use Kubernetes::ApiFactory; 11 | use IO::Socket::SSL; 12 | use Log::Any qw($log); 13 | use IO::Socket::SSL::Utils; 14 | 15 | use base 'Exporter'; 16 | 17 | our @EXPORT = qw( 18 | load_yaml_file 19 | load_yaml 20 | new_api_factory 21 | ); 22 | 23 | sub load_yaml_file { 24 | my ( $self, $yaml_file_path ) = @_; 25 | 26 | if ( not defined $yaml_file_path ) { 27 | $log->debugf('Defaulting Kube-Config file path to $HOME/.kube/config'); 28 | $yaml_file_path = $ENV{HOME} . '/.kube/config'; 29 | } 30 | 31 | die "$yaml_file_path doesn't exist!" if not -e $yaml_file_path; 32 | 33 | my $kubeconfig = LoadFile($yaml_file_path); 34 | bless $kubeconfig => $self; 35 | 36 | $kubeconfig->validate; 37 | 38 | return $kubeconfig; 39 | } 40 | 41 | sub load_yaml { 42 | my ( $self, $yaml_str ) = @_; 43 | 44 | if ( not defined $yaml_str ) { 45 | return undef; 46 | } 47 | 48 | my $kubeconfig = Load($yaml_str); 49 | bless $kubeconfig => $self; 50 | 51 | $kubeconfig->validate; 52 | 53 | return $kubeconfig; 54 | } 55 | 56 | sub validate { 57 | my ($self) = @_; 58 | if ( not defined $self->{apiVersion} || $self->{apiVersion} ne 'v1' ) { 59 | die "Invalid Kube-Config content: ('apiVersion' is not 'v1')"; 60 | } 61 | if ( not defined $self->{kind} || $self->{kind} ne 'Config' ) { 62 | die "Invalid Kube-Config content: ('kind' is not 'v1')"; 63 | } 64 | if ( not defined $self->{contexts} ) { 65 | die "Invalid Kube-Config content: missing 'contexts' section"; 66 | } 67 | if ( not defined $self->{clusters} ) { 68 | die "Invalid Kube-Config content: missing 'clusters' section"; 69 | } 70 | if ( not defined $self->{users} ) { 71 | die "Invalid Kube-Config content: missing 'users' section"; 72 | } 73 | if ( not defined $self->{'current-context'} ) { 74 | die "Invalid Kube-Config content: missing 'current-context' section"; 75 | } 76 | } 77 | 78 | sub new_api_factory { 79 | my ($self) = @_; 80 | 81 | my $context_name = $self->{'current-context'}; 82 | my $cluster_name; 83 | my $user_name; 84 | 85 | foreach my $ctx ( @{ $self->{contexts} } ) { 86 | if ( $context_name eq $ctx->{name} ) { 87 | $cluster_name = $ctx->{context}->{cluster}; 88 | $user_name = $ctx->{context}->{user}; 89 | } 90 | } 91 | 92 | my $current_cluster; 93 | foreach my $cluster ( @{ $self->{clusters} } ) { 94 | if ( $cluster_name eq $cluster->{name} ) { 95 | $current_cluster = $cluster; 96 | } 97 | } 98 | 99 | my $current_user; 100 | foreach my $user ( @{ $self->{users} } ) { 101 | if ( $user_name eq $user->{name} ) { 102 | $current_user = $user; 103 | } 104 | } 105 | 106 | my %ssl_opts; 107 | 108 | my $skip_tls_verify = 109 | $current_cluster->{cluster}->{'insecure-skip-tls-verify'}; 110 | 111 | if ( defined $skip_tls_verify && $skip_tls_verify == 1 ) { 112 | $ssl_opts{verify_hostname} = 0; 113 | $ssl_opts{SSL_verify_mode} = IO::Socket::SSL::SSL_VERIFY_NONE; 114 | } 115 | else { 116 | # print Dumper($current_cluster); 117 | $ssl_opts{SSL_ca} = [ 118 | PEM_string2cert( 119 | decode_base64( 120 | $current_cluster->{cluster}->{'certificate-authority-data'} 121 | ) 122 | ) 123 | ]; 124 | $ssl_opts{SSL_use_cert} = 1; 125 | } 126 | 127 | $ssl_opts{SSL_cert} = PEM_string2cert( 128 | decode_base64( $current_user->{user}->{'client-certificate-data'} ) ); 129 | $ssl_opts{SSL_key} = PEM_string2key( 130 | decode_base64( $current_user->{user}->{'client-key-data'} ) ); 131 | 132 | return Kubernetes::ApiFactory->new( 133 | base_url => $current_cluster->{cluster}->{server}, 134 | ssl_opts => \%ssl_opts, 135 | ); 136 | } 137 | 138 | 1; 139 | -------------------------------------------------------------------------------- /lib/Kubernetes/LogsApi.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::LogsApi; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use Exporter; 28 | use Carp qw( croak ); 29 | use Log::Any qw($log); 30 | 31 | use Kubernetes::ApiClient; 32 | 33 | use base "Class::Data::Inheritable"; 34 | 35 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 36 | 37 | sub new { 38 | my $class = shift; 39 | my $api_client; 40 | 41 | if ( $_[0] && ref $_[0] && ref $_[0] eq 'Kubernetes::ApiClient' ) { 42 | $api_client = $_[0]; 43 | } 44 | else { 45 | $api_client = Kubernetes::ApiClient->new(@_); 46 | } 47 | 48 | bless { api_client => $api_client }, $class; 49 | 50 | } 51 | 52 | # 53 | # log_file_handler 54 | # 55 | # 56 | # 57 | # @param string $logpath path to the log (required) 58 | { 59 | my $params = { 60 | 'logpath' => { 61 | data_type => 'string', 62 | description => 'path to the log', 63 | required => '1', 64 | }, 65 | }; 66 | __PACKAGE__->method_documentation->{'log_file_handler'} = { 67 | summary => '', 68 | params => $params, 69 | returns => undef, 70 | }; 71 | } 72 | 73 | # @return void 74 | # 75 | sub log_file_handler { 76 | my ( $self, %args ) = @_; 77 | 78 | # verify the required parameter 'logpath' is set 79 | unless ( exists $args{'logpath'} ) { 80 | croak( 81 | "Missing the required parameter 'logpath' when calling log_file_handler" 82 | ); 83 | } 84 | 85 | # parse inputs 86 | my $_resource_path = '/logs/{logpath}'; 87 | 88 | my $_method = 'GET'; 89 | my $query_params = {}; 90 | my $header_params = {}; 91 | my $form_params = {}; 92 | 93 | # 'Accept' and 'Content-Type' header 94 | my $_header_accept = $self->{api_client}->select_header_accept(); 95 | if ($_header_accept) { 96 | $header_params->{'Accept'} = $_header_accept; 97 | } 98 | $header_params->{'Content-Type'} = 99 | $self->{api_client}->select_header_content_type(); 100 | 101 | # path params 102 | if ( exists $args{'logpath'} ) { 103 | my $_base_variable = "{" . "logpath" . "}"; 104 | my $_base_value = 105 | $self->{api_client}->to_path_value( $args{'logpath'} ); 106 | $_resource_path =~ s/$_base_variable/$_base_value/g; 107 | } 108 | 109 | my $_body_data; 110 | 111 | # authentication setting, if any 112 | my $auth_settings = [qw(BearerToken )]; 113 | 114 | # make the API Call 115 | $self->{api_client}->call_api( 116 | $_resource_path, $_method, $query_params, $form_params, 117 | $header_params, $_body_data, $auth_settings 118 | ); 119 | return; 120 | } 121 | 122 | # 123 | # log_file_list_handler 124 | # 125 | # 126 | # 127 | { 128 | my $params = {}; 129 | __PACKAGE__->method_documentation->{'log_file_list_handler'} = { 130 | summary => '', 131 | params => $params, 132 | returns => undef, 133 | }; 134 | } 135 | 136 | # @return void 137 | # 138 | sub log_file_list_handler { 139 | my ( $self, %args ) = @_; 140 | 141 | # parse inputs 142 | my $_resource_path = '/logs/'; 143 | 144 | my $_method = 'GET'; 145 | my $query_params = {}; 146 | my $header_params = {}; 147 | my $form_params = {}; 148 | 149 | # 'Accept' and 'Content-Type' header 150 | my $_header_accept = $self->{api_client}->select_header_accept(); 151 | if ($_header_accept) { 152 | $header_params->{'Accept'} = $_header_accept; 153 | } 154 | $header_params->{'Content-Type'} = 155 | $self->{api_client}->select_header_content_type(); 156 | 157 | my $_body_data; 158 | 159 | # authentication setting, if any 160 | my $auth_settings = [qw(BearerToken )]; 161 | 162 | # make the API Call 163 | $self->{api_client}->call_api( 164 | $_resource_path, $_method, $query_params, $form_params, 165 | $header_params, $_body_data, $auth_settings 166 | ); 167 | return; 168 | } 169 | 170 | 1; 171 | -------------------------------------------------------------------------------- /lib/Kubernetes/Configuration.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Configuration; 22 | 23 | use strict; 24 | use warnings; 25 | use utf8; 26 | 27 | use Log::Any qw($log); 28 | use Carp; 29 | 30 | use constant VERSION => '1.0.0'; 31 | 32 | =head1 Name 33 | 34 | Kubernetes::Configuration - holds the configuration for all Kubernetes Modules 35 | 36 | =head1 new(%parameters) 37 | 38 | =over 4 39 | 40 | =item http_timeout: (optional) 41 | 42 | Integer. timeout for HTTP requests in seconds 43 | 44 | default: 180 45 | 46 | =item http_user_agent: (optional) 47 | 48 | String. custom UserAgent header 49 | 50 | default: OpenAPI-Generator/1.0.0/perl 51 | 52 | =item api_key: (optional) 53 | 54 | Hashref. Keyed on the name of each key (there can be multiple tokens). 55 | 56 | api_key => { 57 | secretKey => 'aaaabbbbccccdddd', 58 | anotherKey => '1111222233334444', 59 | }; 60 | 61 | =item api_key_prefix: (optional) 62 | 63 | Hashref. Keyed on the name of each key (there can be multiple tokens). Note not all api keys require a prefix. 64 | 65 | api_key_prefix => { 66 | secretKey => 'string', 67 | anotherKey => 'same or some other string', 68 | }; 69 | 70 | =item api_key_in: (optional) 71 | 72 | =item username: (optional) 73 | 74 | String. The username for basic auth. 75 | 76 | =item password: (optional) 77 | 78 | String. The password for basic auth. 79 | 80 | =item access_token: (optional) 81 | 82 | String. The OAuth access token. 83 | 84 | =item base_url: (optional) 85 | 86 | String. The base URL of the API 87 | 88 | default: http://localhost 89 | 90 | =back 91 | 92 | =cut 93 | 94 | sub new { 95 | my ( $self, %p ) = ( shift, @_ ); 96 | 97 | # class/static variables 98 | $p{http_timeout} //= 180; 99 | $p{http_user_agent} //= 'OpenAPI-Generator/1.0.0/perl'; 100 | 101 | # authentication setting 102 | $p{api_key} //= {}; 103 | $p{api_key_prefix} //= {}; 104 | $p{api_key_in} //= {}; 105 | 106 | # username and password for HTTP basic authentication 107 | $p{username} //= ''; 108 | $p{password} //= ''; 109 | 110 | # access token for OAuth 111 | $p{access_token} //= ''; 112 | 113 | # base_url 114 | $p{base_url} //= 'http://localhost'; 115 | 116 | return bless \%p => $self; 117 | } 118 | 119 | sub get_tokens { 120 | my $self = shift; 121 | 122 | my $tokens = {}; 123 | $tokens->{username} = $self->{username} if $self->{username}; 124 | $tokens->{password} = $self->{password} if $self->{password}; 125 | $tokens->{access_token} = $self->{access_token} if $self->{access_token}; 126 | 127 | foreach my $token_name ( keys %{ $self->{api_key} } ) { 128 | $tokens->{$token_name}->{token} = $self->{api_key}{$token_name}; 129 | $tokens->{$token_name}->{prefix} = $self->{api_key_prefix}{$token_name}; 130 | $tokens->{$token_name}->{in} = $self->{api_key_in}{$token_name}; 131 | } 132 | 133 | return $tokens; 134 | } 135 | 136 | sub clear_tokens { 137 | my $self = shift; 138 | my %tokens = %{ $self->get_tokens }; # copy 139 | 140 | $self->{username} = ''; 141 | $self->{password} = ''; 142 | $self->{access_token} = ''; 143 | 144 | $self->{api_key} = {}; 145 | $self->{api_key_prefix} = {}; 146 | $self->{api_key_in} = {}; 147 | 148 | return \%tokens; 149 | } 150 | 151 | sub accept_tokens { 152 | my ( $self, $tokens ) = @_; 153 | 154 | foreach my $known_name (qw(username password access_token)) { 155 | next unless $tokens->{$known_name}; 156 | $self->{$known_name} = delete $tokens->{$known_name}; 157 | } 158 | 159 | foreach my $token_name ( keys %$tokens ) { 160 | $self->{api_key}{$token_name} = $tokens->{$token_name}{token}; 161 | if ( $tokens->{$token_name}{prefix} ) { 162 | $self->{api_key_prefix}{$token_name} = 163 | $tokens->{$token_name}{prefix}; 164 | } 165 | my $in = $tokens->{$token_name}->{in} || 'head'; 166 | croak "Tokens can only go in 'head' or 'query' (not in '$in')" 167 | unless $in =~ /^(?:head|query)$/; 168 | $self->{api_key_in}{$token_name} = $in; 169 | } 170 | } 171 | 172 | 1; 173 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1SelfSubjectRulesReviewSpec.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1SelfSubjectRulesReviewSpec; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | # 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => '', 168 | class => 'V1SelfSubjectRulesReviewSpec', 169 | required => [], # TODO 170 | } 171 | ); 172 | 173 | __PACKAGE__->method_documentation( 174 | { 175 | 'namespace' => { 176 | datatype => 'string', 177 | base_name => 'namespace', 178 | description => 'Namespace to evaluate rules for. Required.', 179 | format => '', 180 | read_only => '', 181 | }, 182 | } 183 | ); 184 | 185 | __PACKAGE__->openapi_types( 186 | { 187 | 'namespace' => 'string' 188 | } 189 | ); 190 | 191 | __PACKAGE__->attribute_map( 192 | { 193 | 'namespace' => 'namespace' 194 | } 195 | ); 196 | 197 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 198 | 199 | 1; 200 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1beta1SelfSubjectRulesReviewSpec.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1beta1SelfSubjectRulesReviewSpec; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | # 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => '', 168 | class => 'V1beta1SelfSubjectRulesReviewSpec', 169 | required => [], # TODO 170 | } 171 | ); 172 | 173 | __PACKAGE__->method_documentation( 174 | { 175 | 'namespace' => { 176 | datatype => 'string', 177 | base_name => 'namespace', 178 | description => 'Namespace to evaluate rules for. Required.', 179 | format => '', 180 | read_only => '', 181 | }, 182 | } 183 | ); 184 | 185 | __PACKAGE__->openapi_types( 186 | { 187 | 'namespace' => 'string' 188 | } 189 | ); 190 | 191 | __PACKAGE__->attribute_map( 192 | { 193 | 'namespace' => 'namespace' 194 | } 195 | ); 196 | 197 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 198 | 199 | 1; 200 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/AppsV1beta1RollbackConfig.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::AppsV1beta1RollbackConfig; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #DEPRECATED. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 'DEPRECATED.', 168 | class => 'AppsV1beta1RollbackConfig', 169 | required => [], # TODO 170 | } 171 | ); 172 | 173 | __PACKAGE__->method_documentation( 174 | { 175 | 'revision' => { 176 | datatype => 'int', 177 | base_name => 'revision', 178 | description => 179 | 'The revision to rollback to. If set to 0, rollback to the last revision.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'revision' => 'int' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'revision' => 'revision' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/ExtensionsV1beta1RollbackConfig.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::ExtensionsV1beta1RollbackConfig; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #DEPRECATED. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 'DEPRECATED.', 168 | class => 'ExtensionsV1beta1RollbackConfig', 169 | required => [], # TODO 170 | } 171 | ); 172 | 173 | __PACKAGE__->method_documentation( 174 | { 175 | 'revision' => { 176 | datatype => 'int', 177 | base_name => 'revision', 178 | description => 179 | 'The revision to rollback to. If set to 0, rollback to the last revision.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'revision' => 'int' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'revision' => 'revision' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1DaemonEndpoint.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1DaemonEndpoint; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #DaemonEndpoint contains information about a single Daemon endpoint. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'DaemonEndpoint contains information about a single Daemon endpoint.', 169 | class => 'V1DaemonEndpoint', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'port' => { 177 | datatype => 'int', 178 | base_name => 'Port', 179 | description => 'Port number of the given endpoint.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'port' => 'int' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'port' => 'Port' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1ScaleSpec.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1ScaleSpec; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #ScaleSpec describes the attributes of a scale subresource. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'ScaleSpec describes the attributes of a scale subresource.', 169 | class => 'V1ScaleSpec', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'replicas' => { 177 | datatype => 'int', 178 | base_name => 'replicas', 179 | description => 'desired number of instances for the scaled object.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'replicas' => 'int' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'replicas' => 'replicas' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1beta2ScaleSpec.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1beta2ScaleSpec; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #ScaleSpec describes the attributes of a scale subresource 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'ScaleSpec describes the attributes of a scale subresource', 169 | class => 'V1beta2ScaleSpec', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'replicas' => { 177 | datatype => 'int', 178 | base_name => 'replicas', 179 | description => 'desired number of instances for the scaled object.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'replicas' => 'int' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'replicas' => 'replicas' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1Preconditions.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1Preconditions; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.', 169 | class => 'V1Preconditions', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'uid' => { 177 | datatype => 'string', 178 | base_name => 'uid', 179 | description => 'Specifies the target UID.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'uid' => 'string' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'uid' => 'uid' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/AppsV1beta1ScaleSpec.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::AppsV1beta1ScaleSpec; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #ScaleSpec describes the attributes of a scale subresource 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'ScaleSpec describes the attributes of a scale subresource', 169 | class => 'AppsV1beta1ScaleSpec', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'replicas' => { 177 | datatype => 'int', 178 | base_name => 'replicas', 179 | description => 'desired number of instances for the scaled object.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'replicas' => 'int' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'replicas' => 'replicas' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1Initializer.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1Initializer; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #Initializer is information about an initializer that has not yet completed. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'Initializer is information about an initializer that has not yet completed.', 169 | class => 'V1Initializer', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'name' => { 177 | datatype => 'string', 178 | base_name => 'name', 179 | description => 180 | 'name of the process that is responsible for initializing this object.', 181 | format => '', 182 | read_only => '', 183 | }, 184 | } 185 | ); 186 | 187 | __PACKAGE__->openapi_types( 188 | { 189 | 'name' => 'string' 190 | } 191 | ); 192 | 193 | __PACKAGE__->attribute_map( 194 | { 195 | 'name' => 'name' 196 | } 197 | ); 198 | 199 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 200 | 201 | 1; 202 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/ExtensionsV1beta1ScaleSpec.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::ExtensionsV1beta1ScaleSpec; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #describes the attributes of a scale subresource 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 'describes the attributes of a scale subresource', 168 | class => 'ExtensionsV1beta1ScaleSpec', 169 | required => [], # TODO 170 | } 171 | ); 172 | 173 | __PACKAGE__->method_documentation( 174 | { 175 | 'replicas' => { 176 | datatype => 'int', 177 | base_name => 'replicas', 178 | description => 'desired number of instances for the scaled object.', 179 | format => '', 180 | read_only => '', 181 | }, 182 | } 183 | ); 184 | 185 | __PACKAGE__->openapi_types( 186 | { 187 | 'replicas' => 'int' 188 | } 189 | ); 190 | 191 | __PACKAGE__->attribute_map( 192 | { 193 | 'replicas' => 'replicas' 194 | } 195 | ); 196 | 197 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 198 | 199 | 1; 200 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1ContainerStateRunning.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1ContainerStateRunning; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #ContainerStateRunning is a running state of a container. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'ContainerStateRunning is a running state of a container.', 169 | class => 'V1ContainerStateRunning', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'started_at' => { 177 | datatype => 'DateTime', 178 | base_name => 'startedAt', 179 | description => 'Time at which the container was last (re-)started', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'started_at' => 'DateTime' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'started_at' => 'startedAt' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1ServiceStatus.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1ServiceStatus; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use Kubernetes::Object::V1LoadBalancerStatus; 35 | 36 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 37 | 38 | # 39 | #ServiceStatus represents the current status of a service. 40 | # 41 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 42 | # REF: https://openapi-generator.tech 43 | # 44 | 45 | =begin comment 46 | 47 | Kubernetes 48 | 49 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 50 | 51 | The version of the OpenAPI document: v1.13.7 52 | 53 | Generated by: https://openapi-generator.tech 54 | 55 | =end comment 56 | 57 | =cut 58 | 59 | # 60 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 61 | # Do not edit the class manually. 62 | # Ref: https://openapi-generator.tech 63 | # 64 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 65 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 66 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 67 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 68 | 69 | # new plain object 70 | sub new { 71 | my ( $class, %args ) = @_; 72 | 73 | my $self = bless {}, $class; 74 | 75 | $self->init(%args); 76 | 77 | return $self; 78 | } 79 | 80 | # initialize the object 81 | sub init { 82 | my ( $self, %args ) = @_; 83 | 84 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 85 | my $args_key = $self->attribute_map->{$attribute}; 86 | $self->$attribute( $args{$args_key} ); 87 | } 88 | } 89 | 90 | # return perl hash 91 | sub to_hash { 92 | my $self = shift; 93 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 94 | 95 | return $_hash; 96 | } 97 | 98 | # used by JSON for serialization 99 | sub TO_JSON { 100 | my $self = shift; 101 | my $_data = {}; 102 | foreach my $_key ( keys %{ $self->attribute_map } ) { 103 | if ( defined $self->{$_key} ) { 104 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 105 | } 106 | } 107 | 108 | return $_data; 109 | } 110 | 111 | # from Perl hashref 112 | sub from_hash { 113 | my ( $self, $hash ) = @_; 114 | 115 | # loop through attributes and use openapi_types to deserialize the data 116 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 117 | my $_json_attribute = $self->attribute_map->{$_key}; 118 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 119 | my $_subclass = $1; 120 | my @_array = (); 121 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 122 | push @_array, $self->_deserialize( $_subclass, $_element ); 123 | } 124 | $self->{$_key} = \@_array; 125 | } 126 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 127 | my $_subclass = $1; 128 | my %_hash = (); 129 | while ( my ( $_key, $_element ) = 130 | each %{ $hash->{$_json_attribute} } ) 131 | { 132 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 133 | } 134 | $self->{$_key} = \%_hash; 135 | } 136 | elsif ( exists $hash->{$_json_attribute} ) 137 | { #hash(model), primitive, datetime 138 | $self->{$_key} = 139 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 140 | } 141 | else { 142 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 143 | $_key, $_json_attribute ); 144 | } 145 | } 146 | 147 | return $self; 148 | } 149 | 150 | # deserialize non-array data 151 | sub _deserialize { 152 | my ( $self, $type, $data ) = @_; 153 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 154 | 155 | if ( $type eq 'DateTime' ) { 156 | return DateTime->from_epoch( epoch => str2time($data) ); 157 | } 158 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 159 | return $data; 160 | } 161 | else { # hash(model) 162 | my $_instance = eval "Kubernetes::Object::$type->new()"; 163 | return $_instance->from_hash($data); 164 | } 165 | } 166 | 167 | __PACKAGE__->class_documentation( 168 | { 169 | description => 170 | 'ServiceStatus represents the current status of a service.', 171 | class => 'V1ServiceStatus', 172 | required => [], # TODO 173 | } 174 | ); 175 | 176 | __PACKAGE__->method_documentation( 177 | { 178 | 'load_balancer' => { 179 | datatype => 'V1LoadBalancerStatus', 180 | base_name => 'loadBalancer', 181 | description => '', 182 | format => '', 183 | read_only => '', 184 | }, 185 | } 186 | ); 187 | 188 | __PACKAGE__->openapi_types( 189 | { 190 | 'load_balancer' => 'V1LoadBalancerStatus' 191 | } 192 | ); 193 | 194 | __PACKAGE__->attribute_map( 195 | { 196 | 'load_balancer' => 'loadBalancer' 197 | } 198 | ); 199 | 200 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 201 | 202 | 1; 203 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/PolicyV1beta1AllowedFlexVolume.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::PolicyV1beta1AllowedFlexVolume; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #AllowedFlexVolume represents a single Flexvolume that is allowed to be used. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'AllowedFlexVolume represents a single Flexvolume that is allowed to be used.', 169 | class => 'PolicyV1beta1AllowedFlexVolume', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'driver' => { 177 | datatype => 'string', 178 | base_name => 'driver', 179 | description => 'driver is the name of the Flexvolume driver.', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'driver' => 'string' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'driver' => 'driver' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1PodReadinessGate.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1PodReadinessGate; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #PodReadinessGate contains the reference to a pod condition 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'PodReadinessGate contains the reference to a pod condition', 169 | class => 'V1PodReadinessGate', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'condition_type' => { 177 | datatype => 'string', 178 | base_name => 'conditionType', 179 | description => 180 | 'ConditionType refers to a condition in the pod's condition list with matching type.', 181 | format => '', 182 | read_only => '', 183 | }, 184 | } 185 | ); 186 | 187 | __PACKAGE__->openapi_types( 188 | { 189 | 'condition_type' => 'string' 190 | } 191 | ); 192 | 193 | __PACKAGE__->attribute_map( 194 | { 195 | 'condition_type' => 'conditionType' 196 | } 197 | ); 198 | 199 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 200 | 201 | 1; 202 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1beta1IngressStatus.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1beta1IngressStatus; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use Kubernetes::Object::V1LoadBalancerStatus; 35 | 36 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 37 | 38 | # 39 | #IngressStatus describe the current state of the Ingress. 40 | # 41 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 42 | # REF: https://openapi-generator.tech 43 | # 44 | 45 | =begin comment 46 | 47 | Kubernetes 48 | 49 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 50 | 51 | The version of the OpenAPI document: v1.13.7 52 | 53 | Generated by: https://openapi-generator.tech 54 | 55 | =end comment 56 | 57 | =cut 58 | 59 | # 60 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 61 | # Do not edit the class manually. 62 | # Ref: https://openapi-generator.tech 63 | # 64 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 65 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 66 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 67 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 68 | 69 | # new plain object 70 | sub new { 71 | my ( $class, %args ) = @_; 72 | 73 | my $self = bless {}, $class; 74 | 75 | $self->init(%args); 76 | 77 | return $self; 78 | } 79 | 80 | # initialize the object 81 | sub init { 82 | my ( $self, %args ) = @_; 83 | 84 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 85 | my $args_key = $self->attribute_map->{$attribute}; 86 | $self->$attribute( $args{$args_key} ); 87 | } 88 | } 89 | 90 | # return perl hash 91 | sub to_hash { 92 | my $self = shift; 93 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 94 | 95 | return $_hash; 96 | } 97 | 98 | # used by JSON for serialization 99 | sub TO_JSON { 100 | my $self = shift; 101 | my $_data = {}; 102 | foreach my $_key ( keys %{ $self->attribute_map } ) { 103 | if ( defined $self->{$_key} ) { 104 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 105 | } 106 | } 107 | 108 | return $_data; 109 | } 110 | 111 | # from Perl hashref 112 | sub from_hash { 113 | my ( $self, $hash ) = @_; 114 | 115 | # loop through attributes and use openapi_types to deserialize the data 116 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 117 | my $_json_attribute = $self->attribute_map->{$_key}; 118 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 119 | my $_subclass = $1; 120 | my @_array = (); 121 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 122 | push @_array, $self->_deserialize( $_subclass, $_element ); 123 | } 124 | $self->{$_key} = \@_array; 125 | } 126 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 127 | my $_subclass = $1; 128 | my %_hash = (); 129 | while ( my ( $_key, $_element ) = 130 | each %{ $hash->{$_json_attribute} } ) 131 | { 132 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 133 | } 134 | $self->{$_key} = \%_hash; 135 | } 136 | elsif ( exists $hash->{$_json_attribute} ) 137 | { #hash(model), primitive, datetime 138 | $self->{$_key} = 139 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 140 | } 141 | else { 142 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 143 | $_key, $_json_attribute ); 144 | } 145 | } 146 | 147 | return $self; 148 | } 149 | 150 | # deserialize non-array data 151 | sub _deserialize { 152 | my ( $self, $type, $data ) = @_; 153 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 154 | 155 | if ( $type eq 'DateTime' ) { 156 | return DateTime->from_epoch( epoch => str2time($data) ); 157 | } 158 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 159 | return $data; 160 | } 161 | else { # hash(model) 162 | my $_instance = eval "Kubernetes::Object::$type->new()"; 163 | return $_instance->from_hash($data); 164 | } 165 | } 166 | 167 | __PACKAGE__->class_documentation( 168 | { 169 | description => 170 | 'IngressStatus describe the current state of the Ingress.', 171 | class => 'V1beta1IngressStatus', 172 | required => [], # TODO 173 | } 174 | ); 175 | 176 | __PACKAGE__->method_documentation( 177 | { 178 | 'load_balancer' => { 179 | datatype => 'V1LoadBalancerStatus', 180 | base_name => 'loadBalancer', 181 | description => '', 182 | format => '', 183 | read_only => '', 184 | }, 185 | } 186 | ); 187 | 188 | __PACKAGE__->openapi_types( 189 | { 190 | 'load_balancer' => 'V1LoadBalancerStatus' 191 | } 192 | ); 193 | 194 | __PACKAGE__->attribute_map( 195 | { 196 | 'load_balancer' => 'loadBalancer' 197 | } 198 | ); 199 | 200 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 201 | 202 | 1; 203 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1SessionAffinityConfig.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1SessionAffinityConfig; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use Kubernetes::Object::V1ClientIPConfig; 35 | 36 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 37 | 38 | # 39 | #SessionAffinityConfig represents the configurations of session affinity. 40 | # 41 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 42 | # REF: https://openapi-generator.tech 43 | # 44 | 45 | =begin comment 46 | 47 | Kubernetes 48 | 49 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 50 | 51 | The version of the OpenAPI document: v1.13.7 52 | 53 | Generated by: https://openapi-generator.tech 54 | 55 | =end comment 56 | 57 | =cut 58 | 59 | # 60 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 61 | # Do not edit the class manually. 62 | # Ref: https://openapi-generator.tech 63 | # 64 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 65 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 66 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 67 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 68 | 69 | # new plain object 70 | sub new { 71 | my ( $class, %args ) = @_; 72 | 73 | my $self = bless {}, $class; 74 | 75 | $self->init(%args); 76 | 77 | return $self; 78 | } 79 | 80 | # initialize the object 81 | sub init { 82 | my ( $self, %args ) = @_; 83 | 84 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 85 | my $args_key = $self->attribute_map->{$attribute}; 86 | $self->$attribute( $args{$args_key} ); 87 | } 88 | } 89 | 90 | # return perl hash 91 | sub to_hash { 92 | my $self = shift; 93 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 94 | 95 | return $_hash; 96 | } 97 | 98 | # used by JSON for serialization 99 | sub TO_JSON { 100 | my $self = shift; 101 | my $_data = {}; 102 | foreach my $_key ( keys %{ $self->attribute_map } ) { 103 | if ( defined $self->{$_key} ) { 104 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 105 | } 106 | } 107 | 108 | return $_data; 109 | } 110 | 111 | # from Perl hashref 112 | sub from_hash { 113 | my ( $self, $hash ) = @_; 114 | 115 | # loop through attributes and use openapi_types to deserialize the data 116 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 117 | my $_json_attribute = $self->attribute_map->{$_key}; 118 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 119 | my $_subclass = $1; 120 | my @_array = (); 121 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 122 | push @_array, $self->_deserialize( $_subclass, $_element ); 123 | } 124 | $self->{$_key} = \@_array; 125 | } 126 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 127 | my $_subclass = $1; 128 | my %_hash = (); 129 | while ( my ( $_key, $_element ) = 130 | each %{ $hash->{$_json_attribute} } ) 131 | { 132 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 133 | } 134 | $self->{$_key} = \%_hash; 135 | } 136 | elsif ( exists $hash->{$_json_attribute} ) 137 | { #hash(model), primitive, datetime 138 | $self->{$_key} = 139 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 140 | } 141 | else { 142 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 143 | $_key, $_json_attribute ); 144 | } 145 | } 146 | 147 | return $self; 148 | } 149 | 150 | # deserialize non-array data 151 | sub _deserialize { 152 | my ( $self, $type, $data ) = @_; 153 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 154 | 155 | if ( $type eq 'DateTime' ) { 156 | return DateTime->from_epoch( epoch => str2time($data) ); 157 | } 158 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 159 | return $data; 160 | } 161 | else { # hash(model) 162 | my $_instance = eval "Kubernetes::Object::$type->new()"; 163 | return $_instance->from_hash($data); 164 | } 165 | } 166 | 167 | __PACKAGE__->class_documentation( 168 | { 169 | description => 170 | 'SessionAffinityConfig represents the configurations of session affinity.', 171 | class => 'V1SessionAffinityConfig', 172 | required => [], # TODO 173 | } 174 | ); 175 | 176 | __PACKAGE__->method_documentation( 177 | { 178 | 'client_ip' => { 179 | datatype => 'V1ClientIPConfig', 180 | base_name => 'clientIP', 181 | description => '', 182 | format => '', 183 | read_only => '', 184 | }, 185 | } 186 | ); 187 | 188 | __PACKAGE__->openapi_types( 189 | { 190 | 'client_ip' => 'V1ClientIPConfig' 191 | } 192 | ); 193 | 194 | __PACKAGE__->attribute_map( 195 | { 196 | 'client_ip' => 'clientIP' 197 | } 198 | ); 199 | 200 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 201 | 202 | 1; 203 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1NamespaceStatus.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1NamespaceStatus; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #NamespaceStatus is information about the current status of a Namespace. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 168 | 'NamespaceStatus is information about the current status of a Namespace.', 169 | class => 'V1NamespaceStatus', 170 | required => [], # TODO 171 | } 172 | ); 173 | 174 | __PACKAGE__->method_documentation( 175 | { 176 | 'phase' => { 177 | datatype => 'string', 178 | base_name => 'phase', 179 | description => 180 | 'Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/', 181 | format => '', 182 | read_only => '', 183 | }, 184 | } 185 | ); 186 | 187 | __PACKAGE__->openapi_types( 188 | { 189 | 'phase' => 'string' 190 | } 191 | ); 192 | 193 | __PACKAGE__->attribute_map( 194 | { 195 | 'phase' => 'phase' 196 | } 197 | ); 198 | 199 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 200 | 201 | 1; 202 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1NodeDaemonEndpoints.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1NodeDaemonEndpoints; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use Kubernetes::Object::V1DaemonEndpoint; 35 | 36 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 37 | 38 | # 39 | #NodeDaemonEndpoints lists ports opened by daemons running on the Node. 40 | # 41 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 42 | # REF: https://openapi-generator.tech 43 | # 44 | 45 | =begin comment 46 | 47 | Kubernetes 48 | 49 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 50 | 51 | The version of the OpenAPI document: v1.13.7 52 | 53 | Generated by: https://openapi-generator.tech 54 | 55 | =end comment 56 | 57 | =cut 58 | 59 | # 60 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 61 | # Do not edit the class manually. 62 | # Ref: https://openapi-generator.tech 63 | # 64 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 65 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 66 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 67 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 68 | 69 | # new plain object 70 | sub new { 71 | my ( $class, %args ) = @_; 72 | 73 | my $self = bless {}, $class; 74 | 75 | $self->init(%args); 76 | 77 | return $self; 78 | } 79 | 80 | # initialize the object 81 | sub init { 82 | my ( $self, %args ) = @_; 83 | 84 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 85 | my $args_key = $self->attribute_map->{$attribute}; 86 | $self->$attribute( $args{$args_key} ); 87 | } 88 | } 89 | 90 | # return perl hash 91 | sub to_hash { 92 | my $self = shift; 93 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 94 | 95 | return $_hash; 96 | } 97 | 98 | # used by JSON for serialization 99 | sub TO_JSON { 100 | my $self = shift; 101 | my $_data = {}; 102 | foreach my $_key ( keys %{ $self->attribute_map } ) { 103 | if ( defined $self->{$_key} ) { 104 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 105 | } 106 | } 107 | 108 | return $_data; 109 | } 110 | 111 | # from Perl hashref 112 | sub from_hash { 113 | my ( $self, $hash ) = @_; 114 | 115 | # loop through attributes and use openapi_types to deserialize the data 116 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 117 | my $_json_attribute = $self->attribute_map->{$_key}; 118 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 119 | my $_subclass = $1; 120 | my @_array = (); 121 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 122 | push @_array, $self->_deserialize( $_subclass, $_element ); 123 | } 124 | $self->{$_key} = \@_array; 125 | } 126 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 127 | my $_subclass = $1; 128 | my %_hash = (); 129 | while ( my ( $_key, $_element ) = 130 | each %{ $hash->{$_json_attribute} } ) 131 | { 132 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 133 | } 134 | $self->{$_key} = \%_hash; 135 | } 136 | elsif ( exists $hash->{$_json_attribute} ) 137 | { #hash(model), primitive, datetime 138 | $self->{$_key} = 139 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 140 | } 141 | else { 142 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 143 | $_key, $_json_attribute ); 144 | } 145 | } 146 | 147 | return $self; 148 | } 149 | 150 | # deserialize non-array data 151 | sub _deserialize { 152 | my ( $self, $type, $data ) = @_; 153 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 154 | 155 | if ( $type eq 'DateTime' ) { 156 | return DateTime->from_epoch( epoch => str2time($data) ); 157 | } 158 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 159 | return $data; 160 | } 161 | else { # hash(model) 162 | my $_instance = eval "Kubernetes::Object::$type->new()"; 163 | return $_instance->from_hash($data); 164 | } 165 | } 166 | 167 | __PACKAGE__->class_documentation( 168 | { 169 | description => 170 | 'NodeDaemonEndpoints lists ports opened by daemons running on the Node.', 171 | class => 'V1NodeDaemonEndpoints', 172 | required => [], # TODO 173 | } 174 | ); 175 | 176 | __PACKAGE__->method_documentation( 177 | { 178 | 'kubelet_endpoint' => { 179 | datatype => 'V1DaemonEndpoint', 180 | base_name => 'kubeletEndpoint', 181 | description => '', 182 | format => '', 183 | read_only => '', 184 | }, 185 | } 186 | ); 187 | 188 | __PACKAGE__->openapi_types( 189 | { 190 | 'kubelet_endpoint' => 'V1DaemonEndpoint' 191 | } 192 | ); 193 | 194 | __PACKAGE__->attribute_map( 195 | { 196 | 'kubelet_endpoint' => 'kubeletEndpoint' 197 | } 198 | ); 199 | 200 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 201 | 202 | 1; 203 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1VolumeNodeAffinity.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1VolumeNodeAffinity; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use Kubernetes::Object::V1NodeSelector; 35 | 36 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 37 | 38 | # 39 | #VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. 40 | # 41 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 42 | # REF: https://openapi-generator.tech 43 | # 44 | 45 | =begin comment 46 | 47 | Kubernetes 48 | 49 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 50 | 51 | The version of the OpenAPI document: v1.13.7 52 | 53 | Generated by: https://openapi-generator.tech 54 | 55 | =end comment 56 | 57 | =cut 58 | 59 | # 60 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 61 | # Do not edit the class manually. 62 | # Ref: https://openapi-generator.tech 63 | # 64 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 65 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 66 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 67 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 68 | 69 | # new plain object 70 | sub new { 71 | my ( $class, %args ) = @_; 72 | 73 | my $self = bless {}, $class; 74 | 75 | $self->init(%args); 76 | 77 | return $self; 78 | } 79 | 80 | # initialize the object 81 | sub init { 82 | my ( $self, %args ) = @_; 83 | 84 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 85 | my $args_key = $self->attribute_map->{$attribute}; 86 | $self->$attribute( $args{$args_key} ); 87 | } 88 | } 89 | 90 | # return perl hash 91 | sub to_hash { 92 | my $self = shift; 93 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 94 | 95 | return $_hash; 96 | } 97 | 98 | # used by JSON for serialization 99 | sub TO_JSON { 100 | my $self = shift; 101 | my $_data = {}; 102 | foreach my $_key ( keys %{ $self->attribute_map } ) { 103 | if ( defined $self->{$_key} ) { 104 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 105 | } 106 | } 107 | 108 | return $_data; 109 | } 110 | 111 | # from Perl hashref 112 | sub from_hash { 113 | my ( $self, $hash ) = @_; 114 | 115 | # loop through attributes and use openapi_types to deserialize the data 116 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 117 | my $_json_attribute = $self->attribute_map->{$_key}; 118 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 119 | my $_subclass = $1; 120 | my @_array = (); 121 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 122 | push @_array, $self->_deserialize( $_subclass, $_element ); 123 | } 124 | $self->{$_key} = \@_array; 125 | } 126 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 127 | my $_subclass = $1; 128 | my %_hash = (); 129 | while ( my ( $_key, $_element ) = 130 | each %{ $hash->{$_json_attribute} } ) 131 | { 132 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 133 | } 134 | $self->{$_key} = \%_hash; 135 | } 136 | elsif ( exists $hash->{$_json_attribute} ) 137 | { #hash(model), primitive, datetime 138 | $self->{$_key} = 139 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 140 | } 141 | else { 142 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 143 | $_key, $_json_attribute ); 144 | } 145 | } 146 | 147 | return $self; 148 | } 149 | 150 | # deserialize non-array data 151 | sub _deserialize { 152 | my ( $self, $type, $data ) = @_; 153 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 154 | 155 | if ( $type eq 'DateTime' ) { 156 | return DateTime->from_epoch( epoch => str2time($data) ); 157 | } 158 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 159 | return $data; 160 | } 161 | else { # hash(model) 162 | my $_instance = eval "Kubernetes::Object::$type->new()"; 163 | return $_instance->from_hash($data); 164 | } 165 | } 166 | 167 | __PACKAGE__->class_documentation( 168 | { 169 | description => 170 | 'VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.', 171 | class => 'V1VolumeNodeAffinity', 172 | required => [], # TODO 173 | } 174 | ); 175 | 176 | __PACKAGE__->method_documentation( 177 | { 178 | 'required' => { 179 | datatype => 'V1NodeSelector', 180 | base_name => 'required', 181 | description => '', 182 | format => '', 183 | read_only => '', 184 | }, 185 | } 186 | ); 187 | 188 | __PACKAGE__->openapi_types( 189 | { 190 | 'required' => 'V1NodeSelector' 191 | } 192 | ); 193 | 194 | __PACKAGE__->attribute_map( 195 | { 196 | 'required' => 'required' 197 | } 198 | ); 199 | 200 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 201 | 202 | 1; 203 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1NamespaceSpec.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1NamespaceSpec; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 35 | 36 | # 37 | #NamespaceSpec describes the attributes on a Namespace. 38 | # 39 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 40 | # REF: https://openapi-generator.tech 41 | # 42 | 43 | =begin comment 44 | 45 | Kubernetes 46 | 47 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 48 | 49 | The version of the OpenAPI document: v1.13.7 50 | 51 | Generated by: https://openapi-generator.tech 52 | 53 | =end comment 54 | 55 | =cut 56 | 57 | # 58 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 59 | # Do not edit the class manually. 60 | # Ref: https://openapi-generator.tech 61 | # 62 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 63 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 64 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 65 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 66 | 67 | # new plain object 68 | sub new { 69 | my ( $class, %args ) = @_; 70 | 71 | my $self = bless {}, $class; 72 | 73 | $self->init(%args); 74 | 75 | return $self; 76 | } 77 | 78 | # initialize the object 79 | sub init { 80 | my ( $self, %args ) = @_; 81 | 82 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 83 | my $args_key = $self->attribute_map->{$attribute}; 84 | $self->$attribute( $args{$args_key} ); 85 | } 86 | } 87 | 88 | # return perl hash 89 | sub to_hash { 90 | my $self = shift; 91 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 92 | 93 | return $_hash; 94 | } 95 | 96 | # used by JSON for serialization 97 | sub TO_JSON { 98 | my $self = shift; 99 | my $_data = {}; 100 | foreach my $_key ( keys %{ $self->attribute_map } ) { 101 | if ( defined $self->{$_key} ) { 102 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 103 | } 104 | } 105 | 106 | return $_data; 107 | } 108 | 109 | # from Perl hashref 110 | sub from_hash { 111 | my ( $self, $hash ) = @_; 112 | 113 | # loop through attributes and use openapi_types to deserialize the data 114 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 115 | my $_json_attribute = $self->attribute_map->{$_key}; 116 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 117 | my $_subclass = $1; 118 | my @_array = (); 119 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 120 | push @_array, $self->_deserialize( $_subclass, $_element ); 121 | } 122 | $self->{$_key} = \@_array; 123 | } 124 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 125 | my $_subclass = $1; 126 | my %_hash = (); 127 | while ( my ( $_key, $_element ) = 128 | each %{ $hash->{$_json_attribute} } ) 129 | { 130 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 131 | } 132 | $self->{$_key} = \%_hash; 133 | } 134 | elsif ( exists $hash->{$_json_attribute} ) 135 | { #hash(model), primitive, datetime 136 | $self->{$_key} = 137 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 138 | } 139 | else { 140 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 141 | $_key, $_json_attribute ); 142 | } 143 | } 144 | 145 | return $self; 146 | } 147 | 148 | # deserialize non-array data 149 | sub _deserialize { 150 | my ( $self, $type, $data ) = @_; 151 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 152 | 153 | if ( $type eq 'DateTime' ) { 154 | return DateTime->from_epoch( epoch => str2time($data) ); 155 | } 156 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 157 | return $data; 158 | } 159 | else { # hash(model) 160 | my $_instance = eval "Kubernetes::Object::$type->new()"; 161 | return $_instance->from_hash($data); 162 | } 163 | } 164 | 165 | __PACKAGE__->class_documentation( 166 | { 167 | description => 'NamespaceSpec describes the attributes on a Namespace.', 168 | class => 'V1NamespaceSpec', 169 | required => [], # TODO 170 | } 171 | ); 172 | 173 | __PACKAGE__->method_documentation( 174 | { 175 | 'finalizers' => { 176 | datatype => 'ARRAY[string]', 177 | base_name => 'finalizers', 178 | description => 179 | 'Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/', 180 | format => '', 181 | read_only => '', 182 | }, 183 | } 184 | ); 185 | 186 | __PACKAGE__->openapi_types( 187 | { 188 | 'finalizers' => 'ARRAY[string]' 189 | } 190 | ); 191 | 192 | __PACKAGE__->attribute_map( 193 | { 194 | 'finalizers' => 'finalizers' 195 | } 196 | ); 197 | 198 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 199 | 200 | 1; 201 | -------------------------------------------------------------------------------- /lib/Kubernetes/Object/V1APIServiceStatus.pm: -------------------------------------------------------------------------------- 1 | 2 | =begin comment 3 | 4 | Kubernetes 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 7 | 8 | The version of the OpenAPI document: v1.13.7 9 | 10 | Generated by: https://openapi-generator.tech 11 | 12 | =end comment 13 | 14 | =cut 15 | 16 | # 17 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 18 | # Do not edit the class manually. 19 | # Ref: https://openapi-generator.tech 20 | # 21 | package Kubernetes::Object::V1APIServiceStatus; 22 | 23 | require 5.6.0; 24 | use strict; 25 | use warnings; 26 | use utf8; 27 | use JSON qw(decode_json); 28 | use Data::Dumper; 29 | use Module::Runtime qw(use_module); 30 | use Log::Any qw($log); 31 | use Date::Parse; 32 | use DateTime; 33 | 34 | use Kubernetes::Object::V1APIServiceCondition; 35 | 36 | use base ( "Class::Accessor", "Class::Data::Inheritable" ); 37 | 38 | # 39 | #APIServiceStatus contains derived information about an API server 40 | # 41 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. 42 | # REF: https://openapi-generator.tech 43 | # 44 | 45 | =begin comment 46 | 47 | Kubernetes 48 | 49 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 50 | 51 | The version of the OpenAPI document: v1.13.7 52 | 53 | Generated by: https://openapi-generator.tech 54 | 55 | =end comment 56 | 57 | =cut 58 | 59 | # 60 | # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 61 | # Do not edit the class manually. 62 | # Ref: https://openapi-generator.tech 63 | # 64 | __PACKAGE__->mk_classdata( 'attribute_map' => {} ); 65 | __PACKAGE__->mk_classdata( 'openapi_types' => {} ); 66 | __PACKAGE__->mk_classdata( 'method_documentation' => {} ); 67 | __PACKAGE__->mk_classdata( 'class_documentation' => {} ); 68 | 69 | # new plain object 70 | sub new { 71 | my ( $class, %args ) = @_; 72 | 73 | my $self = bless {}, $class; 74 | 75 | $self->init(%args); 76 | 77 | return $self; 78 | } 79 | 80 | # initialize the object 81 | sub init { 82 | my ( $self, %args ) = @_; 83 | 84 | foreach my $attribute ( keys %{ $self->attribute_map } ) { 85 | my $args_key = $self->attribute_map->{$attribute}; 86 | $self->$attribute( $args{$args_key} ); 87 | } 88 | } 89 | 90 | # return perl hash 91 | sub to_hash { 92 | my $self = shift; 93 | my $_hash = decode_json( JSON->new->convert_blessed->encode($self) ); 94 | 95 | return $_hash; 96 | } 97 | 98 | # used by JSON for serialization 99 | sub TO_JSON { 100 | my $self = shift; 101 | my $_data = {}; 102 | foreach my $_key ( keys %{ $self->attribute_map } ) { 103 | if ( defined $self->{$_key} ) { 104 | $_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; 105 | } 106 | } 107 | 108 | return $_data; 109 | } 110 | 111 | # from Perl hashref 112 | sub from_hash { 113 | my ( $self, $hash ) = @_; 114 | 115 | # loop through attributes and use openapi_types to deserialize the data 116 | while ( my ( $_key, $_type ) = each %{ $self->openapi_types } ) { 117 | my $_json_attribute = $self->attribute_map->{$_key}; 118 | if ( $_type =~ /^array\[(.+)\]$/i ) { # array 119 | my $_subclass = $1; 120 | my @_array = (); 121 | foreach my $_element ( @{ $hash->{$_json_attribute} } ) { 122 | push @_array, $self->_deserialize( $_subclass, $_element ); 123 | } 124 | $self->{$_key} = \@_array; 125 | } 126 | elsif ( $_type =~ /^hash\[string,(.+)\]$/i ) { # hash 127 | my $_subclass = $1; 128 | my %_hash = (); 129 | while ( my ( $_key, $_element ) = 130 | each %{ $hash->{$_json_attribute} } ) 131 | { 132 | $_hash{$_key} = $self->_deserialize( $_subclass, $_element ); 133 | } 134 | $self->{$_key} = \%_hash; 135 | } 136 | elsif ( exists $hash->{$_json_attribute} ) 137 | { #hash(model), primitive, datetime 138 | $self->{$_key} = 139 | $self->_deserialize( $_type, $hash->{$_json_attribute} ); 140 | } 141 | else { 142 | $log->debugf( "Warning: %s (%s) does not exist in input hash\n", 143 | $_key, $_json_attribute ); 144 | } 145 | } 146 | 147 | return $self; 148 | } 149 | 150 | # deserialize non-array data 151 | sub _deserialize { 152 | my ( $self, $type, $data ) = @_; 153 | $log->debugf( "deserializing %s with %s", Dumper($data), $type ); 154 | 155 | if ( $type eq 'DateTime' ) { 156 | return DateTime->from_epoch( epoch => str2time($data) ); 157 | } 158 | elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { 159 | return $data; 160 | } 161 | else { # hash(model) 162 | my $_instance = eval "Kubernetes::Object::$type->new()"; 163 | return $_instance->from_hash($data); 164 | } 165 | } 166 | 167 | __PACKAGE__->class_documentation( 168 | { 169 | description => 170 | 'APIServiceStatus contains derived information about an API server', 171 | class => 'V1APIServiceStatus', 172 | required => [], # TODO 173 | } 174 | ); 175 | 176 | __PACKAGE__->method_documentation( 177 | { 178 | 'conditions' => { 179 | datatype => 'ARRAY[V1APIServiceCondition]', 180 | base_name => 'conditions', 181 | description => 'Current service state of apiService.', 182 | format => '', 183 | read_only => '', 184 | }, 185 | } 186 | ); 187 | 188 | __PACKAGE__->openapi_types( 189 | { 190 | 'conditions' => 'ARRAY[V1APIServiceCondition]' 191 | } 192 | ); 193 | 194 | __PACKAGE__->attribute_map( 195 | { 196 | 'conditions' => 'conditions' 197 | } 198 | ); 199 | 200 | __PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); 201 | 202 | 1; 203 | --------------------------------------------------------------------------------